Making the Super Leaf land instead of going through blocks

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

Moderator: Userbase Moderators

AlphaBlue1011
Spiny
Spiny
Posts: 27
Joined: Sun Feb 02, 2025 3:00 pm
Flair: never underestimate hyperfixations :3
Pronouns: she/her or they/them

Making the Super Leaf land instead of going through blocks

Postby AlphaBlue1011 » Fri Feb 14, 2025 9:16 pm

I want to make the Super Leaf land on the ground instead of going through it, similarly to something like Mario 3D Land. I tried setting noblockcollision to false, but it resulted in it sliding across the ground at a rapid pace. How would I get it to stay still once it lands?

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

Re: Making the Super Leaf land instead of going through blocks

Postby mariobrigade2018 » Fri Feb 14, 2025 9:23 pm

Looks like you had the right idea, you just needed to add this in the npc’s onTick:

Code: Select all

if v. collidesBlockBottom then
v. speedX = 0
end

AlphaBlue1011
Spiny
Spiny
Posts: 27
Joined: Sun Feb 02, 2025 3:00 pm
Flair: never underestimate hyperfixations :3
Pronouns: she/her or they/them

Re: Making the Super Leaf land instead of going through blocks

Postby AlphaBlue1011 » Fri Feb 14, 2025 10:46 pm

where's the basegame super leaf's lua though? to do that i have to have a copy of the og lua so i can edit it :/

S_Koopa0
Rex
Rex
Posts: 37
Joined: Mon Jul 04, 2016 10:57 am
Flair: The S stands for Springboard
Pronouns: he/him

Re: Making the Super Leaf land instead of going through blocks

Postby S_Koopa0 » Fri Feb 14, 2025 11:04 pm

AlphaBlue1011 wrote:
Fri Feb 14, 2025 10:46 pm
where's the basegame super leaf's lua though? to do that i have to have a copy of the og lua so i can edit it :/
The Super Leaf is an item from the regular SMBX, so it has no lua file (unless SMBX2 is adding more features to it, but in that case it's just more code added on top of what's already in the game).

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

Re: Making the Super Leaf land instead of going through blocks

Postby mariobrigade2018 » Sat Feb 15, 2025 12:32 am

AlphaBlue1011 wrote:
Fri Feb 14, 2025 10:46 pm
where's the basegame super leaf's lua though? to do that i have to have a copy of the og lua so i can edit it :/
There isn’t one. You need to make your own. Fortunately, there is a template for an npc lua file, just copy paste it and rename it to npc-34.lua, and add that snippet of code in onTick.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari