32 foreach (
string factionKey :
m_Task.GetTaskData().m_aOwnerFactionKeys)
34 if (factionKey.IsEmpty())
39 return campaignFaction;
55 if (!
task || !
task.GetTaskData() || !
task.GetTaskData().m_UIInfo)
61 return task.GetTaskData().m_UIInfo.GetTranslatedName();
69 if (group.IsPlayerLeader(playerID))
94 array<SCR_AIGroup> playableGroups =
m_GroupsManager.GetPlayableGroupsByFaction(faction);
102 int baseCallsign = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN;
103 SCR_CampaignMilitaryBaseTaskEntity baseTask = SCR_CampaignMilitaryBaseTaskEntity.Cast(
GetOwner());
104 if (baseTask && baseTask.GetMilitaryBase())
105 baseCallsign = baseTask.GetMilitaryBase().GetCallsign();
119 if (!
task.IsTaskAssignedTo(groupExecutor))
140 array<SCR_AIGroup> playableGroups =
m_GroupsManager.GetPlayableGroupsByFaction(faction);
145 if (!newAssignedGroupExecutor)
148 SCR_PlayerControllerGroupComponent playerGroupComponent = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(requesterID);
149 if (!playerGroupComponent)
152 int requesterGroupId = playerGroupComponent.
GetGroupID();
155 if (!newAssignedGroup)
159 if (!playerTransceiver)
162 int baseCallsign = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN;
163 SCR_CampaignMilitaryBaseTaskEntity baseTask = SCR_CampaignMilitaryBaseTaskEntity.Cast(
GetOwner());
164 if (baseTask && baseTask.GetMilitaryBase())
165 baseCallsign = baseTask.GetMilitaryBase().GetCallsign();
167 if (faction.IsPlayerCommander(requesterID))
187 else if (
task.IsTaskAssignedTo(groupExecutor))
189 if (group.IsPlayerLeader(requesterID))
212 array<SCR_AIGroup> playableGroups =
m_GroupsManager.GetPlayableGroupsByFaction(faction);
220 int baseCallsign = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN;
221 SCR_CampaignMilitaryBaseTaskEntity baseTask = SCR_CampaignMilitaryBaseTaskEntity.Cast(
GetOwner());
222 if (baseTask && baseTask.GetMilitaryBase())
223 baseCallsign = baseTask.GetMilitaryBase().GetCallsign();
238 if (firstAssignedGroup)
241 else if (
task.IsTaskAssignedTo(groupExecutor))
290 BaseRadioComponent radio = BaseRadioComponent.Cast(HQ.GetOwner().FindComponent(BaseRadioComponent));
291 if (!radio || !radio.IsPowered())
294 return radio.GetTransceiver(0);
301 if (!playerController)
316 BaseRadioComponent radio = BaseRadioComponent.Cast(radioEnt.
FindComponent(BaseRadioComponent));
317 if (!radio || !radio.IsPowered())
320 return radio.GetTransceiver(0);
326 array<ref SCR_TaskExecutor> assignees =
task.GetTaskAssignees();
328 if (!assignees.IsIndexValid(0))
332 if (!assignedGroupExecutor)
360 msg.
SetGrid((gridX * 1000) + gridY);
364 msg.SetEncryptionKey(transmitter.GetRadio().GetEncryptionKey());
369 #ifdef TASK_NOTIFICATION_DEBUG
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseGameMode GetGameMode()
RplComponent m_RplComponent
SCR_GameModeCampaign m_Campaign
void OnTaskStateChanged(SCR_Task task, SCR_ETaskState newState)
void OnTaskAssigneeAdded(SCR_Task task, SCR_TaskExecutor executor, int requesterID)
SCR_CampaignFaction GetFaction()
SCR_EGroupRole
Group roles.
SCR_ETaskNotification
Objective and request notifications types.
SCR_ETaskNotificationMsg
Various types of task notifications for different events and states.
void OnGroupTaskSet(SCR_Task task, int byPlayerID)
SCR_GroupTaskManagerComponent m_GroupTaskManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
void SCR_GroupTaskManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_FactionManager m_FactionManager
SCR_GroupsManagerComponent m_GroupsManager
SCR_RequestedTaskNotificationComponentClass SCR_TaskNotificationComponentClass OnTaskCreated(SCR_Task task, int byPlayerID)
void SCR_Task(IEntitySource src, IEntity parent)
SCR_AIGroup GetFirstAssignedGroup(notnull SCR_Task task)
bool IsPlayerGroupLeader(int playerID, notnull array< SCR_AIGroup > playableGroups)
SCR_TaskSystem m_TaskSystem
SCR_TaskNotificationManagerComponent m_TaskNotificationManager
bool HasGroupTask(SCR_TaskExecutor executor)
void SendMessageToGroup(SCR_ETaskNotification notificationType, SCR_ETaskNotificationMsg msgType, int callerPlayerId, BaseTransceiver transmitter, SCR_AIGroup receiverGroup, int baseCallsign=SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN, int callerGroupId=-1, int calledGroupId=-1, int gridX=-1, int gridY=-1)
string GetTaskName(SCR_Task task)
const bool ALLOW_SEND_TO_EMPTY_GROUP
BaseTransceiver GetPlayerTransceiver(int playerId)
BaseTransceiver GetHQTransceiver(notnull SCR_CampaignFaction faction)
void SCR_TaskNotificationManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external Managed FindComponent(typename typeName)
bool CanSendNotification(notnull SCR_AIGroup receiverGroup)
IEntity GetGadgetByType(EGadgetType type)
static string GetTranslatedGroupNameAndRoleName(notnull SCR_AIGroup group)
static void GetGridPos(vector pos, out int gridX, out int gridZ, int resMin=2, int resMax=4)
override int GetGroupID()
void SetFaction(SCR_Faction faction)
void SetTaskPosition(vector taskPosition)
void SetFactionId(int factionId)
void SetTaskNotificationData(SCR_BaseTaskNotificationData data)
void SetTaskNotification(SCR_ETaskNotification type, SCR_ETaskNotificationMsg msg)
void SetBaseCallsign(int callsign)
void SetCalledGroupId(int groupId)
void SetCallerPlayerId(int callerPlayerId)
void SetCallerGroupId(int groupId)
proto external GenericEntity GetOwner()
Get owner entity.
void EOnInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_EditableTaskComponentClass m_Task
Editable SCR_BaseTask.
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
proto external PlayerController GetPlayerController()