7 [
Attribute(defvalue:
"0",
desc:
"Order in which the faction appears in the list. Lower values are first.")]
10 [
Attribute(defvalue:
"-1",
desc:
"Player limit for the faction.\n-1 means that there is no limit.",
params:
"-1 inf")]
22 [
Attribute(defvalue:
"1",
desc:
"Will the faction appear in the respawn menu?")]
25 [
Attribute(defvalue:
"1",
desc:
"Will players in the faction be able to volunteer to become a commander? \nKeep in mind commanders might be disabled altogether in the mission header.")]
28 [
Attribute(defvalue:
"1",
desc:
"Will players in the faction be able to capture new bases")]
30 [
Attribute(
desc:
"This faction will punish people who lost their rank by removing them from the faction\nIf the player gains rank they can (re)join FIA specifically")]
33 [
Attribute(
"1",
desc:
"Is this a military faction? This affects AI functionality related to combat.")]
51 [
Attribute(
"1",
desc:
"If this is false it would mean that every AI will be hostile towards their own faction members and essentially allow for Deathmatch. Use with caution, only checked on init, you can still set the faction hostile towards itself in runtime. This essentially makes sure it adds itself to FriendlyFactionsIds.")]
54 [
Attribute(
desc:
"List of faction IDs that are considered friendly for this faction. Note: If factionA has factionB as friendly but FactionB does not have FactionA as friendly then they are still both set as friendly so for init it is only required for one faction.")]
57 [
Attribute(
desc:
"Parent faction ID, players in this faction will be considered a part of their parent faction, but are seperate in gameplay to allow for custom interactions with AI, spawning and communication.\nNo value means this faction will be created independently.")]
75 [
Attribute(
"1",
desc:
"Auto create default group when all groups are full")]
87 [
Attribute(
desc:
"List of Entity catalogs. Each holds a list of entity Prefab and data of a given type. Catalogs of the same type are merged into one. Note this array is moved to a map on init and set to null")]
111 [
Attribute(
desc:
"A list of places of birth for this faction, used in generating identities for character")]
114 [
Attribute(
"{B4F35F09884BF79A}Configs/FactionCommander/FactionCommanderMenuEntries.conf",
desc:
"",
params:
"conf class=SCR_FactionCommanderMenuHierarchy")]
193 if (preset.IsEnabled())
194 groupArray.Insert(preset);
212 if (preset.IsEnabled())
259 return m_sFactionFlag;
434 if (!factionManager || !factionManager.CanChangeFactionsPlayable())
444 array<int> playerList = {};
445 GetGame().GetPlayerManager().GetPlayers(playerList);
450 foreach (
int playerId : playerList)
452 Faction playerFaction = factionManager.GetPlayerFaction(playerId);
457 if (playerFaction.GetFactionKey() != GetFactionKey())
466 if (!editorManager.IsLimited())
471 playerEntity = SCR_PossessingManagerComponent.GetPlayerMainEntity(playerId);
477 damageManager.SetHealthScaled(0);
539 if (scrOtherFaction && scrOtherFaction.
GetParent() ==
this)
567 return factionManager.GetFactionPlayerCount(
this);
606 array<int> allPlayers = {};
607 GetGame().GetPlayerManager().GetPlayers(allPlayers);
609 foreach (
int playerId : allPlayers)
611 Faction playerFaction = factionManager.GetPlayerFaction(playerId);
612 if (playerFaction ==
this)
613 players.Insert(playerId);
616 return players.Count();
651 Debug.Error2(
"SCR_EntityCatalogManagerComponent",
"Trying to obtain catalog of type: '" +
typename.EnumToString(
EEntityCatalogType, catalogType) +
"' (faction: " +
GetFactionKey() +
") but catalog is not yet initialized! Call your function one frame later!");
659 return entityCatalog;
663 Print(
string.Format(
"'SCR_Faction' trying to get entity list of type '%1' but there is no catalog with that type for faction '%2'",
typename.EnumToString(
EEntityCatalogType, catalogType),
GetFactionKey()),
LogLevel.WARNING);
681 outEntityCatalogs.Clear();
684 outEntityCatalogs.Insert(entityCatalog);
687 return outEntityCatalogs.Count();
696 friendlyFactions.Clear();
708 friendlyFactions.InsertAt(faction, 0);
712 friendlyFactions.Insert(faction);
716 return friendlyFactions.Count();
762 Print(
"'SCR_Faction' is trying to set friendly factions but no SCR_FactionManager could be found!",
LogLevel.ERROR);
768 factionManager.SetFactionsFriendly(
this,
this);
774 factionManager.SetFactionFriendlyOneWay(renegadeFaction,
this);
785 faction =
SCR_Faction.Cast(factionManager.GetFactionByKey(factionId));
789 Print(
string.Format(
"'SCR_Faction' is trying to set friendly factions on init but '%1' is not a valid SCR_Faction!", factionId),
LogLevel.ERROR);
798 factionManager.SetFactionsFriendly(
this, faction);
812 FactionAffiliationComponent factionComp = FactionAffiliationComponent.Cast(entity.FindComponent(FactionAffiliationComponent));
816 Faction faction = factionComp.GetAffiliatedFaction();
818 faction = factionComp.GetDefaultAffiliatedFaction();
834 array<int> indexes = {};
838 indexes.Insert(callsign.GetSignalIndex());
925 array<FactionKey> result();
959 reader.ReadBool(isTasksEnabled);
964 reader.ReadInt(playerLimit);
972class SCR_MilitaryBaseCallsign
975 protected string m_sCallsign;
978 protected string m_sCallsignShort;
981 protected string m_sCallsignUpperCase;
984 protected int m_iSignalIndex;
995 string GetCallsignShort()
997 return m_sCallsignShort;
1002 string GetCallsignUpperCase()
1004 return m_sCallsignUpperCase;
1011 return m_iSignalIndex;
ArmaReforgerScripted GetGame()
SCR_BaseGameMode GetGameMode()
SCR_CampaignSeizingComponent SCR_SeizingComponent EnumLinear()] enum SCR_EBaseCaptureState
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
SCR_EGroupRole
Group roles.
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
ref set< Faction > m_FriendlyFactions
ref array< string > m_aFlagNames
ref Color m_OutlineFactionColor
ScriptInvokerBase< ScriptInvoker_FactionPlayableChangedMethod > ScriptInvoker_FactionPlayableChanged
ResourceName m_sGroupFlagsImageSetOutlines
SCR_Faction ScriptedFaction BaseContainerProps()
func ScriptInvoker_FactionPlayableChangedMethod
SCR_Faction ScriptedFaction SCR_BaseContainerCustomTitleField("m_sCallsign")
ref array< ref SCR_GroupPreset > m_aPredefinedGroups
EOverrideWelcomeScreenFactionDisplay
ref array< ref SCR_MilitaryBaseCallsign > m_aBaseCallsigns
ref array< ref SCR_EntityCatalog > m_aEntityCatalogs
bool m_bIsPlayableDefault
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_LoadoutManager(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
FactionKey GetFactionKey()
proto external Managed FindComponent(typename typeName)
Core component to manage SCR_EditorManagerEntity.
SCR_EditorManagerEntity GetEditorManager()
bool IsDefaultSelfFriendly()
void SetFactionFriendly(notnull Faction faction)
ResourceName m_sFactionBackground
ref array< string > m_aFriendlyFactionsIds
void SetFactionFlagMaterial(ResourceName materialResource)
SCR_EGroupRole m_eDefaultGroupRoleForNewGroup
SCR_FactionHomeTerritoryConfig GetFactionHomeTerritoryConfig()
int GetAllFactionEntityCatalogs(notnull out array< SCR_EntityCatalog > outEntityCatalogs)
bool GetCanCreateOnlyPredefinedGroups()
SCR_EntityCatalog GetFactionEntityCatalogOfType(EEntityCatalogType catalogType, bool printNotFound=true)
ResourceName m_sCommanderMenuEntries
ref SCR_FactionHomeTerritoryConfig m_FactionHomeTerritoryConfig
bool m_bIsCustomLoadoutSupported
ResourceName GetGroupFlagImageSet()
bool IsRenegadePunishedExile()
ref array< ResourceName > m_aGroupFlags
SCR_FactionCallsignInfo GetCallsignInfo()
int GetPlayersInFaction(notnull out array< int > players)
int GetFactionRadioFrequency()
ref ScriptInvoker_FactionPlayableChanged m_OnFactionPlayableChanged
ref set< Faction > m_FriendlyFactions
ResourceName m_FactionFlagMaterial
bool m_bExileRenegadePunishment
ref array< ref SCR_GroupRolePresetConfig > m_aGroupRolePresetConfigs
void SetFactionHostile(notnull Faction faction)
SCR_MilitaryBaseCallsign GetBaseCallsignByIndex(int index, int offset=0)
ref Color m_NotificationFactionColor
SCR_RankContainer GetRanks()
bool DoRplLoad(ScriptBitReader reader)
Color GetNotificationTextFactionColor()
EOverrideWelcomeScreenFactionDisplay ShowInWelcomeScreenOverride()
bool m_bIsCommanderAvailable
Color GetNotificationFactionColor()
ResourceName m_sGroupFlagsImageSet
int m_iFactionRadioFrequency
Color GetOutlineFactionColor()
ref array< string > m_aAncestors
bool IsGroupRolesConfigured()
EEditableEntityLabel GetFactionLabel()
override bool DoCheckIfFactionFriendly(Faction faction)
void GetPredefinedGroups(notnull array< ref SCR_GroupPreset > groupArray)
void InitFactionIsPlayable(bool isPlayable)
void SetTasksEnabled(bool isTasksEnabled)
void SetCommanderId(int playerId)
void InitFactionRelationships()
Set up the faction relationships like friendlyness and parents.
ResourceName GetFlagName(int index)
override void Init(IEntity owner)
void GetGroupRolePresetConfigs(notnull array< SCR_GroupRolePresetConfig > groupArray)
static const int AI_COMMANDER_ID
ResourceName GetFactionFlag()
ResourceName GetFactionFlagMaterial()
bool m_bIsPlayableDefault
bool IsCustomLoadoutSupported()
ref Color m_OutlineFactionColor
bool IsEnabledAutoGroupCreationWhenFull()
static Faction GetEntityFaction(notnull IEntity entity)
ref array< ref SCR_EntityCatalog > m_aEntityCatalogs
bool DoRplSave(ScriptBitWriter writer)
ResourceName m_sGroupFlagsImageSetOutlines
ref array< ref SCR_MilitaryBaseCallsign > m_aBaseCallsigns
int GetGroupFlagTextures(out array< ResourceName > textures)
void SetPlayerLimit(int playerLimit)
int m_iIdentityVoiceSignal
EEditableEntityLabel m_FactionLabel
bool m_bEnableAutoGroupCreationWhenFull
ref array< ref SCR_GroupPreset > m_aPredefinedGroups
ref map< EEntityCatalogType, ref SCR_EntityCatalog > m_mEntityCatalogs
int GetIndentityVoiceSignal()
ref Color m_NotificationTextFactionColor
bool IsCommanderAvailable()
SCR_EGroupRole GetDefaultGroupRoleForNewGroup()
int GetFlagNames(out array< string > flagNames)
ResourceName GetFactionBackground()
bool IsPlayerCommander(int playerId)
bool IsInherited(string factionKey)
ScriptInvoker_FactionPlayableChanged GetOnFactionPlayableChanged()
ResourceName GetGroupFlagImageSetOutlines()
bool m_bCreateOnlyPredefinedGroups
void UpdateCustomLoadoutSupportState(SCR_LoadoutManager loadoutMgr)
Updates local state of which determines if players from this faction can save custom loadouts.
void SetIsPlayable(bool isPlayable, bool killPlayersIfNotPlayable=false)
ResourceName GetCommanderMenuConfig()
ref SCR_FactionCallsignInfo m_CallsignInfo
ref SCR_RankContainer m_FactionRankInfo
ref array< string > m_aFlagNames
void SetAncestors(notnull array< string > ancestors)
string m_sParentFactionId
array< FactionKey > GetDefaultFriendlyFactions()
array< int > GetBaseCallsignIndexes()
EOverrideWelcomeScreenFactionDisplay m_eShowInWelcomeScreenOverride
bool IsRelatedFaction(notnull Faction otherFaction)
int GetFriendlyFactions(notnull out array< Faction > friendlyFactions, bool includeSelf=true)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
@ NONE
When Shape is created and not initialized yet.
SCR_FieldOfViewSettings Attribute
proto external int GetSignalIndex(string name)
Get index for signal name. Return -1 if signal not found.
int IsEnabled()
Returns true if the light is enabled.