YesNoOk
avatar

Disable characters continuously jumping when "up" is held (Read 10712 times)

Started by Arminius, October 02, 2024, 06:52:39 pm
Share this topic:
Disable characters continuously jumping when "up" is held
#1  October 02, 2024, 06:52:39 pm
    • Germany
I'm trying to modify the jump mechanic so that characters don’t immediately start jumping again after landing if the "up" key is held. Instead, I want the character to only jump again when "up" is released and then pressed again.

I attempted using a variable system where a variable is set to 1 when "up" is pressed (holdup) and reset to 0 when released. I then overwrote the state 0 in the common1.cns file to only change state to state 40 when the variable is 0. However, this hasn’t implemented the change I wanted, probably because the jump trigger for "up" seems to be hardcoded.

So, is it even possible to disable continuous jumping with "up" held, and require a release and re-press to jump again?
Re: Disable characters continuously jumping when "up" is held
#2  October 05, 2024, 05:57:48 pm
    • Germany
Fixed it myself, one simply has to do a changestate in state 40 that changes to "PrevStateNo" if the jump variable is 1.