http://engine.wohlnet.ru/pgewiki/How_To ... t_commandsMikkofier wrote:How does one change the amount of hits that it takes to kill a 'boss' npc?
LunaDLL/LunaLUA help thread
- SAJewers
- ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
- Posts: 4219
- Joined: 12 years ago
- Location: Nova Scotia
Re: LunaDLL/LunaLUA help thread
Re: LunaDLL/LunaLUA help thread
Hey, is there any way to turn off the cinematX HUD in a level that uses cinematX?
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
If you're using an old version of cinematX, no.7NameSam wrote:Hey, is there any way to turn off the cinematX HUD in a level that uses cinematX?
If you use a new enough version of cinematX, this is off by default actually, but you can turn it back on by calling cinematX.config with "true" as the third argument.
Take a look at line 1679 of cinematX.lua's current version.
-
- https://www.youtube.com/watch?v=BODxOghVmko
- Posts: 1864
- Joined: 10 years ago
- First name: Mack
- https://rixithechao.talkhaus.com/
Re: LunaDLL/LunaLUA help thread
Alternatively, you can just set cinematX.useHUDBox to false in the newer versions.
config() is going to be deprecated. The absolute latest version, which I haven't committed to github yet, has a better config function that uses named arguments. Same thing with configDialog() and startDialog().
config() is going to be deprecated. The absolute latest version, which I haven't committed to github yet, has a better config function that uses named arguments. Same thing with configDialog() and startDialog().
Delightful Adventure Enhanced is out now!
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their development! thread, invite link
(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)
Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their development! thread, invite link
(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)
Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)
Re: LunaDLL/LunaLUA help thread
So I gotta be missing something with loadAnimatedImage...
Using Graphics.loadImage("Example.gif") works (and I can draw the first frame of the gif using both drawImage and placeSprite) but Graphics.loadAnimatedImage("Example.gif") gives me an seemingly empty table, what the heck? Tested two different animated gifs with the same result
I could also be missing some easier way to import custom animation without repurposing npcs...
Edit: I missed that loadAnimatedImage returns multiple values, doh.
Edit2: But still doesn't change that the table I get is completely empty GAAAAH FRUSTRATING.
Using Graphics.loadImage("Example.gif") works (and I can draw the first frame of the gif using both drawImage and placeSprite) but Graphics.loadAnimatedImage("Example.gif") gives me an seemingly empty table, what the heck? Tested two different animated gifs with the same result
I could also be missing some easier way to import custom animation without repurposing npcs...
Edit: I missed that loadAnimatedImage returns multiple values, doh.
Edit2: But still doesn't change that the table I get is completely empty GAAAAH FRUSTRATING.
Last edited by Duker 8 years ago, edited 2 times in total.
fart.
Re: LunaDLL/LunaLUA help thread
I'm trying to use multipoints and I'm noticing that npcs aren't already spawned when I reenter the level after getting a multipoint. What's happening?
Re: LunaDLL/LunaLUA help thread
You have an old version of multipoints I'm guessing. This was a bug before version 3.0.10. 3.0.11 is the most recent version.Axon wrote:I'm trying to use multipoints and I'm noticing that npcs aren't already spawned when I reenter the level after getting a multipoint. What's happening?
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
In my level I was able to turn the detonators into pseudo P-switches, and they have a little custom tune that plays when the switch is pressed. Would it be possible to lower the volume of the background music while this happens? Both the start and the end of the P-Switch time are activated via SMBX events, so onEvent triggers could be easily utilized.
- SAJewers
- ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
- Posts: 4219
- Joined: 12 years ago
- Location: Nova Scotia
Re: LunaDLL/LunaLUA help thread
Note that we have plans to imeplement ASMT's ticking P-switch thingy, so you may not need to do it yourself.
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
After looking around some of the LunaLUA tutorials, I found out how to change the music volume with LUA! ^_^ Though, I don't know what the default volume level is for SMBX music.SAJewers wrote:Note that we have plans to imeplement ASMT's ticking P-switch thingy, so you may not need to do it yourself.
- Wohlstand
- Moondust and TheXTech developer
- Posts: 186
- Joined: 10 years ago
- First name: Vitaly
- Pronouns: he/him/his
- Location: Moscow, Russia
Re: LunaDLL/LunaLUA help thread
Default SMBX Music volume is 0.4 (400/1000 by MCI volume scale), so: 128*0.4=51.2 -> 51 - value for a music volume function.Karatekid5 wrote:After looking around some of the LunaLUA tutorials, I found out how to change the music volume with LUA! ^_^ Though, I don't know what the default volume level is for SMBX music.SAJewers wrote:Note that we have plans to imeplement ASMT's ticking P-switch thingy, so you may not need to do it yourself.
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
Excellent, it works perfectly! Thank you! :)Wohlstand wrote:Default SMBX Music volume is 0.4 (400/1000 by MCI volume scale), so: 128*0.4=51.2 -> 51 - value for a music volume function.
- ztarwuff
- What the heck is a flair and why am I being asked to write one for my profile?
- Posts: 553
- Joined: 11 years ago
- Location: Not a great mental space TBH.
Re: LunaDLL/LunaLUA help thread
Does anybody have a functioning Multipoints Lua code I can look at? I just don't understand the tutorial on the PGEwiki and searching this thread isn't bringing anything up. I've tried using the search terms checkpoints, check point, multipoint, but to no avail.
Also, is there a way of forcing a layer to display above another? Ever since I converted a bunch of layers to PNG, they display strangely both in the SMBX Editor and the PGE editor.
Also, is there a way of forcing a layer to display above another? Ever since I converted a bunch of layers to PNG, they display strangely both in the SMBX Editor and the PGE editor.
Re: LunaDLL/LunaLUA help thread
There are a few A2XT levels that use multipoints. Descent of Nine and What's About Railways? both use it.ztarwuff wrote:Does anybody have a functioning Multipoints Lua code I can look at? I just don't understand the tutorial on the PGEwiki and searching this thread isn't bringing anything up. I've tried using the search terms checkpoints, check point, multipoint, but to no avail.
Also, is there a way of forcing a layer to display above another? Ever since I converted a bunch of layers to PNG, they display strangely both in the SMBX Editor and the PGE editor.
As for making a layer display above another, that's sort of not what SMBX layers are. "Layer" is a pretty poor term to be honest, as they're more like named groups. You can display Lua-drawn graphics with a specific order using the "WP" drawing commands, but otherwise you're stuck with using foreground objects.
- ztarwuff
- What the heck is a flair and why am I being asked to write one for my profile?
- Posts: 553
- Joined: 11 years ago
- Location: Not a great mental space TBH.
Re: LunaDLL/LunaLUA help thread
Ah, that's great. I'll have a look at those two. Thank you.Hoeloe wrote:There are a few A2XT levels that use multipoints. Descent of Nine and What's About Railways? both use it.
They're all foreground objects. I'll concentrate on multipoints for now.As for making a layer display above another, that's sort of not what SMBX layers are. "Layer" is a pretty poor term to be honest, as they're more like named groups. You can display Lua-drawn graphics with a specific order using the "WP" drawing commands, but otherwise you're stuck with using foreground objects.
EDIT: Whilst i'm at it, I might as well review your level.
Re: LunaDLL/LunaLUA help thread
Does anyone know how to do autoscrolling with LunaLua? I know exactly how to do it with LunaDLL Autocode (use the PushScreenBoundary function), but I'm not sure what the equivalent in LunaLua is. I tried getting the boundary and setting the border values, but nothing sticks. For example, this:
doesn't actually change the right border position. I feel like I'm missing something obvious...
I'm using LunaLua v0.7.2.2.
Code: Select all
function onLoop()
local sec = Section.get(1);
Text.print("before: "..tostring(sec.boundary.right),0,64);
sec.boundary.right = -19922;
Text.print("after: "..tostring(sec.boundary.right),0,80);
end
I'm using LunaLua v0.7.2.2.
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
I'm guessing the mistake is most likely that you're wanting to set this in what the editors call "Section 1". Getting the first section in LunaLua is Section.get(0), not Section.get(1)Axon wrote:I feel like I'm missing something obvious...
Re: LunaDLL/LunaLUA help thread
No, that's not it; when I use Section.get(0), I get an error message telling me to use a number between 1 and 21. Even then, I feel the code should work regardless of the section the player is in.Rednaxela wrote:I'm guessing the mistake is most likely that you're wanting to set this in what the editors call "Section 1". Getting the first section in LunaLua is Section.get(0), not Section.get(1)Axon wrote:I feel like I'm missing something obvious...
- ztarwuff
- What the heck is a flair and why am I being asked to write one for my profile?
- Posts: 553
- Joined: 11 years ago
- Location: Not a great mental space TBH.
Re: LunaDLL/LunaLUA help thread
I'm not entirely sure what's happening but my third Lua Checkpoint isn't triggering in my level: Gravity Falls. Would anybody be able to help me in figuring out why?
Granted, there's an axe in the third location, but there's an axe in all three locations. (It's there to reset the layers).
Granted, there's an axe in the third location, but there's an axe in all three locations. (It's there to reset the layers).
Code: Select all
multipoints = loadAPI("multipoints");
--Section 5 Checkpoint Bottom of Vertical Shaft
multipoints.addLuaCheckpoint(-119935, -120063, 4);
--Section 9 Empty Room
multipoints.addLuaCheckpoint(-39952, -40062, 8);
--Section 12 Before Boss
multipoints.addLuaCheckpoint(-20065, -19937, 11);
- GenesisJames
- Music reviewer and drawer of cute girls.
- Posts: 529
- Joined: 11 years ago
- Location: United States
Re: LunaDLL/LunaLUA help thread
I'm having some trouble getting my filter to work. SAJewers gave me the code, and I put it in a text file, but when I play the level through the editor, it doesn't seem to make me that character. Anybody know what I might be doing wrong?
Re: LunaDLL/LunaLUA help thread
I don't know what your specific code is, but something like this should work to force a character:Louiejub wrote:I'm having some trouble getting my filter to work. SAJewers gave me the code, and I put it in a text file, but when I play the level through the editor, it doesn't seem to make me that character. Anybody know what I might be doing wrong?
Code: Select all
function onLoad()
Player(1).character = CHARACTER_PEACH;
end
Code: Select all
local iniDone = false;
function onLoop()
if (not iniDone) then
Player(1).character = CHARACTER_PEACH;
iniDone = true;
end
end
- GenesisJames
- Music reviewer and drawer of cute girls.
- Posts: 529
- Joined: 11 years ago
- Location: United States
Re: LunaDLL/LunaLUA help thread
This was the code that SAJewers gave me:Axon wrote:I don't know what your specific code is, but something like this should work to force a character:Louiejub wrote:I'm having some trouble getting my filter to work. SAJewers gave me the code, and I put it in a text file, but when I play the level through the editor, it doesn't seem to make me that character. Anybody know what I might be doing wrong?Or alternatively, if the previous code gives you an annoying invalid-player-pointer window thing:Code: Select all
function onLoad() Player(1).character = CHARACTER_PEACH; end
Code: Select all
local iniDone = false; function onLoop() if (not iniDone) then Player(1).character = CHARACTER_PEACH; iniDone = true; end end
Code: Select all
function onLoad()
if (player.isValid) then
player.character = CHARACTER_TOAD;
end
end
I'll try your examples tomorrow.
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
If you level file is "worlds\episodeFolder\myLevel.lvl", this should be in the file "worlds\episodeFolder\myLevel\lunadll.lua"Louiejub wrote:It could be very possible that I'm not putting it in the right place or something, but I put my txt file in the general folder where the level is and the folder where the music is, and neither of them worked.
I'll try your examples tomorrow.
The fact that you say "txt file" makes me wonder if you have a .txt extension when you should have a .lua extension perhaps also.
- GenesisJames
- Music reviewer and drawer of cute girls.
- Posts: 529
- Joined: 11 years ago
- Location: United States
Re: LunaDLL/LunaLUA help thread
How would I make it a lua extension? That's probably it.Rednaxela wrote:If you level file is "worlds\episodeFolder\myLevel.lvl", this should be in the file "worlds\episodeFolder\myLevel\lunadll.lua"Louiejub wrote:It could be very possible that I'm not putting it in the right place or something, but I put my txt file in the general folder where the level is and the folder where the music is, and neither of them worked.
I'll try your examples tomorrow.
The fact that you say "txt file" makes me wonder if you have a .txt extension when you should have a .lua extension perhaps also.
Re: LunaDLL/LunaLUA help thread
Try replacing the two "player" with two "Player(1)", maybe.Louiejub wrote: This was the code that SAJewers gave me:
Code: Select all
function onLoad() if (player.isValid) then player.character = CHARACTER_TOAD; end end
edit:
Open notepad, paste the code and it should give you the option to choose the extension you want when you "Save As".Louiejub wrote: How would I make it a lua extension?