3 static const string WAYPOINT_PORT =
"WaypointIn";
4 static const string LOCATION_PORT =
"LocationOut";
7 protected static ref TStringArray s_aVarsOut = {
10 override TStringArray GetVariablesOut()
16 protected static ref TStringArray s_aVarsIn = {
19 override TStringArray GetVariablesIn()
26 bool TestLocationOfKnownEnemies(SCR_AIGroupUtilityComponent groupUtility, AIWaypoint waypoint)
28 float waypointRadiusSq = waypoint.GetCompletionRadius() * waypoint.GetCompletionRadius();
30 vector wpOrigin = waypoint.GetOrigin();
32 foreach (SCR_AITargetInfo tgtInfo : groupUtility.m_Perception.m_aTargets)
37 if (vector.DistanceSq(tgtInfo.m_vWorldPos, wpOrigin) < waypointRadiusSq)
39 SetVariableOut(LOCATION_PORT, tgtInfo.m_vWorldPos);
47 protected override bool TestFunction(AIAgent owner)
50 SCR_AIGroupUtilityComponent guc;
52 AIGroup group = AIGroup.Cast(owner);
56 if ( !GetVariableIn(WAYPOINT_PORT,waypoint) )
57 waypoint = group.GetCurrentWaypoint();
60 Print(
"Node IsEnemyWithinRadius executed without valid waypoint!");
63 guc = SCR_AIGroupUtilityComponent.Cast(owner.FindComponent(SCR_AIGroupUtilityComponent));
66 Print(
"Node IsEnemyWithinRadius executed on owner without group utility component!");
69 return TestLocationOfKnownEnemies(guc, waypoint);
73 protected override bool VisibleInPalette()
78 protected override string GetOnHoverDescription()
80 return "Decorator that test that at least one detected enemy is within completion radius of waypoint, current waypoint is used if none is provided";