Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetGadgetRaisedMode.c
Go to the documentation of this file.
1 class SCR_AISetGadgetRaisedMode : AITaskScripted
2 {
3  [Attribute("0", UIWidgets.CheckBox)]
4  protected bool m_bRaised;
5 
6  [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "When true, always returns running and executes on abort, otherwise executes on simulate.")]
7  private bool m_bKeepRunningUntilAborted;
8 
9  protected CharacterControllerComponent m_CharacterController;
10 
11  protected override bool VisibleInPalette()
12  {
13  return true;
14  }
15 
16  override void OnInit(AIAgent owner)
17  {
18  IEntity controlledEntity = owner.GetControlledEntity();
19  if (controlledEntity)
20  {
21  m_CharacterController = CharacterControllerComponent.Cast(controlledEntity.FindComponent(CharacterControllerComponent));
22  }
23  }
24 
25  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
26  {
28  return ENodeResult.FAIL;
29 
30  if (m_bKeepRunningUntilAborted)
31  return ENodeResult.RUNNING;
32 
33  m_CharacterController.SetGadgetRaisedModeWanted(m_bRaised);
34  return ENodeResult.SUCCESS;
35  }
36 
37  override void OnAbort(AIAgent owner, Node nodeCausingAbort)
38  {
39  if (m_CharacterController && m_bKeepRunningUntilAborted)
40  {
41  m_CharacterController.SetGadgetRaisedModeWanted(m_bRaised);
42  }
43  }
44 
45  override string GetOnHoverDescription()
46  {
47  return "Sets raised mode of gadget, either on simulate or on abort.";
48  }
49 };
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
m_CharacterController
SCR_CharacterPerceivableComponentClass m_CharacterController
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_AISetGadgetRaisedMode
Definition: SCR_AISetGadgetRaisedMode.c:1