Modding: Making a custom enemy

From Noita Wiki
Jump to navigation Jump to search
Modding Navigation
Fundamentals
BasicsData.wakGetting startedLua ScriptingUseful Tools
Guides
AudioEnemiesEnvironments (Fog of War) • Image EmittersMaterialsPerksSpellsSteam WorkshopSpritesheetsUsing CMake
Components/Entities
Component DocumentationEnumsList of all tagsSpecial Tags
Lua Scripting
Lua APIUtility Scripts
Other Information
Enemy Information TableMagic NumbersSound EventsSpell IDsPerk IDsMaterial 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])