Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDecoOnWaypointChanged.c
Go to the documentation of this file.
2{
3 static const string PORT_WAYPOINT_OUT = "OutWaypoint";
4
5
6 protected static ref TStringArray s_aVarsOut = {
7 PORT_WAYPOINT_OUT
8 };
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 static override bool VisibleInPalette()
46 {
47 return true;
48 }
49
50 protected static override string GetOnHoverDescription()
51 {
52 return "SCR_AIDecoOnWaypointChanged: Returns false if current waypoint is changed or is null";
53 }
54};
55
void SCR_AgentMustBeAIGroup(Node node, AIAgent owner)
Definition NodeError.c:14
proto void SetVariableOut(string name, void val)
proto void ClearVariable(string name)
override TStringArray GetVariablesOut()
static override string GetOnHoverDescription()
override bool TestFunction(AIAgent owner)
array< string > TStringArray
Definition Types.c:385