Mario's Speed Cap

Clamsplayz

Member
Jun 20, 2024
6
0
210
13
Pronouns
he/him
I am making a mod where Mario can Dash by pressing the "X" button, but i have some questions. how can i make Mario go faster (IN ACT_WALKING) because the walking speed cap is preventing me from making this mod better. also how do i have mario keep dashing until i let go of "X"? because i have to spam it to keep dashing.
 
You can multiply Mario's `vel` vec3f, like this:

```
m.vel.x = m.vel.x * 2
m.vel.z = m.vel.z * 2
```

Please note that multiplying by 2, while not strong in some actions, can be VERY strong in others. Doing this can constantly increase mario's velocity to a unreasonable number, so be sure mario's grounded to ensure nothing goofy happens, or blacklist each action you find. Here's a list of actions I've found that have super speed when using this, although there's probably more:

```
ACT_BACKWARD_AIR_KB
ACT_FORWARD_AIR_KB
ACT_HARD_BACKWARD_AIR_KB
ACT_HARD_FORWARD_AIR_KB
ACT_WATER_JUMP
```


also how do i have mario keep dashing until i let go of "X"? because i have to spam it to keep dashing.
Use m.controller.buttonDown instead of m.controller.buttonPressed.
 
this doesnt seem to work. maybe i am doing something wrong? this is all of my code tell me if something here is wrong.



--name: Dash
--discription: Makes Mario be able to dash by pressing the X button

function mario_update(m)

local DASH_SPEED = 2

if m.action == ACT_WALKING and (m.controller.buttonDown & X_BUTTON) ~= 0 then
m.vel.x = m.vel.x * DASH_SPEED
m.vel.z = m.vel.z * DASH_SPEED
end
end


hook_event(HOOK_MARIO_UPDATE, mario_update)
 

Users who are viewing this thread