View source for Change the player's jump height - EDukeWiki

# View source for Change the player's jump height

← Change the player's jump height

You do not have permission to edit this page, for the following reasons:

- The action you have requested is limited to users in the group: Users.
- You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

You can use the player member [[jumping_counter]] to limit the player's jump to less Olympic heights, or make the player's jump even more superhuman. The [[jumping_counter]] increments from 0 (not jumping) to 1441 (end of jump) in increments of 180, as follows: 0 181 361 541 721 901 1081 1261 1441 NOTE: In water surface sectors ([[lotag]] 1), the counter will only reach up to 901. By manually setting the counter to 0 or a value above 1440 when the counter reaches one of these values, you can decrease the duration of the jump by effectively cancelling it mid-jump. Additionally, you can use a similar method to extend the jump height of the player. You'll need a gamevar to hold the value of [[jumping_counter]]. <pre>gamevar temp 0 2</pre> Inside the APLAYER actor, use the following code to cut the jump duration in half: <pre> getplayer[THISACTOR].jumping_counter temp ifvare temp 721 { setplayer[THISACTOR].jumping_counter 0 } </pre> If you want to increase jump height instead of lowering it, you can do this instead: <pre> getplayer[THISACTOR].jumping_counter temp ifvare temp 1261 { setplayer[THISACTOR].jumping_counter 362 } </pre> The above example increases the jump duration by 5 tics. The default jumping height is 9 tics without any changes in the code. The reason 1 is added to the counter when a jump is extended is to prevent an endless jumping loop from occuring. It is recommended to check for 126x when extending the jump to maximize jumping velocity(or [[poszv]]). [[Category: Tutorials]]

Return to Change the player's jump height.

Retrieved from "http://wiki.eduke32.com/wiki/Change_the_player%27s_jump_height"