Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_Faction.c
Go to the documentation of this file.
3typedef ScriptInvokerBase<ScriptInvoker_FactionPlayableChangedMethod> ScriptInvoker_FactionPlayableChanged;
6{
7 [Attribute(defvalue: "0", desc: "Order in which the faction appears in the list. Lower values are first.")]
8 protected int m_iOrder;
9
10 [Attribute(defvalue: "-1", desc: "Player limit for the faction.\n-1 means that there is no limit.", params: "-1 inf")]
11 protected int m_iPlayerLimit;
12
13 [Attribute("1 1 1", UIWidgets.ColorPicker, desc: "Outline faction color")]
15
16 [Attribute("1 1 1", UIWidgets.ColorPicker, desc: "Faction color for notifications")]
18
19 [Attribute("1 1 1", UIWidgets.ColorPicker, desc: "Faction color for text in notifications")]
21
22 [Attribute(defvalue: "1", desc: "Will the faction appear in the respawn menu?")]
23 protected bool m_bIsPlayable;
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")]
29 protected bool m_bCanCaptureBases;
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")]
32
33 [Attribute("1", desc: "Is this a military faction? This affects AI functionality related to combat.")]
34 protected bool m_bIsMilitary;
35
36 [Attribute("true", desc: "This faction can receive tasks.")]
37 protected bool m_bTasksEnabled;
38
39 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Flag icon of this particular faction.", params: "edds")]
40 private ResourceName m_sFactionFlag;
41
42 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Faction flag material, used on flag poles.", params: "emat")]
44
45 [Attribute("0", UIWidgets.SearchComboBox, "", enumType: EEditableEntityLabel)]
47
48 [Attribute(defvalue: EOverrideWelcomeScreenFactionDisplay.NONE.ToString(), desc: "An extra override if the spawn menu will show the faction in the welcome screen regardless of it being playable", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EOverrideWelcomeScreenFactionDisplay))]
50
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.")]
52 protected bool m_bFriendlyToSelf;
53
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.")]
55 protected ref array<string> m_aFriendlyFactionsIds;
56
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.")]
58 protected string m_sParentFactionId;
59
62
63 [Attribute(desc: "Group preset for predefined groups roles")]
64 protected ref array<ref SCR_GroupRolePresetConfig> m_aGroupRolePresetConfigs;
65
66 [Attribute(desc: "Group preset for predefined groups")]
67 protected ref array<ref SCR_GroupPreset> m_aPredefinedGroups;
68
69 [Attribute(SCR_EGroupRole.ASSAULT.ToString(), UIWidgets.ComboBox, "Default group role when creating a new group", enumType: SCR_EGroupRole)]
71
72 [Attribute(desc: "Create only predefined groups")]
75 [Attribute("1", desc: "Auto create default group when all groups are full")]
77
78 [Attribute("0")]
80
81 protected ref array<string>> m_aAncestors;
82 protected ref ScriptInvoker_FactionPlayableChanged m_OnFactionPlayableChanged; //Gives Faction and Bool enabled
83
84 [Attribute(desc: "List of ranks")]
86
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")]
88 protected ref array<ref SCR_EntityCatalog> m_aEntityCatalogs;
89
90 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Flag icons for group.", params: "edds")]
91 protected ref array<ResourceName> m_aGroupFlags;
92
93 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Flag imageset for groups of this faction.", params: "imageset")]
95
96 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Flag outlines imageset for groups of this faction.", params: "imageset")]
98
99 [Attribute("List of flags from imageset")]
100 protected ref array<string> m_aFlagNames;
101
102 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Background imageset for this faction background", params:"imageset")]
104
105 [Attribute("0", desc:"Identity voice signal", params:"0 inf")]
107
109 protected ref array<ref SCR_MilitaryBaseCallsign> m_aBaseCallsigns;
110
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")]
117 //~ Catalog map for quicker obtaining the catalog using EEntityCatalogType
119
120 protected bool m_bCatalogInitDone;
121 protected bool m_bIsPlayableDefault;
123 protected ref set<Faction> m_FriendlyFactions = new set<Faction>;
125
126 static const int AI_COMMANDER_ID = 0;
128
129 //------------------------------------------------------------------------------------------------
133
134 //------------------------------------------------------------------------------------------------
137 {
138 return m_iOrder;
139 }
140
141 //------------------------------------------------------------------------------------------------
147
148 //------------------------------------------------------------------------------------------------
154
155 //------------------------------------------------------------------------------------------------
158 {
159 m_bIsCustomLoadoutSupported = loadoutMgr && loadoutMgr.IsFactionSupportingCsutomLoadouts(this);
160 }
161
162 //------------------------------------------------------------------------------------------------
164 void GetPredefinedGroups(notnull array<ref SCR_GroupPreset> groupArray)
165 {
166 for (int i = 0, count = m_aPredefinedGroups.Count(); i < count; i++)
167 {
169 groupArray.Insert(m_aPredefinedGroups[i]);
170 }
171 }
172
173 //------------------------------------------------------------------------------------------------
179
180 //------------------------------------------------------------------------------------------------
186
187 //------------------------------------------------------------------------------------------------
189 void GetGroupRolePresetConfigs(notnull array<SCR_GroupRolePresetConfig> groupArray)
190 {
193 if (preset.IsEnabled())
194 groupArray.Insert(preset);
195 }
196 }
197
198 //------------------------------------------------------------------------------------------------
203
204 //------------------------------------------------------------------------------------------------
206 {
207 if (m_aGroupRolePresetConfigs.IsEmpty())
208 return false;
209
211 {
212 if (preset.IsEnabled())
213 return true;
214 }
216 return false;
217 }
218
219 //------------------------------------------------------------------------------------------------
224 return m_aFlagNames[index];
225 }
226
227 //------------------------------------------------------------------------------------------------
230 int GetFlagNames(out array<string> flagNames)
231 {
232 return flagNames.Copy(m_aFlagNames);
233 }
234
235 //------------------------------------------------------------------------------------------------
241
245 }
246
247 //------------------------------------------------------------------------------------------------
250 int GetGroupFlagTextures(out array<ResourceName> textures)
251 {
252 return textures.Copy(m_aGroupFlags);
253 }
254
255 //------------------------------------------------------------------------------------------------
258 {
259 return m_sFactionFlag;
260 }
261
262 //------------------------------------------------------------------------------------------------
268
269 //------------------------------------------------------------------------------------------------
272 {
273 m_FactionFlagMaterial = materialResource;
274 }
275
276 //------------------------------------------------------------------------------------------------
282
283 //------------------------------------------------------------------------------------------------
289
290 //------------------------------------------------------------------------------------------------
293 {
294 return Color.FromInt(m_NotificationFactionColor.PackToInt());
295 }
296
297 //------------------------------------------------------------------------------------------------
300 {
301 return Color.FromInt(m_NotificationTextFactionColor.PackToInt());
302 }
303
304 //------------------------------------------------------------------------------------------------
308 return Color.FromInt(m_OutlineFactionColor.PackToInt());
309 }
310
311 //------------------------------------------------------------------------------------------------
313 // Called everywhere, used to generate initial data for this faction
315 {
316 }
317
318 //------------------------------------------------------------------------------------------------
320 void SetAncestors(notnull array<string> ancestors)
321 {
322 m_aAncestors = {};
323 m_aAncestors.Copy(ancestors);
324 }
325
326 //------------------------------------------------------------------------------------------------
328 Check if the faction is playable.
329 Non-playable factions will not appear in the respawn menu.
330 \return True when playable
331 */
332
333 //------------------------------------------------------------------------------------------------
334 //! \return
336 {
337 return m_bIsPlayable;
338 }
339
340 //------------------------------------------------------------------------------------------------
342 {
343 return m_bCanCaptureBases;
344 }
345
346 //------------------------------------------------------------------------------------------------
348 {
350 }
351
352 //------------------------------------------------------------------------------------------------
357 //------------------------------------------------------------------------------------------------
364
365 //------------------------------------------------------------------------------------------------
368 Called on Init (if server) and on server join (is Client)
369 \param isPlayable Bool to set is playable
370 */
371
372 //------------------------------------------------------------------------------------------------
375 void InitFactionIsPlayable(bool isPlayable)
376 {
377 if (m_iPlayerLimit == 0)
378 m_bIsPlayable = false;
379 else
380 m_bIsPlayable = isPlayable;
381 }
382
383 //------------------------------------------------------------------------------------------------
387 {
388 return m_bTasksEnabled;
389 }
390
391 //------------------------------------------------------------------------------------------------
393 void SetTasksEnabled(bool isTasksEnabled)
394 {
395 m_bTasksEnabled = isTasksEnabled;
396 }
397
398 //------------------------------------------------------------------------------------------------
401 \param factionKey Ancestor faction key
402 \return True when inherited
403 */
404
405 //------------------------------------------------------------------------------------------------
408 bool IsInherited(string factionKey)
409 {
410 return m_aAncestors && m_aAncestors.Contains(factionKey);
411 }
412
413 //------------------------------------------------------------------------------------------------
418 \param isPlayable Bool to set is playable
419 \param killPlayersIfNotPlayable Bool kills all players if on server if faction is set isplayable false
420 */
421
422 //------------------------------------------------------------------------------------------------
425 void SetIsPlayable(bool isPlayable, bool killPlayersIfNotPlayable = false)
426 {
427 if (m_iPlayerLimit == 0 && isPlayable)
428 return;
429
430 if (m_bIsPlayable == isPlayable)
431 return;
432
433 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
434 if (!factionManager || !factionManager.CanChangeFactionsPlayable())
435 return;
436
437 m_bIsPlayable = isPlayable;
440
441 //Kill players if m_bIsPlayable is false, killPlayersIfNotPlayable is true, of the same faction and is server
442 if (!m_bIsPlayable && killPlayersIfNotPlayable && Replication.IsServer())
443 {
444 array<int> playerList = {};
445 GetGame().GetPlayerManager().GetPlayers(playerList);
446
448 IEntity playerEntity;
449
450 foreach (int playerId : playerList)
451 {
452 Faction playerFaction = factionManager.GetPlayerFaction(playerId);
453 if (!playerFaction)
454 continue;
455
456 //Check if has the same faction as the one disabled
457 if (playerFaction.GetFactionKey() != GetFactionKey())
458 continue;
459
460 //Do not kill GMs
461 if (core)
462 {
463 SCR_EditorManagerEntity editorManager = core.GetEditorManager(playerId);
464 if (editorManager)
465 {
466 if (!editorManager.IsLimited())
467 continue;
468 }
469 }
470
471 playerEntity = SCR_PossessingManagerComponent.GetPlayerMainEntity(playerId);
472 if (!playerEntity)
473 continue;
474
476 if (damageManager)
477 damageManager.SetHealthScaled(0);
478 }
479 }
480 }
481
482 //------------------------------------------------------------------------------------------------
483 /*!
484 Get On Playable Changed Script Invoker
485 \return ScriptInvoker_FactionPlayableChanged OnFactionPlayableChanged
486 */
487
488 //------------------------------------------------------------------------------------------------
498 //======================================== FACTION RELATIONS ========================================\\
499
500 //------------------------------------------------------------------------------------------------
501
504 override bool DoCheckIfFactionFriendly(Faction faction)
505 {
506 return m_FriendlyFactions.Contains(faction);
508
509 //------------------------------------------------------------------------------------------------
514 void SetFactionFriendly(notnull Faction faction)
515 {
516 m_FriendlyFactions.Insert(faction);
518
519 //------------------------------------------------------------------------------------------------
524 void SetFactionHostile(notnull Faction faction)
525 {
526 int index = m_FriendlyFactions.Find(faction);
527
528 if (index >= 0)
530 }
531
532 //------------------------------------------------------------------------------------------------
533 bool IsRelatedFaction(notnull Faction otherFaction)
534 {
535 if (this == otherFaction || m_ParentFaction == otherFaction)
536 return true;
537
538 SCR_Faction scrOtherFaction = SCR_Faction.Cast(otherFaction);
539 if (scrOtherFaction && scrOtherFaction.GetParent() == this)
540 return true;
541
542 return false;
543 }
544
545 //------------------------------------------------------------------------------------------------
547 {
548 if (m_ParentFaction)
549 return m_ParentFaction;
550
551 return null;
552 }
553
554 //------------------------------------------------------------------------------------------------
558
559 //------------------------------------------------------------------------------------------------
562 {
563 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
564 if (!factionManager)
565 return -1;
566
567 return factionManager.GetFactionPlayerCount(this);
568 /*SCR_RespawnSystemComponent respawnSystem = SCR_RespawnSystemComponent.GetInstance();
569 if (!respawnSystem)
570 return -1;
571
572 array<int> players = {};
573 int playerCount = 0;
574
575 PlayerManager pm = GetGame().GetPlayerManager();
576 pm.GetPlayers(players);
577
578 foreach (int playerId : players)
579 {
580 Faction playerFaction = respawnSystem.GetPlayerFaction(playerId);
581 if (playerFaction == this)
582 playerCount++;
583 }
584
585 return playerCount;*/
586 }
587
588 //------------------------------------------------------------------------------------------------
589 /*
590 Get a list of all players beloning to the faction
591 \param[out] player ids List of players belonging to the faction
592 \return Number of players in faction
593 */
594
595 //------------------------------------------------------------------------------------------------
598 int GetPlayersInFaction(notnull out array<int> players)
599 {
600 players.Clear();
601
602 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
603 if (!factionManager)
604 return -1;
605
606 array<int> allPlayers = {};
607 GetGame().GetPlayerManager().GetPlayers(allPlayers);
608
609 foreach (int playerId : allPlayers)
610 {
611 Faction playerFaction = factionManager.GetPlayerFaction(playerId);
612 if (playerFaction == this)
613 players.Insert(playerId);
615
616 return players.Count();
617 }
618
619 //------------------------------------------------------------------------------------------------
625
626 //------------------------------------------------------------------------------------------------
632
633 //======================================== FACTION ENTITY CATALOG ========================================\\
634
635 //------------------------------------------------------------------------------------------------
640 \return Catalog. Can be null if not found. Note that Only one catalog of each type can be in the list
641 */
642
643 //------------------------------------------------------------------------------------------------
648 {
650 {
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!");
652 return null;
653 }
654
655 //~ Get catalog
656 SCR_EntityCatalog entityCatalog = m_mEntityCatalogs.Get(catalogType);
657
658 if (entityCatalog)
659 return entityCatalog;
660
661 //~ No data found
662 if (printNotFound)
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);
664
665 return null;
666 }
667
668 //------------------------------------------------------------------------------------------------
672 \param[out] List of all catalogs within the faction
673 \return List size
674 */
675
676 //------------------------------------------------------------------------------------------------
679 int GetAllFactionEntityCatalogs(notnull out array<SCR_EntityCatalog> outEntityCatalogs)
680 {
681 outEntityCatalogs.Clear();
682 foreach (SCR_EntityCatalog entityCatalog: m_mEntityCatalogs)
683 {
684 outEntityCatalogs.Insert(entityCatalog);
685 }
686
687 return outEntityCatalogs.Count();
688 }
689
690 //------------------------------------------------------------------------------------------------
694 int GetFriendlyFactions(notnull out array<Faction> friendlyFactions, bool includeSelf = true)
695 {
696 friendlyFactions.Clear();
697
698 foreach (Faction faction : m_FriendlyFactions)
699 {
700 if (!faction)
701 continue;
702
703 if (this == faction)
704 {
705 if (!includeSelf)
706 continue;
707
708 friendlyFactions.InsertAt(faction, 0);
709 }
710 else
711 {
712 friendlyFactions.Insert(faction);
714 }
715
716 return friendlyFactions.Count();
717 }
718
719 //------------------------------------------------------------------------------------------------
720 override void Init(IEntity owner)
721 {
722 super.Init(owner);
723
724 if (SCR_Global.IsEditMode())
725 return;
726
727 //~ Init the catalog for faster processing
728 SCR_EntityCatalogManagerComponent.InitCatalogs(m_aEntityCatalogs, m_mEntityCatalogs);
729 m_bCatalogInitDone = true;
730
731 //~ Clear array as no longer needed
733
735 }
736
737 //------------------------------------------------------------------------------------------------
740 {
741 // Parental faction relations are hardset into the game and are not intended to be changed, so we do them here to avoid doing unnecessary networking calls
742 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
743 if (factionManager)
744 {
745 Faction parent = factionManager.GetFactionByKey(m_sParentFactionId);
746
747 if (parent)
748 m_ParentFaction = parent;
749 }
750
751 //~ Server only
753 if ((gameMode && gameMode.IsMaster()) || (!gameMode && Replication.IsServer()))
754 {
755 //~ Set faction friendly
756 if (!factionManager)
757 {
758 //~ Still make sure faction is friendly towards itself
760 SetFactionFriendly(this);
761
762 Print("'SCR_Faction' is trying to set friendly factions but no SCR_FactionManager could be found!", LogLevel.ERROR);
763 }
764 else
765 {
766 //~ Make sure faction is friendly towards itself
768 factionManager.SetFactionsFriendly(this, this);
769
771 {
772 SCR_Faction renegadeFaction = SCR_Faction.Cast(factionManager.GetFactionByKey("RNGD"));
773 if (renegadeFaction)
774 factionManager.SetFactionFriendlyOneWay(renegadeFaction, this);
775 }
776
777 //~ On init friendly factions assigning
778 if (!m_aFriendlyFactionsIds.IsEmpty())
779 {
780 SCR_Faction faction;
781
782 //~ Set each given faction ID as friendly
783 foreach (string factionId : m_aFriendlyFactionsIds)
784 {
785 faction = SCR_Faction.Cast(factionManager.GetFactionByKey(factionId));
786
787 if (!faction)
788 {
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);
790 continue;
791 }
792
793 //~ Don't set self as friendly
794 if (faction == this)
795 continue;
796
797 //~ Assign as friendly
798 factionManager.SetFactionsFriendly(this, faction);
799 }
800 }
801 }
802
803 }
804 }
805
806 //------------------------------------------------------------------------------------------------
810 static Faction GetEntityFaction(notnull IEntity entity)
811 {
812 FactionAffiliationComponent factionComp = FactionAffiliationComponent.Cast(entity.FindComponent(FactionAffiliationComponent));
813 if (!factionComp)
814 return null;
815
816 Faction faction = factionComp.GetAffiliatedFaction();
817 if (!faction)
818 faction = factionComp.GetDefaultAffiliatedFaction();
819
820 return faction;
821 }
822
823 //------------------------------------------------------------------------------------------------
826 {
828 }
829
830 //------------------------------------------------------------------------------------------------
833 {
834 array<int> indexes = {};
835
836 foreach (SCR_MilitaryBaseCallsign callsign : m_aBaseCallsigns)
837 {
838 indexes.Insert(callsign.GetSignalIndex());
839 }
840
841 return indexes;
842 }
843
844 //------------------------------------------------------------------------------------------------
848 SCR_MilitaryBaseCallsign GetBaseCallsignByIndex(int index, int offset = 0)
849 {
850 index += offset;
851
852 if (m_aBaseCallsigns.IsIndexValid(index))
853 return m_aBaseCallsigns[index];
854
855 int count = m_aBaseCallsigns.Count();
856 if (count < 1)
857 return null;
858
859 index = Math.Repeat(index, count);
860
861 if (m_aBaseCallsigns.IsIndexValid(index))
863
864 return null;
865 }
866
867 //------------------------------------------------------------------------------------------------
868 //! \return
873
874 //------------------------------------------------------------------------------------------------
876 {
877 return m_bIsMilitary;
878 }
879
880 //------------------------------------------------------------------------------------------------
881 bool IsPlayerCommander(int playerId)
882 {
883 return m_iCommanderId == playerId;
884 }
885
886 //------------------------------------------------------------------------------------------------
888 {
890 }
891
892 //------------------------------------------------------------------------------------------------
893 void SetCommanderId(int playerId)
894 {
895 m_iCommanderId = playerId;
896 }
897
898 //------------------------------------------------------------------------------------------------
900 {
901 return m_iCommanderId;
902 }
903
904 //------------------------------------------------------------------------------------------------
909
910 //------------------------------------------------------------------------------------------------
912 {
913 return m_iPlayerLimit;
914 }
915
916 //------------------------------------------------------------------------------------------------
917 void SetPlayerLimit(int playerLimit)
918 {
919 m_iPlayerLimit = playerLimit;
920 }
921
922 //------------------------------------------------------------------------------------------------
923 array<FactionKey> GetDefaultFriendlyFactions()
924 {
925 array<FactionKey> result();
926 result.Reserve(m_aFriendlyFactionsIds.Count());
927 foreach (auto key : m_aFriendlyFactionsIds)
928 {
929 result.Insert(key);
930 }
931
932 return result;
933 }
934
935 //------------------------------------------------------------------------------------------------
937 {
938 return m_bFriendlyToSelf;
939 }
940
941 //------------------------------------------------------------------------------------------------
943 {
945 }
946
947 //------------------------------------------------------------------------------------------------
948 bool DoRplSave(ScriptBitWriter writer)
950 writer.WriteBool(IsTasksEnabled());
951 writer.WriteInt(GetPlayerLimit());
952 return true;
953 }
954
955 //------------------------------------------------------------------------------------------------
957 {
958 bool isTasksEnabled;
959 reader.ReadBool(isTasksEnabled);
960
961 SetTasksEnabled(isTasksEnabled);
962
963 int playerLimit;
964 reader.ReadInt(playerLimit);
965
966 SetPlayerLimit(playerLimit);
967 return true;
968 }
969}
970
972class SCR_MilitaryBaseCallsign
973{
974 [Attribute("", UIWidgets.EditBox)]
975 protected string m_sCallsign;
976
977 [Attribute("", UIWidgets.EditBox)]
978 protected string m_sCallsignShort;
979
980 [Attribute("", UIWidgets.EditBox)]
981 protected string m_sCallsignUpperCase;
982
983 [Attribute("0", UIWidgets.EditBox)]
984 protected int m_iSignalIndex;
985
986 //------------------------------------------------------------------------------------------------
988 string GetCallsign()
989 {
990 return m_sCallsign;
991 }
992
993 //------------------------------------------------------------------------------------------------
995 string GetCallsignShort()
996 {
997 return m_sCallsignShort;
998 }
999
1000 //------------------------------------------------------------------------------------------------
1002 string GetCallsignUpperCase()
1003 {
1004 return m_sCallsignUpperCase;
1005 }
1006
1007 //------------------------------------------------------------------------------------------------
1009 int GetSignalIndex()
1010 {
1011 return m_iSignalIndex;
1012 }
1013}
1014
1017{
1018 // No override will be applied, "normal behaviour" will show playable factions and hide non playable ones
1020 // Always show the faction
1022 // Never show the faction in the menu
1024}
EEditableEntityLabel
EEntityCatalogType
ArmaReforgerScripted GetGame()
Definition game.c:1398
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
Definition SCR_Faction.c:93
ref Color m_OutlineFactionColor
Definition SCR_Faction.c:7
ScriptInvokerBase< ScriptInvoker_FactionPlayableChangedMethod > ScriptInvoker_FactionPlayableChanged
Definition SCR_Faction.c:3
ResourceName m_sGroupFlagsImageSetOutlines
Definition SCR_Faction.c:90
SCR_Faction ScriptedFaction BaseContainerProps()
func ScriptInvoker_FactionPlayableChangedMethod
Definition SCR_Faction.c:2
SCR_Faction ScriptedFaction SCR_BaseContainerCustomTitleField("m_sCallsign")
ref array< ref SCR_GroupPreset > m_aPredefinedGroups
Definition SCR_Faction.c:60
EOverrideWelcomeScreenFactionDisplay
@ ALWAYSSHOW
@ NEVERSHOW
bool m_bIsPlayable
Definition SCR_Faction.c:16
ref array< ref SCR_MilitaryBaseCallsign > m_aBaseCallsigns
ref array< ref SCR_EntityCatalog > m_aEntityCatalogs
Definition SCR_Faction.c:81
bool m_bIsPlayableDefault
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_LoadoutManager(IEntitySource src, IEntity parent)
int GetCallsign()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
FactionKey GetFactionKey()
Definition Color.c:13
Definition Debug.c:13
proto external Managed FindComponent(typename typeName)
Definition Math.c:13
Main replication API.
Definition Replication.c:14
sealed bool IsMaster()
Core component to manage SCR_EditorManagerEntity.
SCR_EditorManagerEntity GetEditorManager()
bool IsDefaultSelfFriendly()
void SetFactionFriendly(notnull Faction faction)
ResourceName m_sFactionBackground
ref array< string > m_aFriendlyFactionsIds
Definition SCR_Faction.c:55
void SetFactionFlagMaterial(ResourceName materialResource)
SCR_EGroupRole m_eDefaultGroupRoleForNewGroup
Definition SCR_Faction.c:70
SCR_FactionHomeTerritoryConfig GetFactionHomeTerritoryConfig()
int GetAllFactionEntityCatalogs(notnull out array< SCR_EntityCatalog > outEntityCatalogs)
bool GetCanCreateOnlyPredefinedGroups()
Faction GetParent()
bool m_bCatalogInitDone
SCR_EntityCatalog GetFactionEntityCatalogOfType(EEntityCatalogType catalogType, bool printNotFound=true)
bool IsDefaultPlayable()
ResourceName m_sCommanderMenuEntries
ref SCR_FactionHomeTerritoryConfig m_FactionHomeTerritoryConfig
bool m_bIsCustomLoadoutSupported
ResourceName GetGroupFlagImageSet()
bool IsRenegadePunishedExile()
ref array< ResourceName > m_aGroupFlags
Definition SCR_Faction.c:91
SCR_FactionCallsignInfo GetCallsignInfo()
bool m_bCanCaptureBases
Definition SCR_Faction.c:29
int GetPlayersInFaction(notnull out array< int > players)
int GetFactionRadioFrequency()
ref ScriptInvoker_FactionPlayableChanged m_OnFactionPlayableChanged
Definition SCR_Faction.c:82
ref set< Faction > m_FriendlyFactions
ResourceName m_FactionFlagMaterial
Definition SCR_Faction.c:43
bool m_bExileRenegadePunishment
Definition SCR_Faction.c:31
ref array< ref SCR_GroupRolePresetConfig > m_aGroupRolePresetConfigs
Definition SCR_Faction.c:64
void SetFactionHostile(notnull Faction faction)
SCR_MilitaryBaseCallsign GetBaseCallsignByIndex(int index, int offset=0)
ref Color m_NotificationFactionColor
Definition SCR_Faction.c:17
SCR_RankContainer GetRanks()
bool DoRplLoad(ScriptBitReader reader)
Color GetNotificationTextFactionColor()
EOverrideWelcomeScreenFactionDisplay ShowInWelcomeScreenOverride()
int m_iPlayerLimit
Definition SCR_Faction.c:11
bool m_bIsCommanderAvailable
Definition SCR_Faction.c:26
Color GetNotificationFactionColor()
ResourceName m_sGroupFlagsImageSet
Definition SCR_Faction.c:94
int m_iFactionRadioFrequency
Definition SCR_Faction.c:79
int GetPlayerLimit()
Color GetOutlineFactionColor()
bool m_bTasksEnabled
Definition SCR_Faction.c:37
ref array< string > m_aAncestors
Definition SCR_Faction.c:81
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.
bool m_bFriendlyToSelf
Definition SCR_Faction.c:52
ResourceName GetFlagName(int index)
bool IsTasksEnabled()
override void Init(IEntity owner)
void GetGroupRolePresetConfigs(notnull array< SCR_GroupRolePresetConfig > groupArray)
static const int AI_COMMANDER_ID
ResourceName GetFactionFlag()
bool IsAICommander()
ResourceName GetFactionFlagMaterial()
bool m_bIsMilitary
Definition SCR_Faction.c:34
bool m_bIsPlayableDefault
bool IsCustomLoadoutSupported()
bool CanCaptureBases()
ref Color m_OutlineFactionColor
Definition SCR_Faction.c:14
bool IsMilitary()
bool IsEnabledAutoGroupCreationWhenFull()
static Faction GetEntityFaction(notnull IEntity entity)
ref array< ref SCR_EntityCatalog > m_aEntityCatalogs
Definition SCR_Faction.c:88
bool DoRplSave(ScriptBitWriter writer)
ResourceName m_sGroupFlagsImageSetOutlines
Definition SCR_Faction.c:97
ref array< ref SCR_MilitaryBaseCallsign > m_aBaseCallsigns
int GetGroupFlagTextures(out array< ResourceName > textures)
void SetPlayerLimit(int playerLimit)
void InitializeFaction()
int GetCommanderId()
int m_iIdentityVoiceSignal
bool m_bIsPlayable
Definition SCR_Faction.c:23
EEditableEntityLabel m_FactionLabel
Definition SCR_Faction.c:46
bool m_bEnableAutoGroupCreationWhenFull
Definition SCR_Faction.c:76
ref array< ref SCR_GroupPreset > m_aPredefinedGroups
Definition SCR_Faction.c:67
ref map< EEntityCatalogType, ref SCR_EntityCatalog > m_mEntityCatalogs
int GetIndentityVoiceSignal()
ref Color m_NotificationTextFactionColor
Definition SCR_Faction.c:20
bool IsCommanderAvailable()
SCR_EGroupRole GetDefaultGroupRoleForNewGroup()
int GetFlagNames(out array< string > flagNames)
ResourceName GetFactionBackground()
bool IsPlayerCommander(int playerId)
bool IsInherited(string factionKey)
Faction m_ParentFaction
ScriptInvoker_FactionPlayableChanged GetOnFactionPlayableChanged()
ResourceName GetGroupFlagImageSetOutlines()
bool m_bCreateOnlyPredefinedGroups
Definition SCR_Faction.c:73
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
Definition SCR_Faction.c:61
ref SCR_RankContainer m_FactionRankInfo
Definition SCR_Faction.c:85
ref array< string > m_aFlagNames
bool IsPlayable()
void SetAncestors(notnull array< string > ancestors)
string m_sParentFactionId
Definition SCR_Faction.c:58
array< FactionKey > GetDefaultFriendlyFactions()
array< int > GetBaseCallsignIndexes()
EOverrideWelcomeScreenFactionDisplay m_eShowInWelcomeScreenOverride
Definition SCR_Faction.c:49
bool IsRelatedFaction(notnull Faction otherFaction)
int GetPlayerCount()
int GetFriendlyFactions(notnull out array< Faction > friendlyFactions, bool includeSelf=true)
static bool IsEditMode()
Definition Functions.c:1566
Definition Types.c:486
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
@ NONE
When Shape is created and not initialized yet.
Definition ShapeType.c:15
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.