Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AICreateTargetInfo.c
Go to the documentation of this file.
1 class SCR_AICreateTargetInfo : AITaskScripted
2 {
3  protected static const string TARGET_INFO_PORT = "TargetInfo";
4 
5  protected static const string ENTITY_PORT = "Entity";
6  protected static const string LAST_SEEN_POSITION_PORT = "LastSeenPosition";
7  protected static const string TIME_SINCE_SEEN_PORT = "TimeSinceSeen";
8 
9  ref SCR_AITargetInfo m_TargetInfo;
10 
11  protected ref TStringArray s_aVarsIn = {
12  ENTITY_PORT,
13  LAST_SEEN_POSITION_PORT,
14  TIME_SINCE_SEEN_PORT,
15  };
16  protected ref TStringArray s_aVarsOut = {TARGET_INFO_PORT};
17  override TStringArray GetVariablesIn() { return s_aVarsIn; }
18 
19  override TStringArray GetVariablesOut() { return s_aVarsOut; }
20 
21  override bool VisibleInPalette() { return true; }
22 
23  override string GetOnHoverDescription() { return "Create SCR_TargetInfo object from its member variables"; };
24 
25  //----------------------------------------------------------------------------------------------------------------
26  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
27  {
28  m_TargetInfo = new SCR_AITargetInfo();
29 
30  if(!GetVariableIn(ENTITY_PORT, m_TargetInfo.m_Entity))
31  return NodeError(this, owner, "No entity provided!");
32 
33  GetVariableIn(LAST_SEEN_POSITION_PORT, m_TargetInfo.m_vWorldPos);
34  GetVariableIn(TIME_SINCE_SEEN_PORT, m_TargetInfo.m_fTimestamp);
35  SetVariableOut(TARGET_INFO_PORT, m_TargetInfo);
36  return ENodeResult.SUCCESS;
37  }
38 }
SCR_AICreateTargetInfo
Definition: SCR_AICreateTargetInfo.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