AI Patrol Path Controller
using { /Fortnite.com/AI}
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Characters}
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Random}
using { /Fortnite.com/Game}
# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
# A Verse-authored creative device that can be placed in a level
patrol_path_controller := class(creative_device):
@editable
GuardSpawners: []guard_spawner_device = array{}
@editable
Paths: []paths = array{}
#Sets up the patrol path
OnBegin<override>()<suspends>:void=
for (Path : Paths):
Path.SetUpPath()
for (Path : Paths):
for (Spawner : GuardSpawners):
Path.SetUpSpawner(Spawner)
paths := class<concrete>():
var GuardPatrollingPath: [agent]logic = map{}
@editable
GuardLimit: int = 1
@editable
StartingNode: ai_patrol_path_device = ai_patrol_path_device{}
@editable
EndNode: ai_patrol_path_device = ai_patrol_path_device{}
var CurrentGuardsOnPath: int = 0
SetUpPath(): void=
EndNode.NodeReachedEvent.Subscribe(TransferGuard)
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.