From Eternity Wiki
Jump to navigationJump to search

Type: AI pointer, normal

Purpose: Causes an object to pursue its target.

  • If the object has lost its target (ie. it has died or been removed), the object will look for a new target (possibly remembering a prior one). If no targets are found, the object will return to its initial spawn state.
  • If the object has a target, it may attempt to attack:
    • If an object has just attacked prior to this, it will not attack again, unless the game skill is at "Nightmare!" level or is in "fast" mode. Instead, the enemy will choose a new direction to walk in.
    • If the object has a melee attack and is within 64 units of its target, it will transfer to its melee attack state.
    • If the object does not have a melee attack or is not close enough to use it, is within normal missile range (2048 units), and timing or skill level permitting, it will transfer to its missile attack state.
  • Depending on the actor's internal "threshold" value, which decrements slowly as it chases a target, it may choose a new target to attack when it cannot attack its current one.
    • Friendly objects may choose a new player to follow, or may look for other friendly objects who are in critical condition (low health). If a friendly object finds a friend in trouble, it may adopt that friend's target as its own.
    • Enemies will look for new players first, and then friendly monsters. If advanced strafing logic is active, and the monster is moving, it may decide to strafe away from its target.
  • Once all moving and attack logic has been passed, the object has a 3/256 (1.17%) chance of playing its active (roaming) sound, if it has one.
    • If an object has the ACTSEESOUND flag in its Bits3 field, it has a 50% chance of playing its alert sound instead of its active sound.
    • If an object has the LOUDACTIVE flag in its Bits3 field, it will play which ever sound it chooses at full volume.

Notes: This codepointer should only be called from the walking frames of a sentient object. There may be undesired effects or undefined behavior in other circumstances.

As of Eternity Engine v3.33.01, this codepointer will not crash the game if used in an object's spawn state or attack states. However, an error message may be printed until the object leaves the offending state(s), as using the pointer in this context is NOT appropriate.