reserveItems.lua - Item box for heart-based characters! [v1.3]

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

AppleTheTomato
Buster Beetle
Buster Beetle
Posts: 91
Joined: Wed Jun 02, 2021 8:44 pm
Flair: I am a Tomato named Apple.
Pronouns: He/Him

Re: reserveItems.lua - Item box for heart-based characters! [v1.3]

Postby AppleTheTomato » Thu Sep 29, 2022 10:25 am

Marioman2007 wrote:
Thu Sep 29, 2022 12:44 am
AppleTheTomato wrote:
Wed Sep 28, 2022 9:52 am
Found another interesting issue. The SMB2 'duplicate mushrooms' don't work anymore lol. Not sure how you'd fix that, but I figured I'd mention it.
Thanks, I will fix all the bugs after I am done with SmgLifeSystem.
This script will only be perfectly usable with a custom health library.

I plan to give mushrooms a special behavior, they'll go to the reserve box if health is full but not if health is not full
other powerups are not gonna give health.
So wait, you will HAVE to have a custom health library in order for this to work?

Also, the powerup idea seems solid. Will actually give mushrooms a function lol

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 544
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: reserveItems.lua - Item box for heart-based characters! [v1.3]

Postby Marioman2007 » Thu Sep 29, 2022 10:40 am

AppleTheTomato wrote:
Thu Sep 29, 2022 10:25 am
So wait, you will HAVE to have a custom health library in order for this to work?
Not, if you want to live with powerups restoring health and getting infinite health by alternating between powerups.

AppleTheTomato
Buster Beetle
Buster Beetle
Posts: 91
Joined: Wed Jun 02, 2021 8:44 pm
Flair: I am a Tomato named Apple.
Pronouns: He/Him

Re: reserveItems.lua - Item box for heart-based characters! [v1.3]

Postby AppleTheTomato » Thu Sep 29, 2022 5:47 pm

Marioman2007 wrote:
Thu Sep 29, 2022 12:44 am
AppleTheTomato wrote:
Wed Sep 28, 2022 9:52 am
Found another interesting issue. The SMB2 'duplicate mushrooms' don't work anymore lol. Not sure how you'd fix that, but I figured I'd mention it.
Thanks, I will fix all the bugs after I am done with SmgLifeSystem.
This script will only be perfectly usable with a custom health library.

I plan to give mushrooms a special behavior, they'll go to the reserve box if health is full but not if health is not full
other powerups are not gonna give health.
Wait, I just thought of something else: you said that the health will have to be full for a mushroom to go into it. That prompts a few questions:
1. How will you check for full health?
2. Can't this then be applied to other powerups?
3. Depending on the answer to Q1, why would a custom health library be needed? And if one is needed, how is that gonna work? Will reserveItems account for that, or will the custom health library have to account for reserveItems?

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 544
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: reserveItems.lua - Item box for heart-based characters! [v1.3]

Postby Marioman2007 » Thu Sep 29, 2022 10:14 pm

AppleTheTomato wrote:
Thu Sep 29, 2022 5:47 pm
Wait, I just thought of something else: you said that the health will have to be full for a mushroom to go into it. That prompts a few questions:
1. How will you check for full health?
2. Can't this then be applied to other powerups?
3. Depending on the answer to Q1, why would a custom health library be needed? And if one is needed, how is that gonna work? Will reserveItems account for that, or will the custom health library have to account for reserveItems?
1. Per-Player health data in the custom health lib
2. yeah this could be, I just thought of it now lol
3.1: hearts system is kinda wonky, I tried to check some things but my calculations took place after the game finished it's health calculation
3.2: Not sure

AppleTheTomato
Buster Beetle
Buster Beetle
Posts: 91
Joined: Wed Jun 02, 2021 8:44 pm
Flair: I am a Tomato named Apple.
Pronouns: He/Him

Re: reserveItems.lua - Item box for heart-based characters! [v1.3]

Postby AppleTheTomato » Thu Sep 29, 2022 10:49 pm

Marioman2007 wrote:
Thu Sep 29, 2022 10:14 pm
AppleTheTomato wrote:
Thu Sep 29, 2022 5:47 pm
Wait, I just thought of something else: you said that the health will have to be full for a mushroom to go into it. That prompts a few questions:
1. How will you check for full health?
2. Can't this then be applied to other powerups?
3. Depending on the answer to Q1, why would a custom health library be needed? And if one is needed, how is that gonna work? Will reserveItems account for that, or will the custom health library have to account for reserveItems?
1. Per-Player health data in the custom health lib
2. yeah this could be, I just thought of it now lol
3.1: hearts system is kinda wonky, I tried to check some things but my calculations took place after the game finished it's health calculation
3.2: Not sure
Fair enough. Also, another random thing to possibly deal with: the reserve blocks introduced in X2. The ones that instantly put an item into your inventory. Not sure how that road can be crossed, but you may want / need to.

AppleTheTomato
Buster Beetle
Buster Beetle
Posts: 91
Joined: Wed Jun 02, 2021 8:44 pm
Flair: I am a Tomato named Apple.
Pronouns: He/Him

Re: reserveItems.lua - Item box for heart-based characters! [v1.3]

Postby AppleTheTomato » Sun Oct 02, 2022 8:05 pm

Another thing I found. This needs to be added somewhere in onPostNPCKill, otherwise anytime a powerup despawns, the 'got item' sound gets played:

Code: Select all

if v.despawnTimer > 0 then
Edit: Uh, maybe not. Could just be something screwy on my end, playing around with that.
Edit 2: Yeah, just a problem on my end lol. Got trolled by Klonoa xD


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari