Nightmarecreaturebrain
Based on game build 714014 | Last updated: 2026-03-03
Overview
NightmareCreatureBrain implements the behavior tree logic for Nightmare Creatures, enabling dynamic combat responses including enemy submission to shadow-dominant targets, harassment with battle cries, and loitering patterns. It integrates with the combat, shadowsubmissive, locomotor, knownlocations, and behaviour systems to orchestrate attack, chase, taunt, and wander actions.
Usage example
local inst = CreateEntity()
inst:AddTag("nightmarecreature")
inst:AddComponent("combat")
inst:AddComponent("shadowsubmissive")
inst:AddComponent("locomotor")
inst:AddComponent("knownlocations")
inst:AddComponent("talker")
inst.brain = NightmareCreatureBrain(inst)
inst.brain:OnStart()
Dependencies & tags
Components used: combat, shadowsubmissive, locomotor, knownlocations, talker, behaviour
Tags: Checks shadowdominance (via shadowsubmissive:ShouldSubmitToTarget)
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
_harasstarget | Entity or nil | nil | Stores the target for harassment (set when shadow submission occurs). |
Main functions
OnStart()
- Description: Initializes the behavior tree for the Nightmare Creature with priority-ordered branches: panic, attack, harass, loiter, and basic wander.
- Parameters: None.
- Returns: Nothing.
- Error states: Requires the
combat,shadowsubmissive,locomotor, andknownlocationscomponents to be present onself.inst; otherwise the conditional checks may fail or return incorrect results.
Events & listeners
None identified.