3 static const string PORT_VEHICLE =
"VehicleOut";
6 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
12 return ENodeResult.FAIL;
14 array<AIAgent> agents =
new array<AIAgent>();
15 group.GetAgents(agents);
19 foreach (AIAgent agent : agents)
21 ChimeraCharacter chartacter = ChimeraCharacter.Cast(agent.GetControlledEntity());
22 if (!chartacter || !chartacter.IsInVehicle())
25 CompartmentAccessComponent access = chartacter.GetCompartmentAccessComponent();
26 if (!access || !access.IsInCompartment())
29 BaseCompartmentSlot comp = access.GetCompartment();
33 usedVehicle = comp.GetVehicle();
42 if (!group.IsUsableVehicle(usedVehicle))
43 group.AddUsableVehicle(usedVehicle);
45 SetVariableOut(PORT_VEHICLE, usedVehicle);
46 return ENodeResult.SUCCESS;
49 ClearVariable(PORT_VEHICLE);
50 return ENodeResult.FAIL;
54 protected static ref TStringArray s_aVarsIn = {};
57 override TStringArray GetVariablesIn() {
return s_aVarsIn; }
60 protected static ref TStringArray s_aVarsOut = { PORT_VEHICLE };
63 override TStringArray GetVariablesOut() {
return s_aVarsOut; }
66 override bool VisibleInPalette() {
return true; }
69 override string GetOnHoverDescription()
71 return "GetUsedVehicle: returns vehicle currently used by a group.";