Here the problem, by any way I absolutely CANNOT handle the vehicle spawner to save it into something (i’m talking about a vehicle the player has choosen).
If you have an idea, please tell me !
Thanks for your time.
I spent like 20 mins trying to find how to connect fort_vehicle with their devices but this seems to be working, you can then just utilize the fort_vehicle with the GetDevice() to save the device in the AgentMap
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Vehicles }
game_manager := class(creative_device):
@editable sedanVehicles : []vehicle_spawner_sedan_device = array{}
var Classes :[]MyVehicleClass=array{}
var AgentMap : [agent]vehicle_spawner_sedan_device = map{}
@editable Trigger : trigger_device = trigger_device{}
OnBegin<override>()<suspends> : void =
Trigger.TriggeredEvent.Subscribe(Test)
for(vehicleSedan : sedanVehicles):
MyNewClass := MyVehicleClass{Device:=vehicleSedan}
set Classes+=array{MyNewClass}
MyNewClass.Start()
Test(MAgent:?agent):void=
Print("TRIG")
if(Agent:=MAgent?,FC:=Agent.GetFortCharacter[],Veh:=FC.GetVehicle[]):
Print("TRIG2")
if(Vehi:=GetDevice(Veh)?):
Vehi.DestroyVehicle()
GetDevice(FortVehicle:fort_vehicle)<transacts>:?vehicle_spawner_sedan_device=
for(VehicleDevice:sedanVehicles):
for(AClass:Classes):
if(AClass.Fort_Vehicle?=FortVehicle):
return option{AClass.Device}
else. Print("ITS FALSE")
false
MyVehicleClass:=class<unique>:
var Device : vehicle_spawner_sedan_device
var Fort_Vehicle : ?fort_vehicle = false
Start():void=
Device.SpawnedEvent.Subscribe(VehSpawned)
VehSpawned(FortVeh:fort_vehicle):void=set Fort_Vehicle=option{FortVeh}