View source for Prevent fall damage or falling death - EDukeWiki

# View source for Prevent fall damage or falling death

← Prevent fall damage or falling death

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.

The following code can be used to prevent the player from either receiving fall damage, or from hitting 'terminal velocity', which results in death upon hitting the ground. You'll need a single gamevar to hold the value of [[falling_counter]]. <pre> gamevar fallcounter 0 1 </pre> Inside the APLAYER actor, use the following code to restrict the falling counter to prevent falling deaths: <pre> getplayer[THISACTOR].falling_counter fallcounter ifvarg fallcounter 60 // not 61, because there's a slim chance the number won't set properly in time { setvar fallcounter 60 // any value under 62 is non-fatal setplayer[THISACTOR].falling_counter fallcounter } </pre> To prevent ANY fall damage to the player, change it to the following <pre> getplayer[THISACTOR].falling_counter fallcounter ifvarg fallcounter 7 // not 8, because there's a slim chance the number won't set properly in time { setvar fallcounter 7 // any value under 9 does no damage setplayer[THISACTOR].falling_counter fallcounter } </pre> [[Category: Tutorials]]

Return to Prevent fall damage or falling death.

Retrieved from "http://wiki.eduke32.com/wiki/Prevent_fall_damage_or_falling_death"