How do I override a default action for my moveset?

Imirui

Member
Sep 29, 2024
2
0
200
Pronouns
she/they
I want to make pressing B in midair for my moveset always result in a jump kick, making getting one or a dive not speed dependent. I want to map dive to its own button. How do I make it do that? I haven't made a mod before and don't know anything. Are there any tutorials I can use to learn how to do this?
 
You maybe want this here i don't understand it but here it

Code:
---@param m MarioState
---@param action integer
function nodive(m, action)
if action == ACT_DIVE then -- and action ~= ACT_TRIPLE_JUMP if you want dive it when triple jumping
return ACT_JUMP_KICK
end end
hook_event(HOOK_BEFORE_SET_MARIO_ACTION, nodive)
 
I want to make pressing B in midair for my moveset always result in a jump kick, making getting one or a dive not speed dependent. I want to map dive to its own button. How do I make it do that? I haven't made a mod before and don't know anything. Are there any tutorials I can use to learn how to do this?
this can best be used by doing the before set action inc thing

(this best works if you're using character select, if you're not using char select then just replace the beginning part before 'HOOK_BEFORE' to 'hook_event(')

Code:
function char_before_act(m, inc, arg)
    if (inc == ACT_DIVE) and (m.input & INPUT_OFF_FLOOR) ~= 0 then
        return ACT_JUMP_KICK
    end
end

_G.charSelect.character_hook_moveset([your chars CT], HOOK_BEFORE_SET_MARIO_ACTION, char_before_act)
 

Users who are viewing this thread