10 class SCR_AIGroupUtilityComponent : SCR_AIBaseUtilityComponent
50 restartActivity =
false;
55 float currentTime =
GetGame().GetWorld().GetWorldTime();
56 float deltaTime_ms = 0;
61 AddDebugMessage(
"EvaluateActivity START");
62 if (m_bEvaluationBreakpoint)
64 Print(
"EvaluateActivity breakpoint triggered");
66 m_bEvaluationBreakpoint =
false;
71 AIMessage msgBase =
m_Mailbox.ReadMessage(
true);
79 AddDebugMessage(
string.Format(
"PerformGoalReaction: %1, from BT: %2", msgGoal, msgGoal.m_sSentFromBt));
92 if (!overrideReaction)
95 AddDebugMessage(
string.Format(
"PerformInfoReaction: %1, from BT: %2", msgInfo, msgInfo.m_sSentFromBt));
104 AddDebugMessage(
string.Format(
"InfoMessage consumed by action: %1, from BT: %2", msgInfo, msgInfo.m_sSentFromBt));
117 DebugLogActionsPriority();
121 restartActivity =
true;
123 restartActivity =
true;
138 AddDebugMessage(
"EvaluateActivity END\n");
177 SCR_AIInfoComponent info = chimeraAgent.m_InfoComponent;
201 Debug.Error(
"Null AI info occured");
230 if (isCurrentWaypoint)
284 if (commsHandler.CanBypass())
288 enumSignal: 0, transmitIfNoReceivers:
true, transmitIfPassenger:
true, preset: SCR_EAITalkRequestPreset.MEDIUM);
289 commsHandler.AddRequest(rq);
307 ftActivity.GetAssignedFireteams(fireteamLocks);
310 AIAgent reporterAgent = ftLock.GetFireteam().GetMember(0);
313 SCR_AICommsHandler commsHandler = SCR_AISoundHandling.FindCommsHandler(reporterAgent);
316 if (commsHandler.CanBypass())
320 commsHandler.AddRequest(rq);
332 array<ref AIActionBase> actions = {};
334 bool checkType = activityType !=
typename.Empty;
339 if (!activity || (checkType && !activity.IsInherited(activityType)))
342 if (activity.m_RelatedWaypoint == waypoint)
352 array<ref AIActionBase> allActions = {};
355 array<AIActionBase> subactions = {};
363 parallel.GetSubactions(subactions);
376 void OnMoveFailed(
int moveResult, IEntity vehicleUsed,
bool isWaypointReleated, vector moveLocation)
379 m_OnMoveFailed.Invoke(moveResult, vehicleUsed, isWaypointReleated, moveLocation);
394 super.EOnInit(owner);
410 m_GroupInfo = SCR_AIGroupInfoComponent.Cast(
m_Owner.FindComponent(SCR_AIGroupInfoComponent));
420 m_Mailbox = SCR_MailboxComponent.Cast(
m_Owner.FindComponent(SCR_MailboxComponent));
426 override void EOnDiag(IEntity owner,
float timeSlice)
441 AddDebugMessage(
"UpdateGroupControlMode");
448 if (currentActivity && currentActivity.m_bIsWaypointRelated.m_Value)
449 m_GroupInfo.SetGroupControlMode(EGroupControlMode.FOLLOWING_WAYPOINT);
451 m_GroupInfo.SetGroupControlMode(EGroupControlMode.IDLE);
453 m_GroupInfo.SetGroupControlMode(EGroupControlMode.AUTONOMOUS);
474 AIWaypoint wp =
m_Owner.GetCurrentWaypoint();
483 return vector.Distance(defendWp.GetOrigin(), pos) < defendWp.GetCompletionRadius();