Modifying GP input - groundPound.lua

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

Moderator: Userbase Moderators

Arco
Koopa
Koopa
Posts: 17
Joined: Mon Nov 08, 2021 9:32 pm
Flair: Creative
Pronouns: she/her
Contact:

Modifying GP input - groundPound.lua

Postby Arco » Thu May 05, 2022 11:43 pm

I am fully aware I could ask on the original groundPound.lua topic but the creator hasn't been active since last year.

I've been using the ground pound for a bit now and wish to change the the ground pound trigger from down to my alt run. Initially I tried doing this myself by changing the two instances of 'down' to 'altRun' but no results. I modified the following code:

Code: Select all

local function thePound(i)
	if not isPounding[i]  and timeSinceLastPound[i] >= groundPoundNeue.preventPoundForTime then
	registeredCharacters[players[i].character].prepareAnim:play(players[i]);
	Audio.playSFX(getSMBXPath().."\\sound\\zelda-stab.ogg");
	isPounding[i] = true;
	alreadyTriedToPound[i] = true;
	timeSinceLastPound[i] = 0;
	stillAtY[i] = players[i].y;
	stillAtX[i] = players[i].x;
	players[i].speedX = 0
	if inputs.state[i].down == inputs.PRESS then
		delayTimer[i] = 0;
		players[i]:mem(0xE8,FIELD_DFLOAT, 0);
	end
end
end
local function inputUpdateRun(o)
	if not isDoingBannedStuff[o] and
	registeredCharacters[players[o].character].enabled then
		if inputs.state[o].down == inputs.PRESS then
			thePound(o);
		end
		if isPounding[o] and
		(inputs.state[o].up == inputs.PRESS) then
			isPounding[o] = false;
			alreadyTriedToPound[o] = false;
			Audio.playSFX(getSMBXPath().."\\sound\\hammer.ogg");
		end
	end
end
I am unsure what else needs to be done. I also realised that using Alt Run to trigger the ground pound could be problematic with a powerup that has special abilities. I would need a way to have the input be replaced while in the air only and not making contact with the ground, and have any special abilities disabled in the air, but allow the use of said abilities on the ground.

I want to replace the key because I think mid-air crouching is important, and I also want to have the game play more like most modern Mario games where a separate button becomes ground pound (like ZL or something in newer games).

Thank you.

Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari