Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIGetEntityFromWaypoint.c
Go to the documentation of this file.
1 class SCR_AIGetEntityFromWaypoint : AITaskScripted
2 {
3  static const string PORT_ENTITY = "Entity";
4 
5  //------------------------------------------------------------------------------------------------
6  protected static ref TStringArray s_aVarsOut = {
7  PORT_ENTITY
8  };
9  override TStringArray GetVariablesOut()
10  {
11  return s_aVarsOut;
12  }
13 
14  //------------------------------------------------------------------------------------------------
15  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
16  {
17  AIGroup group = AIGroup.Cast(owner);
18  if (!group)
19  {
20  SCR_AgentMustBeAIGroup(this, owner);
21  return ENodeResult.FAIL;
22  }
23 
24  SCR_EntityWaypoint wp = SCR_EntityWaypoint.Cast(group.GetCurrentWaypoint());
25  if (!wp)
26  {
27  return ENodeResult.FAIL;
28  }
29 
30  IEntity entity = wp.GetEntity();
31  if (!entity)
32  {
33  return ENodeResult.FAIL;
34  }
35  SetVariableOut(PORT_ENTITY,entity);
36 
37  return ENodeResult.SUCCESS;
38  }
39 
40  //------------------------------------------------------------------------------------------------
41  protected override bool VisibleInPalette()
42  {
43  return true;
44  }
45 
46  //------------------------------------------------------------------------------------------------
47  protected override string GetOnHoverDescription()
48  {
49  return "Returns entity stored on waypoint of class SCR_AIEntityWaypoint";
50  }
51 
52 };
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_EntityWaypoint
Definition: SCR_EntityWaypoint.c:5
SCR_AIGetEntityFromWaypoint
Definition: SCR_AIGetEntityFromWaypoint.c:1