Component · ai
Stimulus
Something perceivers can see and remember (players, corpses, thrown objects).
Fields
kind
stringCategory name behaviours query (
player, corpse).default ""
height
f32Height of the sight target above the feet in metres.
default 1.2m0 – 100
visibility
f32Detection range multiplier (0 = invisible, 0.5 = crouched in shadow).
default 10 – 10
Usage
Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.
Add it
ara do component.add -p entity=name:Crate -p component=Stimulus --why "Add Stimulus"Set a field
ara do property.set -p entity=name:Crate -p path=Stimulus.kind -p value="" --why "Tune Stimulus"In a scene document
{
"Stimulus": {
"kind": ""
}
}From C#
/// <summary>Reduce a crouched target visibility to AI.</summary>
public static void UseStimulus(Entity entity, in Tick tick)
{
ref var component = ref World.Get<Stimulus>(entity);
component.Visibility = 0.25f;
}From C#
Scripts read and write it with Get<Stimulus>(); see the Stimulus struct.