Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetBehaviorAllowLook.c
Go to the documentation of this file.
1 class SCR_AISetBehaviorAllowLook : AITaskScripted
2 {
3  [Attribute()]
4  protected bool m_bAllowLook;
5 
6  private SCR_AIBehaviorBase m_CurrentBehavior;
7 
8  //------------------------------------------------------------------------------------------------
9  override void OnEnter(AIAgent owner)
10  {
11  SCR_AIUtilityComponent utility = SCR_AIUtilityComponent.Cast(owner.FindComponent(SCR_AIUtilityComponent));
12  m_CurrentBehavior = utility.GetCurrentBehavior();
13  }
14 
15  //------------------------------------------------------------------------------------------------
16  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
17  {
18  if (!m_CurrentBehavior)
19  return ENodeResult.FAIL;
20 
21  m_CurrentBehavior.m_bAllowLook = m_bAllowLook;
22 
23  return ENodeResult.SUCCESS;
24  }
25 
26  //------------------------------------------------------------------------------------------------
27  protected override bool VisibleInPalette() {return true;}
28 
29  //------------------------------------------------------------------------------------------------
30  protected override string GetOnHoverDescription() {return "Sets value of m_bAllowLook in current behavior.";}
31 
32  //------------------------------------------------------------------------------------------------
33  override string GetNodeMiddleText()
34  {
35  return string.Format("Allow Look: %1", m_bAllowLook);
36  }
37 };
SCR_AISetBehaviorAllowLook
Definition: SCR_AISetBehaviorAllowLook.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_CurrentBehavior
ref SCR_AIBehaviorBase m_CurrentBehavior
Used for avoiding constant casting, outside of this class use GetCurrentBehavior()
Definition: SCR_AIUtilityComponent.c:19
SCR_AIBehaviorBase
Definition: SCR_AIBehavior.c:1