Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDecoOnWaypointChanged.c
Go to the documentation of this file.
1 class SCR_AIDecoOnWaypointChanged : DecoratorScripted
2 {
3  static const string PORT_WAYPOINT_OUT = "OutWaypoint";
4 
5 
6  protected static ref TStringArray s_aVarsOut = {
7  PORT_WAYPOINT_OUT
8  };
9  override TStringArray GetVariablesOut()
10  {
11  return s_aVarsOut;
12  }
13 
14  private AIWaypoint m_oCurrentWaypoint;
15 
16  protected override bool TestFunction(AIAgent owner)
17  {
18  AIGroup group = AIGroup.Cast(owner);
19  if (!group)
20  {
21  SCR_AgentMustBeAIGroup(this, owner);
22  return false;
23  }
24 
25  AIWaypoint newWaypoint = group.GetCurrentWaypoint();
26  bool result = true;
27 
28  if (!newWaypoint)
29  result = false;
30  else if (newWaypoint != m_oCurrentWaypoint)
31  result = false;
32  else
33  result = true;
34 
35  m_oCurrentWaypoint = newWaypoint;
36 
37  if (m_oCurrentWaypoint)
38  SetVariableOut(PORT_WAYPOINT_OUT,m_oCurrentWaypoint);
39  else
40  ClearVariable(PORT_WAYPOINT_OUT);
41 
42  return result;
43  }
44 
45  protected override bool VisibleInPalette()
46  {
47  return true;
48  }
49 
50  protected override string GetOnHoverDescription()
51  {
52  return "SCR_AIDecoOnWaypointChanged: Returns false if current waypoint is changed or is null";
53  }
54 };
55 
SCR_AgentMustBeAIGroup
void SCR_AgentMustBeAIGroup(Node node, AIAgent owner)
Definition: NodeError.c:14
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
SCR_AIDecoOnWaypointChanged
Definition: SCR_AIDecoOnWaypointChanged.c:1