16 [
Attribute(
desc:
"Faction which is used for area control calculation. Leave empty for any faction.",
category:
"Trigger")]
17 protected FactionKey m_sOwnerFactionKey;
19 [
Attribute(
"0", UIWidgets.ComboBox,
"By whom the trigger is activated",
"", ParamEnumArray.FromEnum(TA_EActivationPresence),
category:
"Trigger")]
20 protected TA_EActivationPresence m_eActivationPresence;
27 protected Faction m_OwnerFaction;
28 protected int m_iEntitiesInside = 0;
31 void SetOwnerFaction(
Faction faction)
39 RplComponent comp = RplComponent.Cast(FindComponent(RplComponent));
40 return comp && comp.IsMaster();
44 protected int GetPlayersCountByFaction()
47 array<int> aPlayerIDs = {};
49 GetGame().GetPlayerManager().GetPlayers(aPlayerIDs);
50 foreach (
int iPlayerID: aPlayerIDs)
53 if (!playerController)
56 if (playerController.GetLocalControlledEntityFaction() ==
m_OwnerFaction)
63 protected void GetPlayersByFaction(notnull out array<IEntity> aOut)
65 array<int> aPlayerIDs = {};
67 GetGame().GetPlayerManager().GetPlayers(aPlayerIDs);
68 foreach (
int iPlayerID: aPlayerIDs)
71 if (!playerController)
74 if (playerController.GetLocalControlledEntityFaction() ==
m_OwnerFaction)
75 aOut.Insert(playerController.GetLocalMainEntity());
81 override bool ScriptedEntityFilterForQuery(IEntity ent)
83 if (!ChimeraCharacter.Cast(ent))
95 FactionAffiliationComponent pFaciliation = FactionAffiliationComponent.Cast(ent.FindComponent(FactionAffiliationComponent));
103 override protected event void OnActivate(IEntity ent)
116 override protected event void OnDeactivate(IEntity ent)
123 override protected void EOnInit(IEntity owner)
125 FactionManager factionManager =
GetGame().GetFactionManager();