A_Look
From DoomWiki.org
A_Look is a code pointer used in the normal animation for various monsters.
A_Look
scans the immediate area for targets (i.e. players to attack). Most monsters are initially spawned cycling through a series of states that repeatedly call A_Look
. The following strategies are used to find a target:
- 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.
- 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.
The following call graph shows some of the internals of the A_Look code pointer:
Uses[edit]
The A_Look
code pointer appears in the following states in Doom's state table:
Frame number | Doom internal name | Use |
---|---|---|
174 | S_POSS_STND | normal animation for the zombieman |
175 | S_POSS_STND2 | normal animation for the zombieman |
207 | S_SPOS_STND | normal animation for the shotgun guy |
208 | S_SPOS_STND2 | normal animation for the shotgun guy |
241 | S_VILE_STND | normal animation for the arch-vile |
242 | S_VILE_STND2 | normal animation for the arch-vile |
321 | S_SKEL_STND | normal animation for the revenant |
322 | S_SKEL_STND2 | normal animation for the revenant |
362 | S_FATT_STND | normal animation for the mancubus |
363 | S_FATT_STND2 | normal animation for the mancubus |
406 | S_CPOS_STND | normal animation for the heavy weapon dude |
407 | S_CPOS_STND2 | normal animation for the heavy weapon dude |
442 | S_TROO_STND | normal animation for the imp |
443 | S_TROO_STND2 | normal animation for the imp |
475 | S_SARG_STND | normal animation for the spectre and demon |
476 | S_SARG_STND2 | normal animation for the spectre and demon |
502 | S_HEAD_STND | normal animation for the cacodemon |
527 | S_BOSS_STND | normal animation for the baron of Hell |
528 | S_BOSS_STND2 | normal animation for the baron of Hell |
556 | S_BOS2_STND | normal animation for the Hell knight |
557 | S_BOS2_STND2 | normal animation for the Hell knight |
585 | S_SKULL_STND | normal animation for the lost soul |
586 | S_SKULL_STND2 | normal animation for the lost soul |
601 | S_SPID_STND | normal animation for the spiderdemon |
602 | S_SPID_STND2 | normal animation for the spiderdemon |
632 | S_BSPI_STND | normal animation for the arachnotron |
633 | S_BSPI_STND2 | normal animation for the arachnotron |
674 | S_CYBER_STND | normal animation for the cyberdemon |
675 | S_CYBER_STND2 | normal animation for the cyberdemon |
701 | S_PAIN_STND | normal animation for the pain elemental |
726 | S_SSWV_STND | normal animation for the Wolfenstein SS |
727 | S_SSWV_STND2 | normal animation for the Wolfenstein SS |
784 | S_BRAINEYE | normal animation for the monster spawner |
Example[edit]
The following is an example of how to set the A_Look
code pointer in a DeHackEd file:
Pointer 21 (Frame 34) Codep Frame = 784
Or using BEX syntax:
[CODEPTR] Frame 1234 = Look