Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIRemoveStuckVehicle.c
Go to the documentation of this file.
2{
3
4 SCR_AIGroup m_rGroup;
5 IEntity m_vehicleEnt;
6
7 override void OnInit(AIAgent owner)
8 {
9 m_rGroup = SCR_AIGroup.Cast(owner);
10 }
11
12 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
13 {
14 if (GetVariableIn("VehicleIn",m_vehicleEnt))
15 {
16 Vehicle vehicle = Vehicle.Cast(m_vehicleEnt);
17 if (m_rGroup && vehicle)
18 {
19
20 SCR_AIVehicleUsageComponent vehicleUsageComp = SCR_AIVehicleUsageComponent.FindOnNearestParent(m_vehicleEnt, m_vehicleEnt);
21 if (!vehicleUsageComp)
22 return ENodeResult.FAIL;
23
24 m_rGroup.GetGroupUtilityComponent().RemoveUsableVehicle(vehicleUsageComp);
25 return ENodeResult.SUCCESS;
26 };
27 }
28 return ENodeResult.FAIL;
29 }
30
31 protected static ref TStringArray s_aVarsIn = {
32 "VehicleIn"
33 };
35 {
36 return s_aVarsIn;
37 }
38
39 static override bool VisibleInPalette()
40 {
41 return true;
42 }
43
44 static override string GetOnHoverDescription()
45 {
46 return "Remove stuck vehicle: when vehicle cannot be moved it removes it from group's list of owned vehicles";
47 }
48};
proto bool GetVariableIn(string name, out void val)
static override bool VisibleInPalette()
static override string GetOnHoverDescription()
static ref TStringArray s_aVarsIn
override TStringArray GetVariablesIn()
static SCR_AIVehicleUsageComponent FindOnNearestParent(notnull IEntity ent, out IEntity componentOwner)
enum EPhysicsLayerPresets Vehicle
Definition gameLib.c:24
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385