LunaDLL/LunaLUA help thread

The second SMBX collab!
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Thanks for that reminder.
Like I said, would filtering players have that slight delay where you could see the unfiltered player?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

how's there going to be a delay when they happen at the same time

there's a delay because youre relying on a filter in #0, which has already run, and then changing the character later on, so the filter doesnt run again until the next frame
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Oh so it can't be a global lunadll event? It has to be manually made for all sections?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Tt can be global. It's just that the filters need to be after the character changer, or you will see the unfiltered character for 1 frame.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
tigermoon
Posts: 0
Joined: 9 years ago
Location: Is crazy a location? If so, I've been here for ages. :3

Re: LunaDLL help thread

Post by tigermoon »

Probably a dumb question, but is it possible to have powerup-specific codes? Like, having alt run put a Bullet Bill in the character's hands(or feet), but only if they're small?
WARNING: User is known for stupid ideas. Listen at your own risk.
... I prefer the one where you compare yourself to gremlins...
User avatar
Willhart
Stalker, Doxxer, and Sexual Harasser
Banned
Posts: 2434
Joined: 12 years ago
Location: Finland

Re: LunaDLL help thread

Post by Willhart »

tigermoon wrote:Probably a dumb question, but is it possible to have powerup-specific codes? Like, having alt run put a Bullet Bill in the character's hands(or feet), but only if they're small?
You can use "OnPlayerMem". Example for how to use it below.

// When player current powerup ("w" size memory at 0x112) equals 3 (fire flower), activate event 1000
OnPlayerMem,0x112,3,0,1000,0,w
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Yes but you should forget about forcing to hold a random sprite part of that. If you want to do that you'll have to write c++ code because it's quite complicated for the scripts.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
tigermoon
Posts: 0
Joined: 9 years ago
Location: Is crazy a location? If so, I've been here for ages. :3

Re: LunaDLL help thread

Post by tigermoon »

Well I didn't exactly want to do that, it was just the first thing that came to mind as an example. :P
WARNING: User is known for stupid ideas. Listen at your own risk.
... I prefer the one where you compare yourself to gremlins...
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Then yes it's pretty easy to have powerup-specific codes.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Axon
Posts: 29
Joined: 9 years ago
Location: At a place.

Re: LunaDLL help thread

Post by Axon »

If anyone is interested, here's an example of how to have a working midpoint directly in the middle of an autoscrolling section:

https://www.dropbox.com/s/ui2lad9ipi7am ... dpoint.rar
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

I just figured out how to keep certain NPCs from despawning, and they will continue processing while not on the screen

NPCMemSet,205,0x12A,55,0,0,w

205 is the metroid wall walker thing
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Willhart
Stalker, Doxxer, and Sexual Harasser
Banned
Posts: 2434
Joined: 12 years ago
Location: Finland

Re: LunaDLL help thread

Post by Willhart »

Kil wrote:I just figured out how to keep certain NPCs from despawning, and they will continue processing while not on the screen

NPCMemSet,205,0x12A,55,0,0,w

205 is the metroid wall walker thing
It works really well. This will be super helpful.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Is it possible to tell a kind of npc (beach Koopas for example) to stop even existing?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Maybe change their IDs to 0
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

I'm eating crow here because I forgot to praise this level, but are the custom bosses in

Calleoca

something that I or someone else would be able to do? There's no codes in the txt, and I searched around and saw something about the DLL. Are the behaviors hardcoded in the DLL?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

docopoper hardcoded that inside the DLL using C/++

you could try using the scripted sprite framework but I haven't made the tutorial for it yet
DON'T PM me. Ask your question in the help thread so everyone can be answered.
LukasSMBX
Posts: 0
Joined: 8 years ago

Re: LunaDLL help thread

Post by LukasSMBX »

Kill, i need your help. I want a code to have when you hit the smb3 red koopa, (normaly it becomes a shell when stomping it.) instead of that when he is hitten he will turn in to a smb3 bob omb that is about the explode. Can you please give me a code for that? I really need it.
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

That's probably impossible
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Can't you change it to the npc ID of the bob omb?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

But how do you target only the shells that have been hit and not all of them? By the way, this is possible but not with the scripts which are too crappy.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

I'm trying to make a moving platform with LunaDLL that accelerates and decelerates to give smooth motion. However, my platform is not moving at all. This is my LunaDLL code, put inside a text file called lunadll.txt in my level folder. Does anyone know what I'm doing wrong? I've consistently had issues making LunaDLL do anything more complex than drawing basic text or filtering the player. What am I doing wrong?

Code: Select all

#0
Trigger,0,1000,0,0,0,0

//Move layer left, stop when length runs out
#1000
AccelerateLayerX,34,-2,0,0,2,-0.1
Timer,0,1001,1,0,200

#1001
DeccelerateLayerX,34,0,0,0,0,0.1
Timer,0,1002,1,0,200

//Move layer right, stop when length runs out
#1002
AccelerateLayerX,34,2,0,0,2,0.1
Timer,0,1003,1,0,200

#1003
DeccelerateLayerX,34,0,0,0,0,0.1
Timer,0,1000,1,0,200

#END
Oh how I wish I could just write this out in C++ or a similar language, rather than having to work with this.
Image
Image
Image
Image
Image
User avatar
Willhart
Stalker, Doxxer, and Sexual Harasser
Banned
Posts: 2434
Joined: 12 years ago
Location: Finland

Re: LunaDLL help thread

Post by Willhart »

The trigger should probably be on #-1 so that it only triggers on level load and not on every frame.
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Does that not work? Because it works for me. Here's the version I tested which moves my layer 3 (4th in list)

Code: Select all

#0
Trigger,0,1000,0,0,0,0

//Move layer left, stop when length runs out
#1000
AccelerateLayerX,3,-2,0,0,200,-0.1
Timer,0,1001,1,0,200
DebugPrint,0,0,0,0,200,0

#1001
DeccelerateLayerX,3,0,0,0,200,0.1
Timer,0,1002,1,0,200

//Move layer right, stop when length runs out
#1002
AccelerateLayerX,3,2,0,0,200,0.1
Timer,0,1003,1,0,400

#1003
DeccelerateLayerX,3,0,0,0,200,0.1
Timer,0,1000,1,0,200

#END
You should probably set the lengths to all 200 by the way. You''re triggering some codes with length 0, meaning they will stay around forever, and each time this cycles there will be 1 more code existing.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

For some reason, the code Kil posted seems to work perfectly. Not sure why my original one didn't.
Image
Image
Image
Image
Image
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

It wouldn't ever deccelerate because the accelerator had length 0. Since you're using timers of 200 to cycle, you should make the other codes being triggered also 200 length.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Post Reply