3 protected static const string PORT_TARGET_VISIBLE =
"TargetVisible";
4 protected static const string PORT_TARGET_POSITION =
"TargetPos";
7 protected float m_fDistanceThreshold;
9 ref TStringArray s_aVarsIn = { PORT_TARGET_VISIBLE, PORT_TARGET_POSITION };
11 protected IEntity m_ControlledEntity;
13 override TStringArray GetVariablesIn() {
return s_aVarsIn; };
15 override void OnInit(AIAgent owner)
17 m_ControlledEntity = owner.GetControlledEntity();
20 override bool TestFunction(AIAgent owner)
25 if (!m_ControlledEntity ||
26 !GetVariableIn(PORT_TARGET_POSITION, targetPos) ||
27 !GetVariableIn(PORT_TARGET_VISIBLE, targetVisible))
30 float distance = vector.Distance(targetPos, m_ControlledEntity.GetOrigin());
32 return distance > m_fDistanceThreshold && targetVisible;
35 override string GetOnHoverDescription() {
return "Tests conditions specific for machinegunner bopod deployment behavior. This node is not intended for generic usage."; }