9 [
Attribute(
"{04D3B38E23F51754}Prefabs/AI/Groups/Slave_Group.et")]
12 [
Attribute(
"{54764D4E706F348C}Configs/Commanding/Commands.conf")]
15 [
Attribute(defvalue:
"8",
UIWidgets.EditBox,
desc:
"How many AI soldiers can be recruited into single player group")]
38 return m_sAIGroupPrefab;
55 super.OnPostInit(owner);
88 PlayerController pc =
GetGame().GetPlayerManager().GetPlayerController(playerId);
93 SCR_PlayerControllerGroupComponent groupComponent = SCR_PlayerControllerGroupComponent.Cast(pc.FindComponent(SCR_PlayerControllerGroupComponent));
94 if (!groupComponent || !groupComponent.IsPlayerLeaderOwnGroup())
101 SCR_AIGroup masterGroup = groupsManager.GetPlayerGroup(playerId);
111 array<AIWaypoint> currentWaypoints = {};
112 slaveGroup.GetWaypoints(currentWaypoints);
113 foreach (AIWaypoint currentwp : currentWaypoints)
115 slaveGroup.RemoveWaypoint(currentwp);
118 AIGroupMovementComponent slaveGroupMovementComp = AIGroupMovementComponent.Cast(slaveGroup.FindComponent(AIGroupMovementComponent));
119 if (slaveGroupMovementComp)
120 slaveGroupMovementComp.SetFormationDisplacement(0);
134 RplId responderRplId;
142 SCR_AIGroup playerGroup = groupsManager.GetPlayerGroup(playerID);
150 AIAgent agent = slaveGroup.GetLeaderAgent();
153 IEntity owner = agent.GetControlledEntity();
160 RPC_DoExecuteCommand(commandIndex, cursorTargetID, groupRplID, responderRplId, targetPosition, playerID, seed);
161 Rpc(
RPC_DoExecuteCommand, commandIndex, cursorTargetID, groupRplID, responderRplId, targetPosition, playerID, seed);
174 RplComponent rplComp;
176 rplComp = RplComponent.Cast(
Replication.FindItem(cursorTargetID));
178 cursorTarget = rplComp.GetEntity();
180 rplComp = RplComponent.Cast(
Replication.FindItem(groupRplID));
182 group = rplComp.GetEntity();
184 rplComp = RplComponent.Cast(
GetOwner().FindComponent(RplComponent));
188 if (command.
Execute(cursorTarget, group, targetPosition, playerID, rplComp.IsProxy()))
198 if (!rplComp.IsMaster())
201 PlayerController controller =
GetGame().GetPlayerManager().GetPlayerController(playerID);
205 SCR_PlayerControllerCommandingComponent commandingComp = SCR_PlayerControllerCommandingComponent.Cast(controller.FindComponent(SCR_PlayerControllerCommandingComponent));
209 commandingComp.CommandExecutedCallback(commandIndex);
220 SCR_ChimeraCharacter playerCharacter = SCR_ChimeraCharacter.Cast(
GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID));
221 if (!playerCharacter)
233 if (soundEventName.IsEmpty())
237 if (soundEventSeed == -1)
238 soundEventSeed = seed;
240 int signalSoldierCalled = signalManager.FindSignal(
"SoldierCalled");
241 int signalSeed = signalManager.FindSignal(
"Seed");
242 int signalSoldierCaller = signalManager.FindSignal(
"SoldierCaller");
245 signalManager.SetSignalValue(signalSoldierCalled, 1000);
246 signalManager.SetSignalValue(signalSoldierCaller, 0);
247 signalManager.SetSignalValue(signalSeed, seed);
266 int signalSeed = signalManager.FindSignal(
"Seed");
267 signalManager.SetSignalValue(signalSeed, seed);
268 soundComponent.SoundEventPriority(
SCR_SoundEvent.SOUND_CP_POSITIVEFEEDBACK, 50);
371 BaseContainer container = holder.GetResource().ToBaseContainer();
404 SCR_AIGroup playerGroup = groupsManager.GetPlayerGroup(playerID);
412 AIAgent agent = slaveGroup.GetLeaderAgent();
416 return agent.GetControlledEntity();
ArmaReforgerScripted GetGame()
enum ECommunicationType NORMAL_PRIORITY
SCR_BaseGameMode GetGameMode()
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void SCR_CommandingManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
ref array< ref SCR_BaseRadialCommand > m_aCommands
IEntity GetRespondingAI(int playerID)
void RequestCommandExecution(int commandIndex, RplId cursorTargetID, RplId groupRplID, vector targetPosition, int playerID, float seed)
string FindCommandNameFromIndex(int commandIndex)
void ResetSlaveGroupWaypoints(int playerId, IEntity player)
string GetCommandDisplayTextByName(string commandName)
string GetCommandSoundEventName(int commandIndex)
void SetMaxAIPerGroup(int max)
SCR_BaseRadialCommand FindCommand(string commandName)
void RPC_DoExecuteCommand(int commandIndex, RplId cursorTargetID, RplId groupRplID, RplId responderRplID, vector targetPosition, int playerID, float seed)
float GetCommandSoundEventSeed(int commandIndex)
SCR_PlayerCommandsConfig m_CommandsConfig
int FindCommandIndex(string commandName)
bool CanShowCommand(string commandName)
ResourceName GetGroupPrefab()
void PlayAICommandResponse(int playerID, bool positive, float seed, RplId responderRplId)
ref map< string, ref SCR_BaseRadialCommand > m_mNameCommand
void InitiateCommandMaps()
SCR_PlayerCommandsConfig GetCommandsConfig()
void PlayCommanderSound(int playerID, int commandIndex, float seed)
bool CanShowOnMap(string commandName)
ResourceName m_sCommandsConfigPath
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Object holding reference to resource. In destructor release the resource.
Replication item identifier.
ScriptInvokerBase< SCR_BaseGameMode_PlayerIdAndEntity > GetOnPlayerSpawned()
bool ShouldPlayAIResponse()
float GetSoundEventSeed()
string GetSoundEventName()
bool Execute(IEntity cursorTarget, IEntity target, vector targetPosition, int playerID, bool isClient)
string GetCommandDisplayName()
array< ref SCR_BaseRadialCommand > GetCommands()
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.