Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIUnEquipItems.c
Go to the documentation of this file.
2{
4
5 [Attribute( defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "UnEquip on abort or alternatively on simulate" )]
6 private bool m_bKeepRunningUntilAborted;
7 private bool m_bHasAborted;
8
9 // -----------------------------------------------------------------------------------------------
10 override void OnInit(AIAgent owner)
11 {
12 IEntity ownerEntity = owner.GetControlledEntity();
13 if (!ownerEntity)
14 NodeError(this, owner, "Missing owner entity!");
15
17 }
18
19 // -----------------------------------------------------------------------------------------------
20 override void OnEnter(AIAgent owner)
21 {
22 m_bHasAborted = false;
23 }
24
25 // -----------------------------------------------------------------------------------------------
26 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
27 {
28 if (!m_bKeepRunningUntilAborted && m_GadgetManager)
29 {
30 m_GadgetManager.RemoveHeldGadget();
31 return ENodeResult.SUCCESS;
32 }
33
34 return ENodeResult.RUNNING;
35 }
36
37 // -----------------------------------------------------------------------------------------------
38 override void OnAbort(AIAgent owner, Node nodeCausingAbort)
39 {
40 if (m_bHasAborted)
41 return;
42
43 m_GadgetManager.RemoveHeldGadget();
44 m_bHasAborted = true;
45 }
46
47 // -----------------------------------------------------------------------------------------------
48 protected override string GetNodeMiddleText()
49 {
50 if (m_bKeepRunningUntilAborted)
51 return "Item unequiped when this node is aborted";
52 else
53 return "Item unequiped when node starts running";
54 }
55
56 // -----------------------------------------------------------------------------------------------
57 protected static override bool VisibleInPalette()
58 {
59 return true;
60 }
61
62 // -----------------------------------------------------------------------------------------------
63 static override bool CanReturnRunning()
64 {
65 return true;
66 }
67
68 // -----------------------------------------------------------------------------------------------
69 protected static override string GetOnHoverDescription()
70 {
71 return "Scripted Node: UnEquip any generic item or gadget that is currently being held by the character.";
72 }
73};
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition NodeError.c:3
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
static override string GetOnHoverDescription()
static override bool CanReturnRunning()
SCR_GadgetManagerComponent m_GadgetManager
static override bool VisibleInPalette()
override string GetNodeMiddleText()
static SCR_GadgetManagerComponent GetGadgetManager(IEntity entity)
ENodeResult
Definition ENodeResult.c:13
SCR_FieldOfViewSettings Attribute