Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDecoMachinegunnerBipod.c
Go to the documentation of this file.
2{
3 protected static const string PORT_TARGET_VISIBLE = "TargetVisible";
4 protected static const string PORT_TARGET_POSITION = "TargetPos";
5
6 [Attribute("10", UIWidgets.EditBox)]
7 protected float m_fDistanceThreshold;
8
10
12
13 override TStringArray GetVariablesIn() { return s_aVarsIn; };
14
15 override void OnInit(AIAgent owner)
16 {
17 m_ControlledEntity = owner.GetControlledEntity();
18 }
19
20 override bool TestFunction(AIAgent owner)
21 {
22 vector targetPos;
23 bool targetVisible;
24
25 if (!m_ControlledEntity ||
27 !GetVariableIn(PORT_TARGET_VISIBLE, targetVisible))
28 return false;
29
30 float distance = vector.Distance(targetPos, m_ControlledEntity.GetOrigin());
31
32 return distance > m_fDistanceThreshold && targetVisible;
33 }
34
35 static override string GetOnHoverDescription() { return "Tests conditions specific for machinegunner bopod deployment behavior. This node is not intended for generic usage."; }
36}
float distance
proto bool GetVariableIn(string name, out void val)
override void OnInit(AIAgent owner)
override bool TestFunction(AIAgent owner)
static override string GetOnHoverDescription()
SCR_FieldOfViewSettings Attribute
array< string > TStringArray
Definition Types.c:385