Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIToggleMaxLOD.c
Go to the documentation of this file.
2{
3 static const string PORT_AGENT = "AgentIn";
4
5 [Attribute("1", UIWidgets.CheckBox, desc: "Enable MaxLOD prevention?")]
6 protected bool m_bPreventMaxLOD;
7
8 [Attribute("0", UIWidgets.CheckBox, desc: "Execute in OnAbort?")]
9 protected bool m_bPerformOnAbort;
10
11 protected bool m_bAbortFinished;
12
13 //----------------------------------------------------------------------------------------------------------------------------------------------
14 override void OnInit(AIAgent owner)
15 {
16 m_bAbortFinished = false;
17 }
18
19 //----------------------------------------------------------------------------------------------------------------------------------------------
20 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
21 {
23 return ToggleMaxLOD(owner);
24 return ENodeResult.RUNNING;
25 }
26
27 //----------------------------------------------------------------------------------------------------------------------------------------------
28 protected ENodeResult ToggleMaxLOD(AIAgent owner)
29 {
30 AIAgent agent;
31 if (!GetVariableIn(PORT_AGENT, agent))
32 return NodeError(this, owner, "No agent provided!");
33 if (!agent)
34 return ENodeResult.SUCCESS;
35
37 agent.PreventMaxLOD();
38 else
39 agent.AllowMaxLOD();
40 return ENodeResult.SUCCESS;
41 }
42
43 //----------------------------------------------------------------------------------------------------------------------------------------------
44 override void OnAbort(AIAgent owner, Node nodeCausingAbort)
45 {
47 {
48 ToggleMaxLOD(owner);
49 m_bAbortFinished = true;
50 }
51 }
52
53 //----------------------------------------------------------------------------------------------------------------------------------------------
54 protected static ref TStringArray s_aVarsIn = {
55 PORT_AGENT
56 };
57
58 //----------------------------------------------------------------------------------------------------------------------------------------------
60 {
61 return s_aVarsIn;
62 };
63
64 //----------------------------------------------------------------------------------------------------------------------------------------------
65 static override bool CanReturnRunning()
66 {
67 return true;
68 };
69
70 //----------------------------------------------------------------------------------------------------------------------------------------------
71 static override bool VisibleInPalette()
72 {
73 return true;
74 };
75
76 //----------------------------------------------------------------------------------------------------------------------------------------------
77 override string GetNodeMiddleText()
78 {
79 string value;
81 value = "PREVENTED";
82 else
83 value = "ALLOWED";
84 return "MaxLOD is "+ value;
85 }
86
87 //----------------------------------------------------------------------------------------------------------------------------------------------
88 static override string GetOnHoverDescription()
89 {
90 return "PreventMaxLOD: prevents AIAgent to change to MAX lod - that disactivates AI. Use attribute to enable/disable the prevention.";
91 };
92};
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
Definition Node.c:13
proto bool GetVariableIn(string name, out void val)
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
override void OnInit(AIAgent owner)
override string GetNodeMiddleText()
static override bool CanReturnRunning()
ENodeResult ToggleMaxLOD(AIAgent owner)
static ref TStringArray s_aVarsIn
static override string GetOnHoverDescription()
static override bool VisibleInPalette()
override void OnAbort(AIAgent owner, Node nodeCausingAbort)
override TStringArray GetVariablesIn()
ENodeResult
Definition ENodeResult.c:13
SCR_FieldOfViewSettings Attribute
array< string > TStringArray
Definition Types.c:385