Getting started • Basics • Lua Scripting • Data.wak • Useful Tools |
Audio • Enemies • Environments • Perks • Spells • Spritesheets • Materials • Image Emitters |
Lua API • Enums • Special Tags • List of all tags • Utility Scripts • Sound Events • Enemy Information Table • Spell and Perk IDs |
WIP
AnimalAIComponent.ai_state enum values[]
The AnimalAIComponent::ai_state
has values 1-21, which correspond to the following states:
local states = {
"RandomMove",
"Wandering",
"Eating",
"RaisingHead",
"PreparingJump",
"MoveNearTarget",
"Peeing",
"Defecating",
"Alert",
"Landing",
"TakingFireDamage",
"EscapingPrey",
"AttackingMelee",
"AttackingMeleeDash",
"AttackingRanged",
"AttackingRangedMulti",
"Escaping",
"JobDefault",
"JobGoto",
"JobHelpOtherEntity",
"GoNearHome",
}
These can be printed out like so:
local animal = GetUpdatedEntityID()
local state = ComponentGetValue2(
EntityGetFirstComponentIncludingDisabled(animal, "AnimalAIComponent"), "ai_state"
)
print(states[state])