From Eternity Wiki
Revision as of 01:00, 11 November 2019 by Printz (talk | contribs) (→‎Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

HealthJump(frame, comparison, cmphealth)

This is a frame scripting parameterized codepointer.


  • frame: frame to which object may jump (default: S_NULL, will remove object).
  • comparison: type of comparison to perform on object's health:
  • less or 0 (default): jump if health < cmphealth
  • lessorequal or 1: jump if health <= cmphealth
  • greater or 2: jump if health > cmphealth
  • greaterorequal or 3: jump if health >= cmphealth
  • equal or 4: jump if health equals cmphealth
  • notequal or 5: jump if health does not equal cmphealth
  • and or 6: jump if health & cmphealth (bitwise AND operation)
  • less_counter, lessorequal_counter, greater_counter, greaterorequal_counter, equal_counter, notequal_counter, and_counter (7 - 13): the value in cmphealth will be interpreted as a counter number (0 - 7). The resulting operation is the health compared against the value of the requested counter, using the corresponding operation (i.e. operation less_counter is "Jump if health < counter").
  • cmphealth: value to compare health against / counter number holding value (default: 0).


Causes the object to transfer to the indicated frame if the value in cmphealth (or the given counter, for operations ending with "_counter") compares as requested to the object's current health. This allows "frame scripting" of actions which vary depending on how much damage an enemy or other object has received. If the jump does not occur, the object will fall through to the next frame. If the current frame's tics are set to -1, fall-through will not occur.


Options and and and_counter, "bitwise and", are most useful for performing an action only if the object's health is even or odd. To perform an action if the health value is odd, set cmphealth to 1. Use of other values will result in periodic chances for an action, and will require experimentation.


frame EXAMPLE1 { cmp = "EXPL|A|*|0|HealthJump(EXAMPLE2,less,50)|@next" }

Jump to frame EXAMPLE2 if health is less than 50.

See also[edit]