Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionSetEntityFaction.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity that faction will be set to.")]
5 ref SCR_ScenarioFrameworkGet m_EntityGetter;
6
7 [Attribute(desc: "Faction key")]
8 string m_sFactionKey;
9 //------------------------------------------------------------------------------------------------
10 override void OnActivate(IEntity object)
11 {
12 if (!CanActivate())
13 return;
14
15 IEntity entity;
16 if (!ValidateInputEntity(object, m_EntityGetter, entity))
17 return;
18
19 FactionAffiliationComponent factionComponent = FactionAffiliationComponent.Cast(entity.FindComponent(FactionAffiliationComponent));
20 if (!factionComponent)
21 {
22 if (object)
23 PrintFormat("ScenarioFramework Action: Faction component not found for Action %1 attached on %2.", this, object.GetName(), level: LogLevel.ERROR);
24 else
25 PrintFormat("ScenarioFramework Action: Faction component not found for Action %1.", this, level: LogLevel.ERROR);
26
27 return;
28 }
29
30 // Resolve Alias
31 SCR_FactionAliasComponent factionAliasComponent = SCR_FactionAliasComponent.Cast(GetGame().GetFactionManager().FindComponent(SCR_FactionAliasComponent));
32 if (factionAliasComponent)
33 m_sFactionKey = factionAliasComponent.ResolveFactionAlias(m_sFactionKey);
34
35 factionComponent.SetAffiliatedFactionByKey(m_sFactionKey);
36 }
37}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute