Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseFactionTriggerEntity.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Triggers", description: "")]
3 {
4 };
5 class SCR_BaseFactionTriggerEntity: SCR_BaseTriggerEntity
6 {
7  [Attribute(desc: "Faction which is used for area control calculation.", category: "Faction Trigger")]
8  protected FactionKey m_sOwnerFactionKey;
9 
10  protected Faction m_OwnerFaction;
11 
16  void SetOwnerFaction(Faction faction)
17  {
18  m_OwnerFaction = faction;
19  }
20 
21  override bool ScriptedEntityFilterForQuery(IEntity ent)
22  {
23  if (!m_OwnerFaction || !IsAlive(ent))
24  return false;
25 
26  FactionAffiliationComponent factionAffiliation = FactionAffiliationComponent.Cast(ent.FindComponent(FactionAffiliationComponent));
27  return factionAffiliation && factionAffiliation.GetAffiliatedFaction() == m_OwnerFaction;
28  }
29  override protected void EOnInit(IEntity owner)
30  {
31  FactionManager factionManager = GetGame().GetFactionManager();
32  if (factionManager)
33  m_OwnerFaction = factionManager.GetFactionByKey(m_sOwnerFactionKey);
34  }
35  void SCR_BaseFactionTriggerEntity(IEntitySource src, IEntity parent)
36  {
37  SetEventMask(EntityEvent.INIT);
38  }
39 };
m_OwnerFaction
protected Faction m_OwnerFaction
Definition: SCR_CharacterTriggerEntity.c:64
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
SCR_BaseFactionTriggerEntity
Definition: SCR_BaseFactionTriggerEntity.c:5
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
IsAlive
bool IsAlive()
Definition: SpectateTargetComponent.c:23
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_BaseFactionTriggerEntityClass
Definition: SCR_BaseFactionTriggerEntity.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
Faction
Definition: Faction.c:12
SCR_BaseTriggerEntityClass
Definition: SCR_BaseTriggerEntity.c:2
m_sOwnerFactionKey
protected FactionKey m_sOwnerFactionKey
Definition: SCR_CharacterTriggerEntity.c:17
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180