4
edits
imported>DavidJCobb (mixed up hex and decimal by accident) |
(Return values decoded from SkyrimSE.exe 1.7.104 disassembly, confirmed in game.) |
||
| Line 1: | Line 1: | ||
Identifies an actor's current AI procedure, and returns the number representing that procedure's type. Valid procedure numbers range from 0 to 54; the value -1 is returned for invalid procedures, and for actors with no AI process. | Identifies an actor's current AI procedure, and returns the number representing that procedure's type. Valid procedure numbers range from 0 to 54; the value -1 is returned for invalid procedures, and for actors with no AI process. | ||
The procedure numbers | '''Syntax:''' | ||
[ActorID.]GetCurrentAIProcedure | |||
The actor's run-once package is checked first. These are the temporary packages the engine gives an actor to react to something, such as watching a fight or fleeing. If there is none, the actor's current package is used. The procedure the package is currently on is then converted to one of the numbers below. | |||
The numbers match the [https://geck.uesp.net/wiki/GetCurrentAIProcedure Fallout 3 / New Vegas table]. The game executable contains no names for them, so the names below are the Fallout 3 names. | |||
{| class="wikitable" | |||
! Number !! Procedure | |||
|- | |||
| -1 || Any procedure with no number, including every package made in the Creation Kit (see Notes) | |||
|- | |||
| 0 || TRAVEL. Also returned for a reference that is not an actor, or an actor with no AI process or no package. | |||
|- | |||
| 1 || ACTIVATE | |||
|- | |||
| 2 || ACQUIRE | |||
|- | |||
| 3 || WAIT | |||
|- | |||
| 4 || DIALOGUE | |||
|- | |||
| 5 || GREET | |||
|- | |||
| 6 || GREET_DEAD | |||
|- | |||
| 7 || WANDER | |||
|- | |||
| 8 || SLEEP | |||
|- | |||
| 9 || OBSERVE_COMBAT | |||
|- | |||
| 10 || EAT | |||
|- | |||
| 11 || FOLLOW | |||
|- | |||
| 12 || ESCORT | |||
|- | |||
| 14 || ALARM | |||
|- | |||
| 15 || PURSUE | |||
|- | |||
| 16 || FLEE | |||
|- | |||
| 17 || DONE | |||
|- | |||
| 18 || YIELD | |||
|- | |||
| 19 || TRAVEL_TARGET | |||
|- | |||
| 20 || CREATE_FOLLOW | |||
|- | |||
| 21 || GET_UP | |||
|- | |||
| 22 || MOUNT_HORSE | |||
|- | |||
| 23 || DISMOUNT_HORSE | |||
|- | |||
| 24 || DO_NOTHING | |||
|- | |||
| 27 || ACCOMPANY | |||
|- | |||
| 28 || USE_ITEM_AT | |||
|- | |||
| 29 || SANDMAN | |||
|- | |||
| 30 || WAIT_AMBUSH | |||
|- | |||
| 31 || SURFACE | |||
|- | |||
| 32 || WAIT_FOR_SPELL | |||
|- | |||
| 33 || CHOOSE_CAST | |||
|- | |||
| 34 || FLEE_NON_COMBAT | |||
|- | |||
| 35 || REMOVE_WORN_ITEMS | |||
|- | |||
| 36 || SEARCH | |||
|- | |||
| 37 || CLEAR_MOUNT_POSITION | |||
|- | |||
| 39 || AVOID_AREA | |||
|- | |||
| 40 || UNEQUIP_ARMOR | |||
|- | |||
| 41 || PATROL | |||
|- | |||
| 42 || USE_WEAPON | |||
|- | |||
| 43 || DIALOGUE_ACTIVATE | |||
|- | |||
| 44 || GUARD | |||
|- | |||
| 45 || SANDBOX | |||
|- | |||
| 46 || USE_IDLE_MARKER | |||
|- | |||
| 47 || TAKE_BACK_ITEM | |||
|- | |||
| 48 || SITTING | |||
|- | |||
| 49 || MOVEMENT_BLOCKED | |||
|- | |||
| 50 || CANNIBAL_FEED | |||
|} | |||
== Notes == | |||
*Packages made in the Creation Kit are all Package or Package Template types, and both are mapped to -1 while running, then 17 (DONE) once the package has stepped past its only procedure. On most NPCs this function returns -1. Other numbers come from the engine's run-once packages and from the older built-in package types. | |||
*0 does not always mean TRAVEL. It is also returned for a reference that is not an actor, an actor with no AI process, and an actor with no package. Actors with no AI process return 0, not -1. | |||
*13 (COMBAT), 25, 26 and 38 are never returned. | |||
*During a sandbox package the number shows what the actor is doing: 45 SANDBOX, 48 SITTING, 8 SLEEP, 10 EAT, 7 WANDER, 46 USE_IDLE_MARKER, 21 GET_UP or 0 TRAVEL. | |||
*An actor watching a nearby fight returns 9 (OBSERVE_COMBAT). [[GetCurrentAIPackage]] returns 9 (Spectator) for the same actor. | |||
*Always returns 0 in the Creation Kit's condition preview. | |||
*Checked against SkyrimSE.exe 1.7.104.0 (Anniversary Edition) by disassembly and in game. Other versions, including Legendary Edition, have not been checked. | |||
== See Also == | |||
*[[GetCurrentAIPackage]] | |||
*[[GetIsCurrentPackage]] | |||
[[Category:Condition Functions]] | [[Category:Condition Functions]] | ||
edits