CounterSwitchEx

From Eternity Wiki
Revision as of 13:30, 19 September 2016 by Altazimuth (talk | contribs) (Add new codepointer, A_CounterSwitchEx.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

CounterSwitchEx works in the same manner as CounterSwitch, implementing an N-way branch where the value of the indicated counter determines to which frame the jump will occur. The usage is as follows:

CounterSwitchEx(cnum, state)

Parameters:

  • cnum: Counter number to check. From 0 to 7.
  • 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.

The frames to be jumped to need not be defined in a consecutive block in EDF, as it uses labels or offsets instead. The first state in this set is deemed to be frame #0. The value of the counter is considered to be zero-based, so that if it is equal to zero, the object will jump to frame #0 (the first state you provided). Unlike CounterSwitch, only the jumped-to state needs to be valid, though it will not jump if the state