NpcSystem / Npc Statemachine
verse-source
then:
PatrolDevice.Enable()
PatrolDevice.Assign(NpcData.InAgent)
# Signaled when a guard reaches this device.
PatrolDevice.NodeReachedEvent.Subscribe(PathReached)
# Signaled when a guard cannot reach the next `ai_patrol_path_device`.
PatrolDevice.NextNodeUnreachableEvent.Subscribe(PathReached)
if (DebugAI?) then DebugNpc("Patrol Path Started", ?Duration := AIDebugDrawTime, ?TextColor := NamedColors.Cyan)
else:
if (DebugAI?) then DebugNpc("No Patrol Device Found", ?Duration := AIDebugDrawTime, ?TextColor := NamedColors.Red)
PatrolPathStop():void=