20 static int GetMembers(
IEntitySource entitySource, out array<ResourceName> outPrefabs, out array<vector> outOffsets)
23 if (!entitySource || !entitySource.GetClassName().ToType().IsInherited(
SCR_AIGroup))
return false;
28 AIWorld aiWorld =
game.GetAIWorld();
29 if (!aiWorld)
return 0;
34 for (
int i = 0, count = entitySource.GetComponentCount(); i < count; i++)
36 componentSource = entitySource.GetComponent(i);
40 componentSource.Get(
"DefaultFormation", formationName);
41 formation = aiWorld.GetFormation(formationName);
45 if (!formation)
return 0;
48 entitySource.Get(
"m_aUnitPrefabSlots", outPrefabs);
52 int count = outPrefabs.Count();
53 for (
int i = 0; i < count; i++)
55 outOffsets.Insert(formation.GetOffsetPosition(i));
62class SCR_AIGroup_DelayedSpawn
80 ref array<ResourceName> m_aUnitPrefabSlots;
82 [
Attribute(defvalue:
"1",
desc:
"When true, group members will be spawned above terrain, offset by group's ATL height.\nWhen false, group members will be levelled horizontally with the group.",
category:
"Group Members")]
83 private bool m_bSnapToTerrain;
86 ref array<string> m_aStaticWaypoints;
89 ref array<ref SCR_WaypointPrefabLocation> m_aSpawnedWaypoints;
92 ref array<string> m_aStaticVehicles;
94 [
Attribute(defvalue:
"1",
desc:
"When true, group members will be spawned durin OnInit, if false spawning must be called manually calling SpawnUnits()",
category:
"Group Members")]
95 private bool m_bSpawnImmediately;
100 [
Attribute(defvalue:
"1",
UIWidgets.EditBox,
desc:
"When enabled, the group will be deleted when its last member dies or is deleted.\nThis will *not* delete the group when it starts empty.",
category:
"Group")]
134 [
Attribute(
"1",
desc:
"Max number of players in this group where 0 means infinite members",
category:
"Player settings",
params:
"0 100 1")]
234 int baseCallsign =
base.GetCallsign();
323 world.RegisterEntityToBeUpdatedWhileGameIsPaused(
this);
337 world.UnregisterEntityToBeUpdatedWhileGameIsPaused(
this);
421 m_UiInfo.SetFlagIsFromImageSet(value);
439 bool flagIsFromSet =
m_UiInfo.GetFlagIsFromImageSet();
440 return flagIsFromSet;
581 array<SCR_GroupRolePresetConfig> groupRolePresets = {};
590 if (preset.GetGroupRoleName().IsEmpty())
593 return preset.GetGroupRoleName();
635 if (!checkMasterAndSlaves)
652 totalAgentCount += aiGroup.GetAgentsCount();
656 totalAgentCount += aiGroup.GetAgentsCount();
658 return totalAgentCount;
672 totalGroupCount += aiGroup.GetAgentsCount();
676 totalGroupCount += aiGroup.GetAgentsCount();
678 return totalGroupCount;
698 return totalGroupCount;
724 m_UiInfo.SetFlagIsFromImageSet(isFromImageset);
733 array<ResourceName> textures = {};
736 if (textures.IsIndexValid(flagIndex))
737 m_UiInfo.SetGroupFlag(textures[flagIndex]);
762 array<string> textToFilter = {};
765 textToFilter.Insert(name);
792 string inputLC = input;
795 string profanity =
"#";
797 int indexOf = inputLC.IndexOf(profanity);
801 int inputLength = input.Length();
802 int profanityLength = profanity.Length();
806 input = input.Substring(0, indexOf) + input.Substring(indexOf + profanityLength, inputLength - profanityLength - indexOf);
808 input = input.Substring(profanityLength, inputLength - profanityLength);
810 indexOf = inputLC.IndexOfFrom(indexOf + profanityLength, profanity);
850 array<string> textToFilter = {};
853 textToFilter.Insert(
desc);
875 const PlayerController playerController =
GetGame().GetPlayerController();
876 if (playerController)
878 const SocialComponent socialComp = SocialComponent.Cast(playerController.FindComponent(SocialComponent));
889 const PlayerController playerController =
GetGame().GetPlayerController();
890 if (playerController)
892 const SocialComponent socialComp = SocialComponent.Cast(playerController.FindComponent(SocialComponent));
915 string company, platoon, squad, character, format;
916 GetCallsigns(company, platoon, squad, character, format);
917 string originalName =
string.Format(format, company, platoon, squad, character);
920 const PlayerController playerController =
GetGame().GetPlayerController();
921 if (!playerController)
924 const SocialComponent socialComp = SocialComponent.Cast(playerController.FindComponent(SocialComponent));
991 if (!checkMasterAndSlaves)
1003 return totalPlayerCount;
1125 AIControlComponent aiControlComponent = AIControlComponent.Cast(controlledEntity.FindComponent(AIControlComponent));
1126 if (!aiControlComponent)
1129 AIAgent agent = aiControlComponent.GetAIAgent();
1145 AIControlComponent aiControlComponent = AIControlComponent.Cast(controlledEntity.FindComponent(AIControlComponent));
1146 if (!aiControlComponent)
1149 AIAgent agent = aiControlComponent.GetAIAgent();
1166 if (editableEntityComp)
1167 rplId =
Replication.FindItemId(editableEntityComp);
1169 if (rplId.IsValid())
1170 SCR_NotificationsComponent.SendToGroup(
GetMaster().
GetGroupID(), notificationType, rplId);
1184 groupsManager.AddDisconnectedPlayer(playerID,
m_iGroupID);
1194 GetGame().GetCallqueue().CallLater(
Event_OnGroupMemberStateChange.Invoke, 1,
false, null, null, null, null, null, null, null, null, null);
1209 int playerID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(memberController.GetCharacter());
1219 if (!characterController)
1238 if (!controlledEntity)
1241 int playerID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(controlledEntity);
1419 IEntity controlledEntity =
GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID);
1420 if (!controlledEntity)
1425 if (!scriptedController || !scriptedController.
IsPossessing())
1509 IEntity controlledEntity =
GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID);
1510 if (!controlledEntity)
1513 AIControlComponent aiControlComponent = AIControlComponent.Cast(controlledEntity.
FindComponent(AIControlComponent));
1514 if (!aiControlComponent)
1517 AIAgent agent = aiControlComponent.GetAIAgent();
1546 void GetCallsigns(out
string company, out
string platoon, out
string squad, out
string character, out
string format)
1548 SCR_CallsignGroupComponent callsignComponent = SCR_CallsignGroupComponent.Cast(FindComponent(SCR_CallsignGroupComponent));
1549 if (!callsignComponent)
1552 callsignComponent.GetCallsignNames(company, platoon, squad, character, format);
1590 Print(
string.Format(
"Cannot spawn team members of group %1, AIWorld is missing in the world!",
this),
LogLevel.WARNING);
1601 Print(
string.Format(
"Group %1 does not have AIFormationComponent! Team members will not be spawned.",
this),
LogLevel.WARNING);
1605 if (!formationDefinition)
1606 Print(
string.Format(
"Formation of group %1 not found in SCR_AIWorld! Team members will not be spawned.",
this),
LogLevel.WARNING);
1629 SCR_AIGroup_DelayedSpawn delaySpawn =
new SCR_AIGroup_DelayedSpawn();
1631 delaySpawn.index = i;
1632 delaySpawn.resourceName = entityResourceNames[i];
1671 if (formationComponent)
1672 formationDefinition = formationComponent.GetFormation();
1674 spawnParams.TransformMode = ETransformMode.WORLD;
1675 GetWorldTransform(spawnParams.Transform);
1676 vector pos = spawnParams.Transform[3];
1678 if (formationDefinition)
1679 pos = CoordToParent(formationDefinition.GetOffsetPosition(
index));
1685 float surfaceY = world.GetSurfaceY(pos[0], pos[2]);
1691 AIPathfindingComponent pathFindindingComponent = AIPathfindingComponent.Cast(this.FindComponent(AIPathfindingComponent));
1695 NavmeshWorldComponent navmesh = pathFindindingComponent.GetNavmeshComponent();
1698 if (navmesh.IsTileRequested(pos))
1702 if (!navmesh.IsTileLoaded(pos))
1704 navmesh.LoadTileIn(pos);
1710 if (pathFindindingComponent && pathFindindingComponent.GetClosestPositionOnNavmesh(pos,
"10 10 10", pos))
1712 float groundHeight = world.GetSurfaceY(pos[0], pos[2]);
1713 if (pos[1] < groundHeight)
1714 pos[1] = groundHeight;
1715 vector outWaterSurfacePoint;
1719 if (
ChimeraWorldUtils.TryGetWaterSurface(GetWorld(), pos, outWaterSurfacePoint, waterSurfaceType, transformWS, obbExtents))
1721 pos = outWaterSurfacePoint;
1725 spawnParams.Transform[3] = pos;
1727 IEntity member =
GetGame().SpawnEntityPrefabEx(res,
true, world, spawnParams);
1744 FactionAffiliationComponent factionAffiliation = FactionAffiliationComponent.Cast(member.
FindComponent(FactionAffiliationComponent));
1746 if (factionAffiliation)
1747 factionAffiliation.SetAffiliatedFactionByKey(m_faction);
1757 if (
SCR_TimedWaypoint.Cast(wp) && !
float.AlmostEqual(prefabParams.m_WPTimeOverride, 0.0))
1759 if (!
float.AlmostEqual(prefabParams.m_WPRadiusOverride, 0.0))
1760 wp.SetCompletionRadius(prefabParams.m_WPRadiusOverride);
1761 wp.SetName(prefabParams.m_WPInstanceName);
1765 void AddWaypointsDynamic(out array<IEntity> entityInstanceList, array<ref SCR_WaypointPrefabLocation> prefabs)
1767 entityInstanceList =
new array<IEntity>;
1769 spawnParams.TransformMode = ETransformMode.WORLD;
1771 Math3D.MatrixIdentity4(mat);
1772 for (
int i = 0, length = prefabs.Count(); i < length; i++)
1776 mat[3] = prefabs[i].m_WPWorldLocation;
1777 spawnParams.Transform = mat;
1783 Print(prefabs[i].m_WPPrefabName);
1784 entity =
GetGame().SpawnEntityPrefab(
Resource.Load(prefabs[i].m_WPPrefabName), m_API.GetWorld(), spawnParams);
1785 entityInstanceList.Insert(entity);
1786 wp = AIWaypoint.Cast(entity);
1790 entity =
GetGame().SpawnEntityPrefab(
Resource.Load(prefabs[i].m_WPPrefabName),
GetGame().GetWorld(), spawnParams);
1791 wp = AIWaypoint.Cast(entity);
1795 entity =
GetGame().SpawnEntityPrefab(
Resource.Load(prefabs[i].m_WPPrefabName),
GetGame().GetWorld(), spawnParams);
1796 wp = AIWaypoint.Cast(entity);
1807 for (
int i = 0, length = aWaypointNames.Count(); i < length; i++)
1813 AddWaypoint(AIWaypoint.Cast(m_API.GetWorld().FindEntityByName(aWaypointNames[i])));
1817 AddWaypoint(AIWaypoint.Cast(
GetGame().GetWorld().FindEntityByName(aWaypointNames[i])));
1820 AddWaypoint(AIWaypoint.Cast(
GetGame().GetWorld().FindEntityByName(aWaypointNames[i])));
1828 for (
int i = 0, length = aVehicleNames.Count(); i < length; i++)
1836 vehicle = m_API.GetWorld().FindEntityByName(aVehicleNames[i]);
1849 if (vehicleUsageComp)
1861 for (
int i=0, length = entityList.Count(); i < length; i++)
1863 if (AIWaypoint.Cast(entityList[i]))
1867 delete entityList[i];
1876 if (!aWaypointNames)
1879 for (
int i=0, length = aWaypointNames.Count(); i < length; i++)
1908 if (!entity)
return false;
1910 AIControlComponent control = AIControlComponent.Cast(entity.
FindComponent(AIControlComponent));
1911 if (!control)
return false;
1913 AIAgent agent = control.GetControlAIAgent();
1914 if (!agent)
return false;
1916 control.ActivateAI();
1918 if (!agent.GetParentGroup())
1929 if (!m_API && entity && entity.
FindComponent(AIControlComponent))
1931 ref AIAgent agent = AIControlComponent.Cast(entity.
FindComponent(AIControlComponent)).GetControlAIAgent();
1938 ref AIAgent agent = AIControlComponent.Cast(entity.
FindComponent(AIControlComponent)).GetControlAIAgent();
1979 if (!components || components.IsEmpty())
1986 Print(
"Trying to allocate same component twice!",
LogLevel.WARNING);
1990 component.SetActionAccessible(
false);
2001 Print(
"Trying to allocate same compartment twice!",
LogLevel.WARNING);
2020 Print(
"Trying to remove compartment that is not allocated!",
LogLevel.WARNING);
2029 comp.SetCompartmentAccessible(
true);
2041 Print(
"Trying to remove smart action that is not allocated!",
LogLevel.WARNING);
2050 comp.SetActionAccessible(
true);
2063 if (m_faction !=
"")
return false;
2064 m_faction = factionKey;
2087 m_faction = faction.GetFactionKey();
2089 array<AIAgent> agents =
new array<AIAgent>;
2091 array<IEntity> updatedVehicles =
new array<IEntity>;
2096 foreach (AIAgent agent : agents)
2098 charEntity = agent.GetControlledEntity();
2103 FactionAffiliationComponent factionAffiliation = FactionAffiliationComponent.Cast(charEntity.
FindComponent(FactionAffiliationComponent));
2104 if (factionAffiliation)
2105 factionAffiliation.SetAffiliatedFaction(faction);
2112 FactionManager factionManager =
GetGame().GetFactionManager();
2113 int factionIndex = factionManager.GetFactionIndex(faction);
2131 FactionManager factionManager =
GetGame().GetFactionManager();
2132 if (!factionManager)
2135 Faction faction = factionManager.GetFactionByIndex(factionIndex);
2136 m_faction = faction.GetFactionKey();
2164 if (!
game)
return null;
2166 FactionManager factionManager =
game.GetFactionManager();
2167 if (!factionManager)
return null;
2169 return factionManager.GetFactionByKey(m_faction);
2178 FactionManager factionManager =
GetGame().GetFactionManager();
2179 if (!factionManager)
2182 return factionManager.GetFactionIndex(
GetFaction());
2231 Event_OnEmpty =
new ScriptInvokerBase<ScriptInvoker_AIGroupOnEmpty_Callback>();
2480 array<AIAgent> agents = {};
2482 foreach (AIAgent agent : agents)
2494 if (key ==
"coords")
2522 if (m_bSpawnImmediately || GetWorld().IsEditMode())
2529 if (requestComponent.GetPlayerId() !=
m_iLeaderID)
2540 IEntity baseEntity = spawnPoint.GetParent();
2544 SCR_MilitaryBaseComponent baseComponent = SCR_MilitaryBaseComponent.Cast(baseEntity.
FindComponent(SCR_MilitaryBaseComponent));
2554 return m_bSpawnImmediately;
2560 m_bSpawnImmediately = spawnImmediately;
2666 return m_SlaveGroup.m_aAIMembers.Find(character) != -1;
2676 array<SCR_GroupRolePresetConfig> groupRolePresets = {};
2682 if (groupRolePreset && groupRolePreset.GetGroupRole() ==
m_eGroupRole)
2683 return groupRolePreset.IsLoadoutInGroup(
loadout);
2695 int factionIndex = -1;
2696 FactionManager factionManager =
GetGame().GetFactionManager();
2698 factionIndex = factionManager.GetFactionIndex(
GetFaction());
2700 writer.WriteInt(factionIndex);
2705 writer.WriteInt(count);
2706 for (
int i = count - 1; i >= 0; i--)
2719 writer.WriteString(
m_UiInfo.GetGroupFlag());
2720 writer.WriteBool(
m_UiInfo.GetFlagIsFromImageSet());
2748 reader.ReadInt(factionIndex);
2749 if (factionIndex >= 0)
2755 int count, playerID;
2756 reader.ReadInt(count);
2757 for (
int i = count - 1; i >= 0; i--)
2759 reader.ReadInt(playerID);
2768 groupsManager.RegisterGroup(
this);
2770 groupsManager.OnGroupCreated(
this);
2775 reader.ReadInt(temp);
2783 string customDesc, customName;
2784 reader.ReadString(customDesc);
2785 reader.ReadString(customName);
2794 reader.ReadString(flag);
2797 bool isFromImageSet;
2798 reader.ReadBool(isFromImageSet);
2799 m_UiInfo.SetFlagIsFromImageSet(isFromImageSet);
2830 array<AIAgent> groupAgents = {};
2833 for (
int i = 1; i < groupAgents.Count(); i++)
2839 CharacterControllerComponent charController = character.GetCharacterController();
2840 if (!charController)
2843 if (!charController.IsUnconscious())
2883 array<AIWaypoint> aiWaypoints = {};
2886 foreach (AIWaypoint aiWaypoint : aiWaypoints)
2907 groupsManager.UnregisterGroup(
this);
2908 groupsManager.GetOnPlayableGroupRemoved().Invoke(
this);
2937enum SCR_EAIGroupFormation
2947class SCR_WaypointPrefabLocation
2949 [
Attribute(
"{750A8D1695BD6998}AI/Entities/Waypoints/AIWaypoint.et",
UIWidgets.ResourceAssignArray,
"Prefab for the waypoint")]
2953 string m_WPInstanceName;
2956 vector m_WPWorldLocation;
2958 [
Attribute(
"0",
UIWidgets.EditBox,
"Waypoint completion radius (-1 dont override default)")]
2959 float m_WPRadiusOverride;
2961 [
Attribute(
"0",
UIWidgets.EditBox,
"Waypoint completion time (-1 dont override default)")]
2962 float m_WPTimeOverride;
ArmaReforgerScripted GetGame()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_AIGroup Wedge
Names of enum values must match formation names in AIWorld.
func ScriptInvokerAIGroup
func ScriptInvoker_AIGroupOnEmpty_Callback
ResourceName resourceName
ScriptInvokerBase< ScriptInvoker_AIGroupOnEmpty_Callback > ScriptInvoker_AIGroupOnEmpty
ref array< ResourceName > m_aUnitPrefabSlots
ref array< IEntity > m_aSceneGroupUnitInstances
SCR_AIGroupClass snapToTerrain
func ScriptInvokerGroupRoleMethod
ScriptInvokerBase< ScriptInvokerGroupRoleMethod > ScriptInvokerGroupRole
SCR_AIGroupInfoComponentClass IDLE
Group has no waypoints and does not engage an enemy.
SCR_BaseGameMode GetGameMode()
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
override bool _WB_OnKeyChanged(IEntity owner, BaseContainer src, string key, BaseContainerList ownerContainers, IEntity parent)
Any property value has been changed. You can use editor API here and do some additional edit actions ...
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
SCR_EGroupRole
Group roles.
Get all prefabs that have the spawner data
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
bool IsCompartmentAccessible()
void SetCompartmentAccessible(bool val)
proto external Managed FindComponent(typename typeName)
proto external BaseWorld GetWorld()
Object holding reference to resource. In destructor release the resource.
Replication item identifier.
void AddDeniedRequester(int playerID)
void SetNewConsciousLeader()
array< SCR_ChimeraCharacter > GetAIMembers()
override bool RplSave(ScriptBitWriter writer)
void RemovePlayer(int playerID)
Called on the server (authority).
ref array< SCR_ChimeraCharacter > m_aAIMembers
bool IsLoadoutInGroup(SCR_FactionPlayerLoadout loadout)
int GetPlayerCount(bool checkMasterAndSlaves=false)
string GetCustomNameWithOriginal()
string GetGroupRoleName()
void QueueAddAgent(int playerID)
int m_iDefaultActiveRadioChannel
static ScriptInvoker GetOnPrivateGroupChanged()
static ScriptInvokerGroupRole GetOnGroupRoleChanged()
bool IsPlayerLeader(int playerID)
void RemovePlayerAgent(int playerID)
void SpawnAllImmediately()
int m_iDescriptionAuthorID
static ScriptInvoker GetOnPlayerRemoved()
ScriptInvoker GetOnLeaderChanged()
static ref ScriptInvoker s_OnFrequencyChanged
int m_iGroupRadioFrequency
void DestroyEntities(out array< IEntity > entityList)
void OnMemberDeath(notnull SCR_CharacterControllerComponent memberController, IEntity killerEntity, Instigator killer)
ScriptInvoker GetOnAgentRemoved()
void OnSpawnPointFinalizeSpawn(SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
static ref ScriptInvoker s_OnFlagSelected
bool InitFactionKey(string factionKey)
void GetCallsigns(out string company, out string platoon, out string squad, out string character, out string format)
void RemoveRequester(int playerID)
void RemoveWaypointFromGroup(AIWaypoint waypoint)
void AllocateSmartActions(array< AISmartActionComponent > components)
SCR_EGroupRole GetGroupRole()
bool GetFlagIsFromImageSet()
static ref ScriptInvoker s_OnJoinPrivateGroupConfirm
void SetCustomDescription(string desc, int authorID)
called on server only
void AddPlayer(int playerID)
Called on the server (authority).
void ListenToMemberDeath(notnull IEntity groupMember)
void SetWaypointParams(out AIWaypoint wp, SCR_WaypointPrefabLocation prefabParams)
void SetCustomName(string name, int authorID)
void OnControllableEntitySpawned(IEntity controlledEntity, notnull SCR_GadgetManagerComponent gadgetManager)
static bool s_bIgnoreSnapToTerrain
void AddWaypointsStatic(array< string > aWaypointNames)
SCR_ECharacterRank GetRequiredRank()
void CreateUnitEntities(bool editMode, array< ResourceName > entityResourceNames)
array< int > GetPlayerIDs()
void BroadCastSetFaction(int factionIndex)
SCR_AIGroup m_MasterGroup
ResourceName GetPresetResource()
static ref ScriptInvokerBase< ScriptInvokerAIGroup > s_OnGroupRallyPointChanged
int GetFirstPlayerLeaderID()
void OnGroupMemberStateChange()
Should only be called on the server (authority).
void RpcDo_SetGroupRole(SCR_EGroupRole groupRole)
bool SpawnGroupMember(bool snapToTerrain, int index, ResourceName res, bool editMode, bool isLast)
void RPC_DoSetCustomDescription(string desc, int authorID)
void SetCreatedByCommander(bool isCreatedByCommander)
bool HasRequesterID(int id)
static ref ScriptInvoker s_OnJoinPrivateGroupCancel
void SetPresetResource(ResourceName preset)
void AddWaypointToGroup(AIWaypoint waypoint)
ref ScriptInvoker Event_OnAgentRemoved
void ReleaseCompartment(BaseCompartmentSlot compartment)
void AddAgentFromControlledEntity(notnull IEntity controlledEntity)
ref array< int > m_aDeniedRequesters
void RPC_SetPrivate(bool isPrivate)
static ref ScriptInvoker s_OnPlayerAdded
void SetMemberSpawnDelay(int memberSpawnDelay)
void SetFlagIsFromImageSet(bool value)
ref SCR_ScriptProfanityFilterRequestCallback m_ProfanityCallbackDesc
void SetSpawnImmediately(bool spawnImmediately)
override void OnCurrentWaypointChanged(AIWaypoint currentWP, AIWaypoint prevWP)
static ScriptInvoker GetOnCustomNameChanged()
void ReleaseCompartments()
ScriptInvoker GetOnWaypointCompleted()
void SetRadioFrequency(int frequency)
SCR_ECharacterRank m_eRequiredRank
ref ScriptInvoker Event_OnLeaderChanged
int GetDescriptionAuthorID()
void RpcDo_SetRequiredRank(SCR_ECharacterRank rank)
bool IsPrivacyChangeable()
override void OnWaypointAdded(AIWaypoint wp)
bool IsRallyPointForced()
void SetRequiredRank(SCR_ECharacterRank rank)
ref ScriptInvoker Event_OnWaypointRemoved
int GetRequesterIDs(out array< int > valueArray)
ScriptInvoker GetOnWaypointRemoved()
override void OnAgentRemoved(AIAgent child)
ScriptInvoker GetOnMemberStateChange()
void SetPrivate(bool isPrivate)
Called on the server (authority).
void RemoveStaticWaypointRefs(array< string > aWaypointNames)
ref array< AISmartActionComponent > m_aAllocatedComponents
int GetNumberOfMembersToSpawn()
override void OnWaypointRemoved(AIWaypoint wp, bool isCurrentWaypoint)
void SetPrivacyChangeable(bool IsPrivacyChangeable)
void OnPlayerLeftGame(int playerId)
bool IsInitializing()
Returns true if group is in initialization state, for instance while still spawning its members.
ref array< int > m_aAgentIDQueue
static ref ScriptInvoker< SCR_AIGroup > s_OnCustomNameChanged
int GetAgentCountIncludingMasterAndSlaves()
ref array< int > m_aRequesterIDs
void SetSlave(SCR_AIGroup group)
ref ScriptInvoker Event_OnWaypointCompleted
void SetRallyPoint(notnull SCR_MilitaryBaseComponent base, bool force=false)
void AllocateCompartment(BaseCompartmentSlot compartment)
void SetGroupFlag(int flagIndex, bool isFromImageset)
called on server only
void SetMaxGroupMembers(int value)
void SetMaxMembers(int maxMembers)
called on server only
void RPC_DoSetMaxMembers(int maxMembers)
ScriptInvokerBase< ScriptInvokerAIGroup > GetOnAllDelayedEntitySpawned()
void SetCanDeleteIfNoPlayer(bool deleteEmpty)
Sets if the group should be deleted when all players leave.
void SetMaster(SCR_AIGroup group)
ScriptInvoker GetOnWaypointToRemove()
void OnNameFilteredCallback(array< string > resultText)
ScriptInvoker GetOnWaypointAdded()
int m_iDeployedRadioCount
int GetPlayerAndAgentCount(bool checkMasterAndSlaves=false)
bool RemoveAIEntityFromGroup(IEntity entity)
static void IgnoreSpawning(bool ignore)
static ScriptInvoker GetOnPlayerLeaderChanged()
static bool s_bIgnoreSpawning
static ScriptInvoker GetOnJoinPrivateGroupRequest()
static ScriptInvoker GetOnPlayerAdded()
void CompleteAllWaypoints()
void RPC_DoClearDeniedRequester()
bool GetSpawnImmediately()
override bool RplLoad(ScriptBitReader reader)
static ScriptInvoker GetOnJoinPrivateGroupConfirm()
override void EOnFrame(IEntity owner, float timeSlice)
override void EOnInit(IEntity owner)
void RemoveAgentFromControlledEntity(notnull IEntity controlledEntity)
SCR_AIGroupUtilityComponent GetGroupUtilityComponent()
ref ScriptInvoker Event_OnFactionChanged
ref SCR_AIGroupUIInfo m_UiInfo
override void OnWaypointCompleted(AIWaypoint wp)
ref array< IEntity > m_aSceneGroupUnitInstances
void AddRequester(int playerID)
ref ScriptInvoker Event_OnInit
ref ScriptInvoker_AIGroupOnEmpty Event_OnEmpty
void ClearDeniedRequester()
ScriptInvoker GetOnAgentAdded()
void RPC_DoAddDeniedRequester(int playerID)
void AddVehiclesStatic(array< string > aVehicleNames)
void RpcDo_RemoveRallyPoint()
bool SetFaction(Faction faction)
static ref ScriptInvoker< int, int > s_OnPlayerLeaderChanged
void ReleaseSmartAction(AISmartActionComponent component)
void RPC_DoRemoveRequester(int playerID)
ref array< BaseCompartmentSlot > m_aAllocatedCompartments
void RPC_SetLeaderID(int playerID)
static ref ScriptInvoker s_OnCustomDescChanged
ref array< IEntity > m_aSceneWaypointInstances
static void IgnoreSnapToTerrain(bool ignore)
ref ScriptInvokerBase< ScriptInvokerAIGroup > Event_OnAllDelayedEntitySpawned
static ref ScriptInvoker s_OnPrivateGroupChanged
static ref ScriptInvoker s_OnPlayerRemoved
void OnPlayerDisconnected(int playerID)
Should be only called on the server.
void AddOnGadgetsLoadedListener(int playerID, notnull IEntity controlledEntity)
ref SCR_ScriptProfanityFilterRequestCallback m_ProfanityCallbackName
bool m_bIsCreatedByCommander
void RPC_DoSetGroupFlag(int flagIndex, bool isFromImageset)
int GetDeniedRequesters(out array< int > valueArray)
string GetCustomDescription()
ref ScriptInvoker Event_OnGroupMemberStateChange
ScriptInvoker GetOnCurrentWaypointChanged()
static ScriptInvoker GetOnFlagSelected()
ScriptInvoker_AIGroupOnEmpty GetOnEmpty()
void RPC_DoAddPlayer(int playerID)
void RPC_DoSetPrivacyChangeable(bool IsPrivacyChangeable)
ref ScriptInvoker Event_OnWaypointToRemove
bool SpawnDelayedGroupMember(int spawnIndex)
bool m_bIsPrivacyChangeable
void AddWaypointsDynamic(out array< IEntity > entityInstanceList, array< ref SCR_WaypointPrefabLocation > prefabs)
void SetNumberOfMembersToSpawn(int number)
void NotificateGroupAIChange(IEntity controlledEntity, ENotification notificationType)
void CheckForLeader(int playerID, bool noLeaderAllowed)
void InvokeSubagentsOnWaypointChanged(AIWaypoint newWaypoint)
bool IsCreatedByCommander()
void SetCustomGroupFlag(ResourceName flag)
void SetFactionDelayed(int factionIndex)
override void OnAgentAdded(AIAgent child)
void RPC_DoSetMaxGroupMembers(int value)
ref ScriptInvoker Event_OnAgentAdded
void SetGroupRole(SCR_EGroupRole groupRole)
void RemoveRallyPoint()
Removes current group Rally Point.
static ScriptInvoker GetOnFrequencyChanged()
static ScriptInvoker GetOnCustomDescriptionChanged()
void RPC_DoRemoveLeavingPlayer(int playerID)
static ref ScriptInvoker s_OnMaxMembersChanged
void ReleaseSmartActions()
static ref ScriptInvokerGroupRole s_OnGroupRoleChanged
override void OnLeaderChanged(AIAgent currentLeader, AIAgent prevLeader)
ScriptInvoker GetOnInit()
void RPC_DoRemovePlayer(int playerID)
static ScriptInvokerBase< ScriptInvokerAIGroup > GetOnGroupRallyPointChanged()
bool AddAIEntityToGroup(IEntity entity)
void RPC_DoAddRequester(int playerID)
bool IsAIControlledCharacterMember(SCR_ChimeraCharacter character)
void IncreaseDeployedRadioCount()
ref ScriptInvoker Event_OnCurrentWaypointChanged
bool GetDeleteIfNoPlayer()
Returns true if the group is set to be deleted when all players leave.
void RPC_DoOnGroupMemberStateChange()
ScriptInvoker GetOnFactionChanged()
bool IsMaxMembersLimited()
void SCR_AIGroup(IEntitySource src, IEntity parent)
ref ScriptInvoker Event_OnWaypointAdded
void SetDefaultActiveRadioChannel(int id)
static bool DeLocalizeText(out string input)
void RPC_DoSetFrequency(int frequency)
void GetAllocatedSmartActions(out array< AISmartActionComponent > allocatedComponents)
bool IsPlayerInGroup(int playerID)
ref array< ref SCR_AIGroup_DelayedSpawn > m_delayedSpawnList
int GetDeployedRadioCount()
void RPC_DoSetCustomName(string name, int authorID)
void RPC_DoClearRequesterIDs()
void GetAllocatedCompartments(out array< BaseCompartmentSlot > allocatedCompartments)
SCR_AIGroupUtilityComponent m_GroupUtilityComponent
string m_sCustomDescription
int m_iNumOfMembersToSpawn
void RpcDo_SetRallyPoint(int callsignId, bool force)
void SetGroupLeader(int playerID)
Called on the server (authority).
void ClearRefs(out array< IEntity > entityList)
ref array< int > m_aPlayerIDs
void LeaderLifeStateChanged(ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState)
ResourceName GetGroupFlag()
void RpcDo_SetCreatedByCommander(bool isCreatedByCommander)
void SetMaxUnitsToSpawn(int cnt)
int GetTotalPlayerCount()
void DecreaseDeployedRadioCount()
static ref ScriptInvoker s_OnJoinPrivateGroupRequest
SCR_EGroupRole m_eGroupRole
void SetDeleteWhenEmpty(bool deleteWhenEmpty)
int GetDefaultActiveRadioChannel()
static ScriptInvoker GetOnJoinPrivateGroupCancel()
void OnDescFilteredCallback(array< string > resultText)
static SCR_AIVehicleUsageComponent FindOnNearestParent(notnull IEntity ent, out IEntity componentOwner)
ScriptInvokerBase< SCR_BaseGameMode_OnPlayerDisconnected > GetOnPlayerDisconnected()
ScriptInvokerBase< SCR_BaseGameMode_PlayerIdAndEntity > GetOnPlayerSpawned()
OnPlayerDeathWithParamInvoker GetOnPlayerDeathWithParam()
ref OnLifeStateChangedInvoker m_OnLifeStateChanged
void OnGroupWaypointChanged(AIWaypoint newWaypoint)
ResourceName GetFlagName(int index)
void GetGroupRolePresetConfigs(notnull array< SCR_GroupRolePresetConfig > groupArray)
int GetGroupFlagTextures(out array< ResourceName > textures)
static ScriptInvoker GetOnGadgetInitDoneInvoker()
Handles filtering profanities in texts.
Spawn point entity defines positions on which players can possibly spawn.
static SCR_SpawnPointFinalizeSpawn_Invoker GetOnSpawnPointFinalizeSpawn()
SCR_SpawnPoint GetSpawnPoint()
proto external void SetNewLeader(AIAgent newLeader)
proto external void ActivateAI()
Activates AI group, removes unwanted prefabs, balances units count, sets on agent remove and add even...
proto external AIWaypoint GetCurrentWaypoint()
proto external int GetWaypoints(out array< AIWaypoint > outWaypoints)
proto external bool CanLimitedAIBeAdded()
proto external void DeactivateAI()
proto external void CompleteWaypoint(AIWaypoint w)
Completes specified waypoint and removes it from the list of waypoints, no need to call RemoveWaypoin...
proto external int GetAgents(notnull out array< AIAgent > outAgents)
AIGroupClass AIAgentClass AddAgent(AIAgent pAgent)
proto external void RemoveWaypoint(AIWaypoint w)
proto external void AddWaypoint(AIWaypoint w)
proto external void RemoveAgent(AIAgent pAgent)
proto external int GetAgentsCount()
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
EntityEvent
Various entity events.
proto external PlayerController GetPlayerController()
EUserInteraction
Interaction type between two players.
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
proto native vector Vector(float x, float y, float z)