Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIGetMyGroup.c
Go to the documentation of this file.
1 class SCR_AIGetMyGroup: AITaskScripted
2 {
3  static const string PORT_GROUP_OUT = "GroupOut";
4 
5  //------------------------------------------------------------------------------------------------
6  override bool VisibleInPalette()
7  {
8  return true;
9  }
10 
11  //------------------------------------------------------------------------------------------------
12  protected static ref TStringArray s_aVarsOut = {
13  PORT_GROUP_OUT
14  };
15  override TStringArray GetVariablesOut()
16  {
17  return s_aVarsOut;
18  }
19 
20  //------------------------------------------------------------------------------------------------
21  override void OnInit(AIAgent owner)
22  {
23  if (GetVariableType(false, PORT_GROUP_OUT) != AIGroup)
24  {
25  NodeError(this, owner, PORT_GROUP_OUT+" should be AIGroup");
26  }
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  protected override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
31  {
32  AIGroup group = AIGroup.Cast(owner.GetParentGroup());
33  if ( group )
34  {
35  SetVariableOut(PORT_GROUP_OUT,group);
36  return ENodeResult.SUCCESS;
37  }
38  else
39  return ENodeResult.FAIL;
40 
41  }
42 };
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
SCR_AIGetMyGroup
Definition: SCR_AIGetMyGroup.c:1
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition: NodeError.c:3