6 protected bool m_bOrdersSent =
false;
8 protected static const float INVESTIGATION_RADIUS_MIN = 20.0;
17 SetPriority(PRIORITY_ACTIVITY_INVESTIGATE_CLUSTER);
18 SetIsUniqueInActionQueue(
false);
20 foreach (
auto ft : ftInvestigate)
23 m_aFireteamsInvestigate.Insert(ft);
26 foreach (
auto ft : ftCover)
29 m_aFireteamsCover.Insert(ft);
36 fireteamsInvestigate.Clear();
37 fireteamsCover.Clear();
39 foreach (
auto ft : m_aFireteamsInvestigate)
40 fireteamsInvestigate.Insert(ft);
42 foreach (
auto ft : m_aFireteamsCover)
43 fireteamsCover.Insert(ft);
52 if (m_aFireteamsInvestigate.IsEmpty())
55 AddDebugMessage(
"All investigating fireteams are destroyed, activity is failed");
66 UnregisterFireteam(ft);
70 override void OnActionSelected()
72 super.OnActionSelected();
76 vector investigatePos;
77 float investigateRadius;
78 CalculateInvestigationArea(m_ClusterState, investigatePos, investigateRadius);
80 AICommunicationComponent comms = m_Utility.m_Owner.GetCommunicationComponent();
84 SendInvestigateMessages(comms, investigatePos, investigateRadius);
92 override void OnActionDeselected()
94 super.OnActionDeselected();
95 m_bOrdersSent =
false;
100 override void OnActionCompleted()
102 super.OnActionCompleted();
103 SendCancelMessages();
107 override void OnActionFailed()
109 super.OnActionFailed();
110 SendCancelMessages();
114 override void OnActionRemoved()
117 super.OnActionRemoved();
118 m_aFireteamsInvestigate.Clear();
119 m_aFireteamsCover.Clear();
123 protected void SendCancelMessages()
125 AICommunicationComponent comms = m_Utility.m_Owner.GetCommunicationComponent();
130 array<AIAgent> agents = {};
133 ft.GetFireteam().GetMembers(agents);
134 foreach (AIAgent agent : agents)
141 msg.SetReceiver(agent);
142 comms.RequestBroadcast(msg, agent);
148 protected void SendInvestigateMessages(AICommunicationComponent comms, vector pos,
float radius)
150 array<AIAgent> agents = {};
153 ft.GetFireteam().GetMembers(agents);
154 foreach (AIAgent agent : agents)
164 msg.m_RelatedGroupActivity =
this;
165 msg.SetReceiver(agent);
166 comms.RequestBroadcast(msg, agent);
172 ft.GetFireteam().GetMembers(agents);
173 foreach (AIAgent agent : agents)
182 msg.m_RelatedGroupActivity =
this;
183 msg.SetReceiver(agent);
184 comms.RequestBroadcast(msg, agent);
191 static void CalculateInvestigationArea(notnull
SCR_AITargetClusterState s, out vector outCenterPos, out
float outRadius)
193 const float minRadius = INVESTIGATION_RADIUS_MIN;
195 vector center = 0.5*(s.m_vBBMin + s.m_vBBMax);
196 float radius = Math.Max(minRadius, vector.DistanceXZ(center, s.m_vBBMax));
198 outCenterPos = center;
203 override string GetDebugPanelText()
206 string str =
"FTs: (";
208 str = str +
string.Format(
"%1, ", m_Utility.m_FireteamMgr.GetFireteamId(ftLock.GetFireteam()));
211 str = str +
string.Format(
"%1, ", m_Utility.m_FireteamMgr.GetFireteamId(ftLock.GetFireteam()));
213 str = str +
string.Format(
") => C: %1", m_Utility.m_Perception.GetTargetClusterStateId(m_ClusterState));