Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIGetBaseTargetProperties.c
Go to the documentation of this file.
1 class SCR_AIGetBaseTargetProperties : AITaskScripted
2 {
3  protected static const string BASE_TARGET_PORT = "BaseTarget";
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  protected static const string ENDANGERING_PORT = "IsEndangering";
9 
10  protected ref TStringArray s_aVarsIn = {BASE_TARGET_PORT};
11  override TStringArray GetVariablesIn() { return s_aVarsIn; }
12 
13  protected ref TStringArray s_aVarsOut = {
14  ENTITY_PORT,
15  LAST_SEEN_POSITION_PORT,
16  TIME_SINCE_SEEN_PORT,
17  ENDANGERING_PORT
18  };
19  override TStringArray GetVariablesOut() { return s_aVarsOut; }
20 
21  override bool VisibleInPalette() { return true; }
22 
23  override string GetOnHoverDescription() { return "Returns properties of provided BaseTarget"; };
24 
25  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
26  {
27  BaseTarget baseTarget;
28 
29  if (!GetVariableIn(BASE_TARGET_PORT, baseTarget))
30  return ENodeResult.FAIL;
31 
32  if (!baseTarget)
33  return ENodeResult.FAIL;
34 
35  SetVariableOut(ENTITY_PORT, baseTarget.GetTargetEntity());
36  SetVariableOut(LAST_SEEN_POSITION_PORT, baseTarget.GetLastSeenPosition());
37  SetVariableOut(TIME_SINCE_SEEN_PORT, baseTarget.GetTimeSinceSeen());
38  SetVariableOut(ENDANGERING_PORT, baseTarget.IsEndangering());
39  return ENodeResult.SUCCESS;
40  }
41 }
SCR_AIGetBaseTargetProperties
Definition: SCR_AIGetBaseTargetProperties.c:1
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
BaseTarget
Definition: BaseTarget.c:12