GroundPound.lua - pound the ground! [v1.3.1]

Share and discuss custom LunaLua code and content packs for SMBX2.
Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

GroundPound.lua - pound the ground! [v1.3.1]

Postby Marioman2007 » Sat Sep 10, 2022 9:35 am

Another ground pound script.

GIF
Spoiler: show
Image

Credits
Marioman2007
Enjl

LxXzit
Linkstorm Z
Master of Disaster

Changelog
1.1 - Fixed the pound killing generators and the score system.
1.2 - Lots of fixes, multiplayer support, pound filters and pound switch.
1.3 - Fixed various issues - error when not having a character registered, getting stuck on slopes, p-switch related issues etc, players can now automatically enter pipes (quickPipes.lua required) and clearpipes, functions to render the player or to override render data.
1.3.1 - Added npc whitelist and blacklist, fixed some overights in code.


Download
https://drive.google.com/file/d/1gGD80C ... sp=sharing

Basic usage:

Code: Select all

local GP = require("GroundPound")
GP.applyDefaultSettings()

Settings are at the top of the file.
Give credits if used!
Last edited by Marioman2007 on Tue Feb 06, 2024 8:43 am, edited 10 times in total.

Registered sand eater
Swooper
Swooper
Posts: 55
Joined: Fri Jan 28, 2022 4:14 pm
Pronouns: he/him

Re: GroundPound.lua - pound the ground! [v1]

Postby Registered sand eater » Sat Sep 10, 2022 3:40 pm

I decided to make a smw version cause why not.
Spoiler: show
Image

Download link:

Mushroom King
Blooper
Blooper
Posts: 175
Joined: Sun May 25, 2014 5:09 am

Re: GroundPound.lua - pound the ground! [v1]

Postby Mushroom King » Thu Sep 15, 2022 6:53 am

Would it be possible to make the ground pound use the down button while in midair (crouching) and not the spin jump button?

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1]

Postby Marioman2007 » Thu Sep 15, 2022 10:19 am

Mushroom King wrote:
Thu Sep 15, 2022 6:53 am
Would it be possible to make the ground pound use the down button while in midair (crouching) and not the spin jump button?
Yeah its possible, but for a game where you can crouch in mid air it will be dangerous (for example, purple yoshi)

Mal8rk
Blooper
Blooper
Posts: 199
Joined: Mon Oct 25, 2021 11:04 pm
Flair: English Speaking Spanish Speaker
Pronouns: He/Him
Contact:

Re: GroundPound.lua - pound the ground! [v1]

Postby Mal8rk » Sun Oct 02, 2022 10:20 pm

I wish you could change which blocks you could destroy and which ones you couldn't, cause' I've seen that you can break on & off blocks and things like that

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1]

Postby Marioman2007 » Sun Oct 02, 2022 10:53 pm

Mal8rk wrote:
Sun Oct 02, 2022 10:20 pm
I wish you could change which blocks you could destroy and which ones you couldn't, cause' I've seen that you can break on & off blocks and things like that

You can't change the blocks. However, you can prevent blocks from being destroyed:

Code: Select all

local avoidedBlocks = table.map{id1, id2} -- you can always add/remove IDs here

function onBlockPound(event, v)
    if avoidedBlocks[v.id] then
        event.cancelled = true
    end
end

Ness-Wednesday
Purple Yoshi Egg
Purple Yoshi Egg
Posts: 1576
Joined: Sun Jun 28, 2015 3:50 pm
Flair: Diverse Scouts
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1]

Postby Ness-Wednesday » Tue Oct 25, 2022 10:12 pm

Great work! I spent a lot of time toying with this for the last two days, and it feels much smoother than the old ground pound. In no way was the old ground pound bad, but there were a few perks I had with it. Namely with how it interacted with destroyed blocks and sizeables, both of which are fixed here. The pound jump is a pleasant surprise! Really gives me nostalgia for when I first discovered it while playing SM3DW. The only small flaw I can point out is when the player ground pounds on a generating NPC:
Spoiler: show
Image
Generators are set to generate an enemy every 2 seconds.
Just a small bug. Besides this, I really love how this turned out. Keep up the good work! :D

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1.1]

Postby Marioman2007 » Wed Oct 26, 2022 2:17 am

Thanks and glad you liked it!
I've updated the script, download and changelog in the original post!
Enjoy!

Shodax
Fighter Fly
Fighter Fly
Posts: 42
Joined: Sat Feb 05, 2022 2:24 pm
Pronouns: he

Re: GroundPound.lua - pound the ground! [v1]

Postby Shodax » Mon Nov 07, 2022 10:09 pm

Marioman2007 wrote:
Thu Sep 15, 2022 10:19 am
Mushroom King wrote:
Thu Sep 15, 2022 6:53 am
Would it be possible to make the ground pound use the down button while in midair (crouching) and not the spin jump button?
Yeah its possible, but for a game where you can crouch in mid air it will be dangerous (for example, purple yoshi)
I do not know much of lua but I have managed to make that with pressing down make the movement, in case someone serves

https://www.mediafire.com/file/rosns6de ... n.zip/file

Cognition
Dolphin
Dolphin
Posts: 83
Joined: Sun Oct 05, 2014 10:13 pm

Re: GroundPound.lua - pound the ground! [v1.1]

Postby Cognition » Fri Dec 09, 2022 2:56 pm

Is there a way to add custom power ups to this? For example, when using the cape feather by MDA.

Shodax
Fighter Fly
Fighter Fly
Posts: 42
Joined: Sat Feb 05, 2022 2:24 pm
Pronouns: he

Re: GroundPound.lua - pound the ground! [v1.1]

Postby Shodax » Sat Dec 10, 2022 2:35 pm

Cognition wrote:
Fri Dec 09, 2022 2:56 pm
Is there a way to add custom power ups to this? For example, when using the cape feather by MDA.
if compatible
Image

Torterra18
Koopa
Koopa
Posts: 19
Joined: Fri Feb 03, 2023 9:43 am
Pronouns: he/him

Re: GroundPound.lua - pound the ground! [v1.1]

Postby Torterra18 » Mon Feb 13, 2023 6:39 pm

Nice script, however, is there a way to disable it for other characters?

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1.2]

Postby Marioman2007 » Wed Mar 15, 2023 4:32 am

Version 1.2 is here!

This version fixes a lot of bugs and adds multiplayer support + some custom blocks and npcs.
Download and changelog in the main post.

Enjoy!


Mushroom King wrote:
Thu Sep 15, 2022 6:53 am
Would it be possible to make the ground pound use the down button while in midair (crouching) and not the spin jump button?
Put this code after loading GP.

Code: Select all

GP.inputStyle = GP.INPUT_DOWN

Mal8rk wrote:
Sun Oct 02, 2022 10:20 pm
I wish you could change which blocks you could destroy and which ones you couldn't, cause' I've seen that you can break on & off blocks and things like that
This issue has been fixed in this version.


Torterra18 wrote:
Mon Feb 13, 2023 6:39 pm
Nice script, however, is there a way to disable it for other characters?
Put the following code after loading GP.

Code: Select all

GP.disableCharacter(CHARACTER_#)
CHARACTER_# should be a character constant from the following list.
https://docs.codehaus.moe/#/constants/characters

GalaxyComet
Bit
Bit
Posts: 63
Joined: Sun Apr 27, 2014 2:49 pm

Re: GroundPound.lua - pound the ground! [v1.2]

Postby GalaxyComet » Tue Mar 21, 2023 12:08 am

Question, is ground pounding only available for Mario & Luigi?

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1.2]

Postby Marioman2007 » Tue Mar 21, 2023 6:10 am

GalaxyComet wrote:
Tue Mar 21, 2023 12:08 am
Question, is ground pounding only available for Mario & Luigi?
Every registered character can use GP, however, compatibility is only guaranteed for the base 5.
The GP.applyDefaultSettings function only registers the base 5 characters, so you'd have to register any other character by yourself.

Alfur
Shy Guy
Shy Guy
Posts: 6
Joined: Thu Dec 16, 2021 2:21 pm
Pronouns: she/her

Re: GroundPound.lua - pound the ground! [v1]

Postby Alfur » Sat May 06, 2023 2:08 pm

Marioman2007 wrote:
Sun Oct 02, 2022 10:53 pm
Mal8rk wrote:
Sun Oct 02, 2022 10:20 pm
I wish you could change which blocks you could destroy and which ones you couldn't, cause' I've seen that you can break on & off blocks and things like that

You can't change the blocks. However, you can prevent blocks from being destroyed:

Code: Select all

local avoidedBlocks = table.map{id1, id2} -- you can always add/remove IDs here

function onBlockPound(event, v)
    if avoidedBlocks[v.id] then
        event.cancelled = true
    end
end
How is the meant to work? I put this in the luna.lua file but the block is still breakable. How are we meant to blacklist blocks from being groundpounded?

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1.2]

Postby Marioman2007 » Sat May 06, 2023 11:40 pm

Alfur wrote:
Sat May 06, 2023 2:08 pm
How is the meant to work? I put this in the luna.lua file but the block is still breakable. How are we meant to blacklist blocks from being groundpounded?

That was the old method, now you can just do this:

Code: Select all

GP.blacklistBlock(id)
This'll go after loading GP.

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1.3]

Postby Marioman2007 » Mon Feb 05, 2024 9:58 am

Version 1.3 is released!
Fixes some bugs, adds some new features and optimizes the code a bit.
Changelog in the main post.

Mushroom King
Blooper
Blooper
Posts: 175
Joined: Sun May 25, 2014 5:09 am

Re: GroundPound.lua - pound the ground! [v1.3]

Postby Mushroom King » Tue Feb 06, 2024 8:00 am

Thanks for the update. Do you think it would be possible to add some feature like the higher bouncing from springboard/trampoline when ground pounding, like in the 3d games, and the increasing score when you hit multiple npcs like in a goomba tower?

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: GroundPound.lua - pound the ground! [v1.3.1]

Postby Marioman2007 » Tue Feb 06, 2024 8:36 am

Version 1.3.1 released
Fixed some code oversights and added npc whitelist and blacklist.

Mushroom King wrote:
Tue Feb 06, 2024 8:00 am
Thanks for the update. Do you think it would be possible to add some feature like the higher bouncing from springboard/trampoline when ground pounding, like in the 3d games, and the increasing score when you hit multiple npcs like in a goomba tower?

I tried to do the latter once but my way was pretty janky, so I'm not adding that.
As for the former, you can use this code to do that:

Code: Select all

GP.registerCustomNPCFunc(26, function(v, p)
    p.speedY = -20
    
    -- these are taken from scripts/npcs/ai/springs.lua
    p:mem(0x00, FIELD_BOOL, p.character == CHARACTER_TOAD and (p.powerup == 5 or p.powerup == 6))
    p:mem(0x0E, FIELD_BOOL, false)
    p:mem(0x18, FIELD_BOOL, p.character == CHARACTER_PEACH)
end)


Return to “LunaLua”

Who is online

Users browsing this forum: dulushich_ViiU and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari