A Look

A_Look is a code pointer used in the normal animation for various monsters.

scans the immediate area for targets (ie. players to attack). Most monsters are initially spawned cycling through a series of states that repeatedly call. The following strategies are used to find a target:


 * 1) The sound target of the sector that the monster is standing in is checked; if the player fires a weapon, the monster will wake up and attack, unless the monster has the ambush/deaf flag set.
 * 2) The monster checks if it can see any players who are still alive and still in the game. Players must be in the 180 degree field in front of the monster.

When a target is located, the monster plays its "see sound" (for example, in the case of an imp that is DSBGSIT1 or DSBGSIT2) and jumps to the "see state" that will lead it to attack the player by calling A_Chase.

Uses
The  code pointer appears in the following states in Doom's state table:

Example
The following is an example of how to set the  code pointer in a Dehacked file:

Pointer 21 (Frame 34) Codep Frame = 784

Or using BEX syntax:

[CODEPTR] Frame 1234 = Look