Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetWeaponRaised.c
Go to the documentation of this file.
2 {
3  [Attribute("true", UIWidgets.CheckBox, "Raise weapon",)]
4  private bool m_bWeaponRaised;
5 
6  static const string RAISED_PORT = "Raised";
7 
8  private SCR_CharacterControllerComponent m_CharacterController;
9 
10  //------------------------------------------------------------------------------------------------
11  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
12  {
14  return ENodeResult.FAIL;
15 
16  int raiseWeapon;
17  if(!GetVariableIn(RAISED_PORT,raiseWeapon))
18  raiseWeapon = m_bWeaponRaised;
19 
20  m_AIInfo.SetWeaponRaised(raiseWeapon);
21  m_CharacterController.SetWeaponRaised(raiseWeapon);
22 
23  return ENodeResult.SUCCESS;
24  }
25 
26  //------------------------------------------------------------------------------------------------
27  override bool VisibleInPalette() {return true;}
28 
29  //------------------------------------------------------------------------------------------------
30  protected static ref TStringArray s_aVarsIn = {
31  RAISED_PORT
32  };
33  override array<string> GetVariablesIn()
34  {
35  return s_aVarsIn;
36  }
37 
38  //------------------------------------------------------------------------------------------------
39  override string GetNodeMiddleText()
40  {
41  string s;
42  s = s + string.Format("m_bWeaponRaised: %1\n", m_bWeaponRaised);
43  return s;
44  }
45 
46  //------------------------------------------------------------------------------------------------
47  override void OnInit(AIAgent owner)
48  {
49  super.OnInit(owner);
50 
51  if(owner.GetControlledEntity())
52  {
53  m_CharacterController = SCR_CharacterControllerComponent.Cast(owner.GetControlledEntity().FindComponent(SCR_CharacterControllerComponent));
55  NodeError(this, owner, "Can't find SCR_CharacterControllerComponent.");
56  }
57  }
58 };
SCR_AICharacterStats
Definition: SCR_AICharacterStats.c:1
SCR_AISetWeaponRaised
Definition: SCR_AISetWeaponRaised.c:1
m_CharacterController
SCR_CharacterPerceivableComponentClass m_CharacterController
SCR_CharacterControllerComponent
Definition: SCR_CharacterControllerComponent.c:35
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition: NodeError.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_AIInfo
SCR_AIInfoComponent m_AIInfo
Definition: SCR_AIUtilityComponent.c:11