(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Kil wrote:You can use SetVar to create your own variable and increase it based on a condition. You can then use that variable as a condition (if it's greater than 6, move a gate out of the way or something) with IfVar.
Would it be saved in the save file? And if so, would it be possible for there to actually be a modified "you need x stars to open this door" message?
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

You can't save it, so it would reset when they closed the game.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Mabel
Just west of wierd
Posts: 302
Joined: 10 years ago
https://marbels.talkhaus.com/

Re: LunaDLL help thread

Post by Mabel »

Kil wrote:Alright that will probably cause lag, for just one reason

Trigger,0,1000,0,0,0,0
[...]
ShowText,0,400,150,3,200,

Trigger is infinitely creating text that shows for 200 frames. That means the game will start to draw new text before the old text is done displaying - eventually all that text over itself 200 times per frame. Text command is slow enough to cause lag when there's that much actually. You'll start to get lag when you have over a hundred text commands printing at the same time. It should work fine if you change the time of all the show texts to 1
oh whoops, I forgot I didint need those texts anymore, guess ill remove them...

doesnt fix allowing multiple timer loops, however... :(


edit: holy crap I suck I left the trigger in #0 no wonder it never stops

Both loops work now, but How do I stop the first one?
Last edited by Mabel 9 years ago, edited 2 times in total.
Image
Image
Image Image
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Kil wrote:You can't save it, so it would reset when they closed the game.
What I was talking about was an actual game structure. I guess this is impossible? If so, thanks for answering anyways.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

TiKi wrote:
Kil wrote:You can't save it, so it would reset when they closed the game.
What I was talking about was an actual game structure. I guess this is impossible? If so, thanks for answering anyways.
You can't save the stuff so it's pointless to try
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Sturg
Gets his freak on with VGM
Posts: 710
Joined: 13 years ago
First name: sturgyman
Location: - :noiƚɒɔo⅃
Contact:

Re: LunaDLL help thread

Post by Sturg »

Sorry if this has been asked before, but is it possible to change a certain lunadll event once an npc has disappeared globally?

What I'm trying to do:
So I have a SHOW TEXT command immediately at the beginning of the level in Section 1 which goes away after time, is there some way for that text to not show up once the mid-point has been reached and deleted in the same section, and after when a player has died and starts the level at the mid-point (not sure if that's global)?
ImageImage
Image ImageImage
RIP FISH NIPPLE BANNER
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

You can do it, the question is whether or not you find it worth the effort for that

First you need to change your ShowText command to be under a custom event, so it can get triggered by an IfVar.

#0
// If variable SturgMIDPOINT equals 0, then call the event to show the text
IfVar,0,0,0,2000,0,SturgMIDPOINT

#2000
ShowText, put your showtext stuff here
DeleteEventsFrom,2000,0,0,0,1,0

DeleteEventsFrom is there to delete #2000 so the text doesn't repeat forever.


So the new way your text is displayed is based on the SturgMIDPOINT variable. FInally, you need to set SturgMIDPOINT to 1 when you actually get the midpoint so the text will not show again.

You can either use TriggerZone to put a rectangle around your midpoint (hard if you don't know how) or use IfNPC to automatically detect when the midpoint sprite no longer exists in your level

#0
// Call event 2001 when NPC ??? no longer exists in the level
IfNPC,???,2,0,2001,0,0

#2001
// Set the SturgMIDPOINT variable to 1, inadvertently stopping the text in #2000 from showing
SetVar,0,0,1,0,0,SturgMIDPOINT

Change ??? to the NPC number of the midpoint sprite. I don't know what it is off the top of my head (this is why I hate NPC numbers)
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Grounder
Posts: 5817
Joined: 10 years ago

Re: LunaDLL help thread

Post by Grounder »

that would be 192
Why don't you eat me?

I am perfectly tasty...

AND I'LL STEAL YOUR SOUL! :twisted:

ImageImageImage
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

I would like to note for posterity that changing NPCs to a checkpoint or a SMW star doesn't have any effect - the stars just don't register on your counter, and the midpoints don't register as a midpoint - even if your changed npc is the only checkpoint in the level. You could use that property to make the tape on the left direction, and a "helper mushroom" that makes small demo large on the right side, an simply change a right-facing npc to 192
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1855
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL help thread

Post by Rixithechao »

TiKi wrote:
Kil wrote:You can use SetVar to create your own variable and increase it based on a condition. You can then use that variable as a condition (if it's greater than 6, move a gate out of the way or something) with IfVar.
Would it be saved in the save file? And if so, would it be possible for there to actually be a modified "you need x stars to open this door" message?
Kil wrote:
TiKi wrote:
Kil wrote:You can't save it, so it would reset when they closed the game.
What I was talking about was an actual game structure. I guess this is impossible? If so, thanks for answering anyways.
You can't save the stuff so it's pointless to try
I suggested this a few pages ago, there seems to be some data in the save file format that corresponds with unused player memory (like +0x1E and +0x2A). In theory, those addresses could be used for limited persistent storage.

I was having a lot of trouble with LunaDLL at the time (I think I was having the same issue as Hoeloe, outdated copy) and I got hung up on an overly-complex safety net thing, so I never did get around to testing this method myself. I still think it's worth looking into.
Delightful Adventure Enhanced is out now!

Image

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)
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Oh yeah... I forgot all about that. But I can't test it myself right now, because I'm in between massive updates and lunadll is broke for me atm.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1855
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL help thread

Post by Rixithechao »

Ah, sorry, didn't mean it like that. I was suggesting TiKi try it out.
Delightful Adventure Enhanced is out now!

Image

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)
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Rockythechao wrote:(I think I was having the same issue as Hoeloe, outdated copy)
I'd appreciate someone pointing me to a copy that isn't outdated, as I'm currently using the one from the A2MBXT devkit.
Image
Image
Image
Image
Image
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

you're gonna need the one docopopper posted somewhere in the other thread recently (really precise location I know)
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: LunaDLL help thread

Post by docopoper »

Well if you have one slot for a variable in the save file format then I suggest you use it as a number that indicates which save slot you are using and use that to reference a separate file where you can save as much data as you want.

You could make it so that whenever a level is loaded LunaDLL checks whether that memory location is assigned to whatever its default value is. If it is then you start looping up the numbers checking if LunaSave1.sav exists, LunaSave2.sav exists... And once you find that a save file called that doesn't exist you set the memory location to that number. If the number isn't its default value then you know that that was the save file you used last time and it is what you should therefore use this time.

Once you have done that (still prior to level load here) then you need to have a variable that determines whether you have loaded already (this variable should not be saved). If that variable is false then you need to load from the file.

If that variable is true then you know that you need to save at a logical time (I guess this could be whenever the player returns to the world map or something if you can't make a hook for when the rest of the game is saved).

Also I think my version of LunaDLL should be in the latest devkit.

Here you go though: https://dl.dropboxusercontent.com/u/490 ... ls/DLL.zip
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: LunaDLL help thread

Post by docopoper »

docopoper wrote:Well if you have one slot for a variable in the save file format then I suggest you use it as a number that indicates which save slot you are using and use that to reference a separate file where you can save as much data as you want.

You could make it so that whenever a level is loaded LunaDLL checks whether that memory location is assigned to whatever its default value is. If it is then you start looping up the numbers checking if LunaSave1.sav exists, LunaSave2.sav exists... And once you find that a save file called that doesn't exist you set the memory location to that number. If the number isn't its default value then you know that that was the save file you used last time and it is what you should therefore use this time.

Once you have done that (still prior to level load here) then you need to have a variable that determines whether you have loaded already (this variable should not be saved). If that variable is false then you need to load from the file.

If that variable is true then you know that you need to save at a logical time (I guess this could be whenever the player returns to the world map or something if you can't make a hook for when the rest of the game is saved).

Also I think my version of LunaDLL should be in the latest devkit.

Here you go though: https://dl.dropboxusercontent.com/u/490 ... ls/DLL.zip
Here's the save file format btw:
http://engine.wohlnet.ru/docs/_SMBX64/f ... iption.pdf
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

docopoper wrote:Here you go though: https://dl.dropboxusercontent.com/u/490 ... ls/DLL.zip
So, I tried that one, and it did change the behaviour. Now, though, it doesn't work for different reasons.

Code: Select all

#0
OnInput,0,1,0,1000,0,0

#1000
DebugPrint,0,0,0,0,0,0
#END
Previously, the second event would never execute regardless of what I did. Now, it executes continuously regardless of what I do. I'm trying to make something happen when I press a button - is this the way to do that, or have I done something wildly wrong?
Image
Image
Image
Image
Image
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Try DebugPrint,0,0,0,0,1,0
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Kil wrote:Try DebugPrint,0,0,0,0,1,0
It appears once at the start, then disappears immediately. For some reason it seems to be registering the event at the start of the game, and not when I press the key.
Image
Image
Image
Image
Image
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Would there be a way to "enable" toad and peach to ride Yoshi?
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

no
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Grounder
Posts: 5817
Joined: 10 years ago

Re: LunaDLL help thread

Post by Grounder »

Weeeeeell, technically you could Peach/Toad/Link graphics over Mario/Luigi, but you'd have to justify the different physics and inaccurate hitboxes.
Why don't you eat me?

I am perfectly tasty...

AND I'LL STEAL YOUR SOUL! :twisted:

ImageImageImage
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Kil wrote:no
I see. Sorry for the admittedly silly question but I'd gotten into a debate about whether or not it was a good idea to use Yoshi gimmicks in a Mario/Luigi/Toad/Peach project with another guy, so I was wondering if lunadll could solve that. I guess not!

I've saw another post about how lunadll could make a unique game, and I was wondering; can lunadll be used to change hardcoded graphics per level?

I'd also like to thank you for making this and teaching me how to use it. It's practically saved my bacon on the custom boss front - you'd be surprised to see how much changing one npc to another and setting HP can change a boss. I've even made a Tryclyde over Larry by making him not move and change back to his out of shell form when hit! Making the bosses not go into their shells almost seems like this could be a great ultimate noob boss type thing for SMBX!
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

TiKi wrote: I've saw another post about how lunadll could make a unique game, and I was wondering; can lunadll be used to change hardcoded graphics per level?
No idea
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

How would I make a custom cheat setting the "saving after cheats" value to "allow saving"? I tried to, but I couldn't get it to work.
Post Reply