Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIUseVehicleFromWaypoint.c
Go to the documentation of this file.
1 class SCR_AIUseVehicleFromWaypoint : AITaskScripted
2 {
3  static const string PORT_VEHICLE = "Vehicle";
4 
5  //------------------------------------------------------------------------------------------------
6  protected static ref TStringArray s_aVarsOut = {
7  PORT_VEHICLE
8  };
9  override TStringArray GetVariablesOut()
10  {
11  return s_aVarsOut;
12  }
13 
14  //------------------------------------------------------------------------------------------------
15  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
16  {
17  SCR_AIGroup group = SCR_AIGroup.Cast(owner);
18  if (!group)
19  return NodeError(this,owner,"SCR_AIUseVehicleFromWaypoint must be run on SCR_AIGroup!");
20 
21  SCR_EntityWaypoint wp = SCR_EntityWaypoint.Cast(group.GetCurrentWaypoint());
22  if (!wp)
23  {
24  return ENodeResult.FAIL;
25  }
26 
27  IEntity vehicle = wp.GetEntity();
28  if (!vehicle)
29  {
30  return ENodeResult.FAIL;
31  }
32 
33  SetVariableOut(PORT_VEHICLE, vehicle);
34  group.AddUsableVehicle(vehicle);
35 
36  return ENodeResult.SUCCESS;
37  }
38 
39  //------------------------------------------------------------------------------------------------
40  protected override bool VisibleInPalette()
41  {
42  return true;
43  }
44 
45  //------------------------------------------------------------------------------------------------
46  protected override string GetOnHoverDescription()
47  {
48  return "Returns vehicle from SCR_AIEntityWaypoint and adds it to UsableVehicles of the group";
49  }
50 
51 };
SCR_AIUseVehicleFromWaypoint
Definition: SCR_AIUseVehicleFromWaypoint.c:1
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition: NodeError.c:3
SCR_AIGroup
Definition: SCR_AIGroup.c:68
SCR_EntityWaypoint
Definition: SCR_EntityWaypoint.c:5