A_RandomJump
From DoomWiki.org
| This article or section is a stub. Please help the Doom Wiki by adding to it. |
A_RandomJump is a code pointer first introduced in the MBF source port. It instantly jumps the calling actor to the state specified in misc1 (Unknown 2 in DeHackEd)—using the state's DeHackEd index number—if a check of a random number against the probability set in misc2 (Unknown 2 in DeHackEd) succeeds; if the check fails, it will wait for the normal duration of the state before transitioning to the regular next state. A value of 256 in misc2 guarantees success, while a value of zero guarantees failure. (For example, setting the value of misc2 to 64 will result in a 25 percent chance of jumping to the state specified in misc1.) For A_RandomJump to work correctly, it is recommended not to set the duration of the calling state to a negative value (infinite duration).
Example[edit]
The following is an example of how to set the A_RandomJump code pointer in a DeHackEd file using BEX syntax:
Frame 1234 Unknown 1 = 1234 Unknown 2 = 1234 [CODEPTR] Frame 1234 = RandomJump
External links[edit]
- A_RandomJump in the MBF source code.
- RandomJump at the Eternity Engine wiki
