Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetGroupControlMode.c
Go to the documentation of this file.
1 class SCR_AISetGroupControlMode: AITaskScripted
2 {
3  [Attribute("0", UIWidgets.ComboBox, "Control mode to set", "", ParamEnumArray.FromEnum(EGroupControlMode) )]
4  private EGroupControlMode m_ControlMode;
5 
6  private SCR_AIGroupInfoComponent m_GroupInfo;
7 
8  override void OnInit(AIAgent owner)
9  {
10  AIGroup group = AIGroup.Cast(owner);
11  if (!group)
12  NodeError(this,owner,"SCR_AISetGroupControlMode must be run on group AIAgent!");
13  m_GroupInfo = SCR_AIGroupInfoComponent.Cast(group.FindComponent(SCR_AIGroupInfoComponent));
14  if (!m_GroupInfo)
15  NodeError(this,owner,"Cannot find Group Info Component!");
16  }
17 
18  //------------------------------------------------------------------------------------------------
19  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
20  {
21  if (m_GroupInfo)
22  m_GroupInfo.SetGroupControlMode(m_ControlMode);
23  return ENodeResult.SUCCESS;
24  }
25 
26  //------------------------------------------------------------------------------------------------
27  override bool VisibleInPalette() {return true;}
28 
29  //------------------------------------------------------------------------------------------------
30  protected override string GetOnHoverDescription() {return "Node sets control mode manually. Should be used only when Waypoint cannot do it by SendGoalMessage!";}
31 
32  //------------------------------------------------------------------------------------------------
33  protected override string GetNodeMiddleText()
34  {
35  return "Control mode: "+ typename.EnumToString(EGroupControlMode,m_ControlMode);
36  }
37 };
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.
SCR_AISetGroupControlMode
Definition: SCR_AISetGroupControlMode.c:1
m_GroupInfo
SCR_AIGroupInfoComponent m_GroupInfo
Definition: SCR_AIGroupUtilityComponent.c:14