Noita Wiki
Advertisement
Modding Pages
Getting startedBasicsLua ScriptingData.wakUseful Tools
AudioEnemiesEnvironmentsPerksSpellsSpritesheetsMaterialsImage Emitters
Lua APIEnumsSpecial TagsList of all tagsUtility ScriptsSound EventsEnemy Information TableSpell 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])
Advertisement