NpcSystem / Npc Statemachine
verse-source
Logger.Print("{NPCName} - Patrol Device is Enabled")
PatrolDevice.Enable()
if (DebugAI?) then DebugNpc("Patrol Device is Enabled", ?Duration := AIDebugDrawTime, ?TextColor := NamedColors.Cyan)
PatrolDevice.Assign(NpcData.InAgent)
if (DebugAI?) then DebugNpc("Patrol Path Set, SubScibing to Events", ?Duration := AIDebugDrawTime, ?TextColor := NamedColors.Cyan)
PatrolDevice.PatrolPathStartedEvent.Subscribe(PathStarted)
PatrolDevice.PatrolPathStoppedEvent.Subscribe(PathReached)
else:
if (DebugAI?) then DebugNpc("No Patrol Device or Agent not Guard Type", ?Duration := AIDebugDrawTime, ?TextColor := NamedColors.Red)
################ THESE NEED WORK - Maybe set an array of Patrol paths and signal when the NPC reaches the next one to then move onto next group of the path
PatrolPathStart():void=
if:
PatrolDevice := PatrolPath?