Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIClearAgentsForRadialCover.c
Go to the documentation of this file.
1 class SCR_AIClearAgentsForRadialCover : AITaskScripted
2 {
3  protected SCR_AIGroupUtilityComponent m_groupUtilityComponent;
4 
5  //------------------------------------------------------------------------------------------------
6  override void OnInit(AIAgent owner)
7  {
8  m_groupUtilityComponent = SCR_AIGroupUtilityComponent.Cast(owner.FindComponent(SCR_AIGroupUtilityComponent));
9  }
10 
11  //------------------------------------------------------------------------------------------------
12  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
13  {
14  if (!m_groupUtilityComponent)
15  return NodeError(this,owner, "AIAgent does not have group utility component!");
16 
17  SCR_AIDefendActivity defendActivity = SCR_AIDefendActivity.Cast(m_groupUtilityComponent.GetCurrentAction());
18  if (!defendActivity)
19  return NodeError(this, owner, "Not running defend activity!");
20 
21  defendActivity.ClearRadialCoverAgents();
22  return ENodeResult.SUCCESS;
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  protected override bool VisibleInPalette()
27  {
28  return true;
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  protected override string GetOnHoverDescription()
33  {
34  return "Clears the array of radial cover agents";
35  }
36 
37 };
SCR_AIDefendActivity
Definition: SCR_AIDefendActivity.c:1
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition: NodeError.c:3
SCR_AIClearAgentsForRadialCover
Definition: SCR_AIClearAgentsForRadialCover.c:1