2[
ComponentEditorProps(
category:
"GameScripted/Commander", description:
"Handles interactions for the faction Commander role in Conflict. Should be attached to player controller.")]
5 [
Attribute(
"{EA5C18CC750579E2}Configs/Campaign/CommanderGraphLinesConfig.conf",
category:
"Lines")]
15class SCR_CampaignFactionCommanderPlayerComponent : SCR_FactionCommanderPlayerComponent
24 static const string CAMPAIGN_MILITARY_BASE_TASK_ID =
"%1_CampaignMilitaryBaseTask_%2_%3";
27 static SCR_CampaignFactionCommanderPlayerComponent GetLocalCampaignCommanderComponent()
29 return SCR_CampaignFactionCommanderPlayerComponent.Cast(
GetGame().
GetPlayerController().FindComponent(SCR_CampaignFactionCommanderPlayerComponent));
51 super.OnMapOpen(config);
67 super.OnMapClose(config);
101 super.OnRadialMenuBeforeOpen();
110 super.ClearRadialMenu();
125 super.OnEntryHovered(entry,
id);
155 IEntity leader =
GetGame().GetPlayerManager().GetPlayerControlledEntity(group.GetLeaderID());
175 MapItem baseItem = baseDesc.Item();
180 MapLink link = baseItem.LinkTo(item);
193 props.SetLineColor(linesData.
GetColor());
208 MapItem baseItem = baseDesc.Item();
215 baseItem.UnLink(link.Target());
231 PlayerController sender = PlayerController.Cast(
GetOwner());
249 int baseCallsign = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN;
254 if (baseCallsign == SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN)
264 PlayerController sender = PlayerController.Cast(
GetOwner());
283 string taskID =
string.Format(CAMPAIGN_MILITARY_BASE_TASK_ID, faction.GetFactionKey(),
base.GetCallsign(), GenerateTaskID());
288 SCR_CampaignMilitaryBaseTaskEntity
task = SCR_CampaignMilitaryBaseTaskEntity.Cast(taskSystem.CreateTask(
293 base.GetOwner().GetOrigin() + positionOffset,
306 if (SCR_SeizeCampaignMilitaryBaseTaskEntity.Cast(
task))
310 title = SCR_CampaignFactionCommanderHandlerComponent.SEIZE_TASK_RELAY_NAME;
311 description = SCR_CampaignFactionCommanderHandlerComponent.SEIZE_TASK_RELAY_DESC;
315 title = SCR_CampaignFactionCommanderHandlerComponent.SEIZE_TASK_NAME;
316 description = SCR_CampaignFactionCommanderHandlerComponent.SEIZE_TASK_DESC;
319 task.SetTaskName(title, {
base.GetFormattedBaseNameWithCallsign(faction)});
320 task.SetTaskDescription(description);
328 task.SetTaskName(taskUIInfo.GetName(), {base.GetFormattedBaseNameWithCallsign(faction)});
331 task.SetMilitaryBaseCallSign(baseCallsign);
332 taskSystem.SetTaskOwnership(
task, SCR_ETaskOwnership.EXECUTOR);
334 taskSystem.AddTaskFaction(
task, faction.GetFactionKey());
346 void CheatCommander()
367 SCR_CampaignFactionCommanderHandlerComponent handler = SCR_CampaignFactionCommanderHandlerComponent.Cast(SCR_CampaignFactionCommanderHandlerComponent.GetInstance());
371 handler.SetFactionCommander(playerFaction, playerId);
391 base.SetSupplyLimit(value);
411 base.SetReservedSupplyAmount(value);
431 base.SetSupplyRequestExecutionPriority(priority);
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_EditableEntityComponent m_HoveredEntity
SCR_BaseGameMode GetGameMode()
void LinkBaseWithGroup(notnull SCR_AIGroup group)
Draw a map link from a base to a group leader.
void SetSuppliesLimit(notnull SCR_CampaignMilitaryBaseComponent base, float value)
void RpcAsk_SetSupplyRequestExecutionPriority(int baseCallsign, int priority)
override void OnEntryHovered(SCR_SelectionMenuEntry entry, int id)
Triggered when a radial menu entry is hovered on.
void RpcAsk_CheatCommander(int playerId)
SCR_CampaignMilitaryBaseComponent m_CurrentHoveredBase
void CreateCampaignMilitaryBaseTask(ResourceName taskPrefab, SCR_AIGroup group, int playerId, vector positionOffset=vector.Zero)
void OnRadialMenuBeforeOpen()
Called each time the radial menu is before open in the map.
SCR_CampaignMilitaryBaseComponent GetHoveredBase()
bool m_bMustClearHoveredBase
void ClearAllLinks()
Remove all existing map links.
void RpcAsk_SetSuppliesLimit(int baseCallsign, float value)
SCR_CampaignFactionCommanderPlayerComponentClass m_HoveredBase
bool IsValidRequest(SCR_CampaignMilitaryBaseComponent base)
override void ClearRadialMenu()
ref array< MapLink > m_aMapLinks
void RpcAsk_CreateCampaignMilitaryBaseTask(ResourceName taskPrefab, int assigneeId, int factionIndex, int playerId, int baseCallsign, vector positionOffset)
void RpcAsk_SetReservedSupplyAmount(int baseCallsign, float value)
void OnMapClose(MapConfiguration config)
void OnMapOpen(MapConfiguration config)
void OnBaseHovered(SCR_CampaignMilitaryBaseComponent base)
void SetSupplyRequestExecutionPriority(SCR_ESupplyRequestExecutionPriority priority)
void SetReservedSupplyAmount(float value)
SCR_CharacterSoundComponentClass GetComponentData()
IEntity m_CurrentHoveredEntity
SCR_GroupTaskManagerComponent m_GroupTaskManager
ref map< SCR_SelectionMenuEntry, SCR_AIGroup > m_mEntryGroups
void SCR_FactionManager(IEntitySource src, IEntity parent)
SCR_FastTravelComponentClass m_PlayerController
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_MapEntity m_MapEntity
SCR_GraphLinesData GetGraphLinesData()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Handles interactions for the faction Commander role in Conflict. Should be attached to player control...
SCR_CommanderGraphLinesData GetGraphLinesData()
ref SCR_CommanderGraphLinesData m_GraphLinesData
Handles interactions for the faction Commander role. Should be attached to player controller.
bool IsPlayerCommander(int playerId)
BaseHoveredInvoker GetOnBaseHovered()
static IEntity GetLocalControlledEntity()
IEntity GetOwner()
Owner entity of the fuel tank.
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_FieldOfViewSettings Attribute
proto external Faction GetFactionByIndex(int index)
proto external PlayerController GetPlayerController()
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.