Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDecoMachinegunnerBipod.c
Go to the documentation of this file.
1 class SCR_AIDecoMachinegunnerBipod : DecoratorScripted
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 
9  ref TStringArray s_aVarsIn = { PORT_TARGET_VISIBLE, PORT_TARGET_POSITION };
10 
11  protected IEntity m_ControlledEntity;
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 ||
26  !GetVariableIn(PORT_TARGET_POSITION, targetPos) ||
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  override string GetOnHoverDescription() { return "Tests conditions specific for machinegunner bopod deployment behavior. This node is not intended for generic usage."; }
36 }
Attribute
typedef Attribute
Post-process effect of scripted camera.
distance
float distance
Definition: SCR_DestructibleTreeV2.c:29
SCR_AIDecoMachinegunnerBipod
Definition: SCR_AIDecoMachinegunnerBipod.c:1