Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIGetWaypoint.c
Go to the documentation of this file.
1 class SCR_AIGetWaypoint : AITaskScripted
2 {
3  static const string WAYPOINT_PORT = "WaypointIn";
4  static const string RADIUS_PORT = "RadiusOut";
5 
6  protected AIWaypoint m_Waypoint;
7 
8  //------------------------------------------------------------------------------------------------
9  protected static ref TStringArray s_aVarsIn = {
10  WAYPOINT_PORT
11  };
12 
13  //------------------------------------------------------------------------------------------------
14  override TStringArray GetVariablesIn()
15  {
16  return s_aVarsIn;
17  }
18 
19  //------------------------------------------------------------------------------------------------
20  protected static ref TStringArray s_aVarsOut = {
21  RADIUS_PORT
22  };
23 
24  //------------------------------------------------------------------------------------------------
25  override TStringArray GetVariablesOut()
26  {
27  return s_aVarsOut;
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
32  {
33  AIGroup group = AIGroup.Cast(owner);
34  if (!group)
35  {
36  SCR_AgentMustBeAIGroup(this, owner);
37  return ENodeResult.FAIL;
38  }
39 
40  if (!GetVariableIn(WAYPOINT_PORT,m_Waypoint))
41  m_Waypoint = group.GetCurrentWaypoint();
42  if (!m_Waypoint)
43  {
44  ClearVariable(RADIUS_PORT);
45  return ENodeResult.FAIL;
46  }
47 
48  SetVariableOut(RADIUS_PORT, m_Waypoint.GetCompletionRadius());
49  return ENodeResult.SUCCESS;
50  }
51 
52  //------------------------------------------------------------------------------------------------
53  protected override bool VisibleInPalette()
54  {
55  return false;
56  }
57 };
SCR_AgentMustBeAIGroup
void SCR_AgentMustBeAIGroup(Node node, AIAgent owner)
Definition: NodeError.c:14
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
m_Waypoint
protected AIWaypoint m_Waypoint
Definition: SCR_AmbientPatrolSpawnPointComponent.c:48
SCR_AIGetWaypoint
Definition: SCR_AIGetWaypoint.c:1