Lua Fire Flower Help

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

KnuckleChuckle
Bob-Omb
Bob-Omb
Posts: 23
Joined: Mon Jul 23, 2018 10:06 pm

Lua Fire Flower Help

Postby KnuckleChuckle » Wed Aug 20, 2025 1:57 pm

Hello everyone. I'm currently trying to alter the fire flower to give it 2 more abilities. First, I'm trying to have it charge up similar to how megaman works, and then releasing a Yoshi fireball once charged up. however I'm also trying to implement a double jump with it as well. The double jump would only work when the player is charged up, in the air, and pressing down. This would then send the fireball down and propel the player up. Unfortunately, I'm having a very tough time getting this to work. Does anyone have any suggestions?

mariobrigade2018
Eerie
Eerie
Posts: 704
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: Lua Fire Flower Help

Postby mariobrigade2018 » Wed Aug 20, 2025 4:04 pm

Hello Chuckle the Knuckles!

Unfortunately, there is no easy way to modify the basegame fire flower. BUT, during your five year hiatus, a revolutionary thing has released: The Rip Lair’s Powerup Pack. A bunch of premade powerups that someone can use. What it does is clone a powerup state, like the fire flower state, and allows it to be modifiable. Now, you said that you needed a charge attack. Well, you’re in luck, as one of the powerups in the pack has this already. The wind flower. As for the double jump, you can check how the acorn suit does it.

Hope this helped!

deice
Rocky Wrench
Rocky Wrench
Posts: 635
Joined: Fri Jul 23, 2021 7:35 am

Re: Lua Fire Flower Help

Postby deice » Wed Aug 20, 2025 4:42 pm

while using a custom powerup isn't a bad idea, i'd like to note that this isn't as difficult as one might think. while it's far from a trivial undertaking (and thus i don't have time to write cohesive working code as an example), the ideas would be something like this:

memory offset 0x172 can be set to stop the player from shooting fireballs. while run is held, you can count a timer up in the background and then, upon the run key being released, spawn a different npc depending on the charge time.
as for the double jump, something like this should work for checking whether or not the player is midair:

Code: Select all

local function playerMidAir()
	return not ((player:isOnGround() and math.abs(player.speedY) <= 0.01) or player:mem(0x48, FIELD_WORD) > 0 or player:mem(0x176, FIELD_WORD) > 0)
end
then, if the down key is pressed, you can spawn a fireball with the "dontMove" flag set, and force the player to jump again (this double jump code is old but should still work):

Code: Select all

player:mem(0x11C, FIELD_WORD, Defines.jumpheight)
player.speedY = (-5.7) - math.abs(player.speedX) * 0.2

player:mem(0x11E, FIELD_BOOL, false)
player:mem(0x50, FIELD_BOOL, false)
(for this to work with multiple players, you'd replace the "player" variable with whichever player you're targeting)


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari