Kitcoonbrain
Based on game build 7140014 | Last updated: 2026-03-03
Overview
KitcoonBrain is an AI brain component for the kitcoon prefab, implementing behavior trees to orchestrate movement, social, and reactive behaviors. It extends Brain and coordinates interactions with the follower, entitytracker, combat, locomotor, sleeper, burnable, and minigame_participator components. The kitcoon follows its owner under normal conditions, avoids ongoing combat, plays with toys or other kitcoons, and may watch minigames if the owner participates in one.
Usage example
local inst = CreateEntity()
inst:AddComponent("brain")
inst.components.brain:SetBrain("kitcoonbrain")
-- Additional setup (tags, follower component, etc.) required for full functionality
Dependencies & tags
Components used: follower, entitytracker, combat, locomotor, sleeper, burnable, minigame_participator, grouptargeter, timer, minigame
Tags: Checks for and temporarily removes/ restores tags: cattoy, cattoyairborne, catfood, busy, kitcoon, FX, NOCLICK, DECOR, INLIMBO, stump, burnt, notarget, flight, fire, irreplaceable
Properties
No public properties.
Main functions
GetOwner(inst)
- Description: Returns the kitcoon's owner via the
followercomponent, ornil. - Parameters:
inst(entity instance) — the kitcoon entity. - Returns:
instornil— the owner entity, ornilif not set.
ShouldPanic(inst)
- Description: Determines if the kitcoon should panic (e.g., due to owner being absent or its den burning).
- Parameters:
inst(entity instance) — the kitcoon entity. - Returns:
trueif the panic timer exists or the den is burning; otherwisefalse.
FindPlaymate(self)
- Description: Attempts to locate or retain a nearby kitcoon to play with, based on cooldowns, proximity, and availability.
- Parameters:
self(brain instance) — the kitcoon brain. - Returns:
trueif a valid playmate is found or retained; otherwisefalse.
PlayAction(inst)
- Description: Finds and initiates playing with a compatible toy or food item.
- Parameters:
inst(entity instance) — the kitcoon entity. - Returns: A
BufferedActionon success, ornilif no valid target or in abusystate.
WatchingMinigame(inst)
- Description: Returns the
minigamecomponent of the owner if the owner is a participator. - Parameters:
inst(entity instance) — the kitcoon entity. - Returns: The
minigamecomponent ornil.
OnStart()
- Description: Constructs and assigns the behavior tree on brain initialization. Defines priority-based logic including: standing when being named, panicking, following/avoiding owner, watching minigames, playing, and wandering.
- Parameters: None.
- Returns: None.
Events & listeners
- Listens to: None (no
inst:ListenForEventcalls are present). - Pushes:
critter_avoidcombat,start_playwithplaymate,on_played_with