Editing RandomJump

From Eternity Wiki
Jump to navigationJump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 4: Line 4:
*'''misc2''': chance out of 256 to execute the jump
*'''misc2''': chance out of 256 to execute the jump


This codepointer causes the current frame to jump ''instantly'' to another frame (set by '''misc1''') if chance '''misc2'''/256 is passed. Otherwise, it will wait the normal amount of '''tics''' before going to '''nextframe'''.
This codepointer causes the current frame to jump ''instantly'' to another frame (set by '''misc1''') if chance '''misc2'''/256 is passed. Unlike the similar ZDoom "A_Jump" function, the order of parameters is reversed, and the target frame is set absolutely, not in relation to current frame. For example:


Note: Since the arguments are '''misc1''' and '''misc2''', they cannot be set within parentheses, but rather as separate fields (e.g.: ''action RandomJump; misc1 S_PLASMA2; misc2 128''). Its parameter order is also opposite to ZDoom's own A_Jump action.
frame monster_decide
 
{
You can use the [[Jump]] codepointer instead of this, which uses the args fields instead of misc. For Decorate availability, you need to use that instead of RandomJump.
    sprite    MONS


    action    randomjump
    misc1    monster_attack
    misc2    100              #100/256 probability to jump to monster_attack
    tics      10
    nextframe monster_continue_etc 
 
    # caution: wait normally 10 tics before nextframe, OR jump ''instantly'' to monster_attack
    # in practice, tics 0 is used, so that all durations are consistent with each other
}
This codepointer was introduced by the [[MBF]] port.
==See also==
==See also==
*[[List of codepointers]]
*[[List of codepointers]]


[[Category:Codepointers]]
[[Category:Codepointers]]
[[Category:MBF codepointers]]
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see Eternity Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)