CounterJumpEx

From Eternity Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Jump works in the same manner as CounterJump, performing a counter-versus-value comparison and jumps to "frame" if the test passes. The usage is as follows:

CounterJumpEx (state, comparison, valctr, ctr)

  • state: name of label, or offset, to jump to if the comparison returns true. Note that 'state' cannot refer to global name states (ie. EDF frame mnemonics); this codepointer is strictly for use with DECORATE states.
  • comparison: one of the following:
less or 0: valctr is a constant - jump if ctr < valctr
lessorequal or 1: valctr is a constant - jump if ctr <= valctr
greater or 2: valctr is a constant - jump if ctr > valctr
greaterorequal or 3: valctr is a constant - jump if ctr >= valctr
equal or 4: valctr is a constant - jump if ctr == valctr
notequal or 5: valctr is a constant - jump if ctr != valctr
and or 6: valctr is a constant - jump if ctr & valctr
less_counter or 7: valctr is a counter number - jump if ctr < valctr
lessorequal_counter or 8: valctr is a counter number - jump if ctr <= valctr
greater_counter or 9: valctr is a counter number - jump if ctr > valctr
greaterorequal_counter or 10: valctr is a counter number - jump if ctr >= valctr
equal_counter or 11: valctr is a counter number - jump if ctr == valctr
notequal_counter or 12: valctr is a counter number - jump if ctr != valctr
and_counter or 13: valctr is a counter number - jump if ctr & valctr
  • valctr: the value (or counter number holding the value) to compare against
  • ctr: the counter to compare

This codepointer was added in Eternity because CounterJump uses frame names or DeHackEd numbers, meaning that you could not use it for things defined entirely using DECORATE states. Additionally the behavior of this function could not be encapsulated in the prior function, due to not being able to differentiate state names from label names, and DeHackEd nums from offset nums.

See also