Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIRemoveVehicleFromGetInActivity.c
Go to the documentation of this file.
2{
3 static const string PORT_VEHICLE = "VehicleIn";
4
5 //------------------------------------------------------------------------------------------------
6 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
7 {
8 SCR_AIGroup group = SCR_AIGroup.Cast(owner);
9 if (!group)
10 {
11 SCR_AgentMustBeAIGroup(this, owner);
12 return ENodeResult.FAIL;
13 }
14
16 if(!utility)
17 return ENodeResult.FAIL;
18 SCR_AIGetInActivity getIn = SCR_AIGetInActivity.Cast(utility.GetCurrentAction());
19 if (!getIn)
20 return ENodeResult.FAIL;
21
22 IEntity vehicleToClear;
23 if (!GetVariableIn(PORT_VEHICLE, vehicleToClear))
24 return ENodeResult.FAIL;
25
26 if (getIn.m_Vehicle.m_Value == vehicleToClear) // clear activity vehicle only if it is getIn activity dedicated to the specific vehicle
27 {
29 // if there are no other vehicles, fail straight away without restarting the activity
30 if (utility.m_VehicleMgr.GetVehiclesCount() == 0)
31 getIn.Fail();
32 }
33
34 return ENodeResult.SUCCESS;
35 }
36
37 //------------------------------------------------------------------------------------------------
38 protected static ref TStringArray s_aVarsIn = {
39 PORT_VEHICLE
40 };
42 {
43 return s_aVarsIn;
44 }
45
46 //------------------------------------------------------------------------------------------------
47 protected static override bool VisibleInPalette()
48 {
49 return true;
50 }
51
52 //------------------------------------------------------------------------------------------------
53 protected static override string GetOnHoverDescription()
54 {
55 return "Removes vehicle from get in activity";
56 }
57};
void SCR_AgentMustBeAIGroup(Node node, AIAgent owner)
Definition NodeError.c:14
proto bool GetVariableIn(string name, out void val)
ref SCR_AIGroupVehicleManager m_VehicleMgr
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385