Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkPluginTrigger.c
Go to the documentation of this file.
3{
4 [Attribute(defvalue: "5.0", params: "0 inf", desc: "Radius of the trigger if selected", category: "Trigger")]
5 float m_fAreaRadius;
6
7 [Attribute("0", UIWidgets.ComboBox, "By whom the trigger is activated", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkTriggerActivation), category: "Trigger Activation")]
8 SCR_EScenarioFrameworkTriggerActivation m_eActivationPresence;
9
10 [Attribute(desc: "Fill the entity names here for detection. Is combined with other filters using OR.", category: "Trigger")]
11 ref array<string> m_aSpecificEntityNames;
12
13 [Attribute(desc: "If SPECIFIC_CLASS is selected, fill the class name here.", category: "Trigger")]
14 ref array<string> m_aSpecificClassNames;
15
16 [Attribute(desc: "Which Prefabs and if their children will be detected by the trigger. Is combined with other filters using OR.", category: "Trigger")]
17 ref array<ref SCR_ScenarioFrameworkPrefabFilter> m_aPrefabFilter;
18
19 [Attribute("", category: "Trigger Activation")]
20 FactionKey m_sActivatedByThisFaction;
21
22 [Attribute(desc: "Here you can input custom trigger conditions that you can create by extending the SCR_CustomTriggerConditions", uiwidget: UIWidgets.Object)]
23 ref array<ref SCR_ScenarioFrameworkActivationConditionBase> m_aCustomTriggerConditions;
24
25 [Attribute(defvalue: SCR_EScenarioFrameworkLogicOperators.AND.ToString(), UIWidgets.ComboBox, "Which Boolean Logic will be used for Custom Trigger Conditions.", "", enums: SCR_EScenarioFrameworkLogicOperatorHelper.GetParamInfo(), category: "Trigger")]
26 SCR_EScenarioFrameworkLogicOperators m_eCustomTriggerConditionLogic;
27
28 [Attribute(defvalue: "1", UIWidgets.CheckBox, desc: "If you set some vehicle to be detected by the trigger, it will also search the inventory for vehicle prefabs/classes that are set", category: "Trigger")]
29 bool m_bSearchVehicleInventory;
30
31 [Attribute(defvalue: "1", UIWidgets.CheckBox, desc: "Activate the trigger once or everytime the activation condition is true?", category: "Trigger")]
32 bool m_bOnce;
33
34 [Attribute(defvalue: "0", desc: "Activate the trigger once it is empty", category: "Trigger")]
35 bool m_bActivateOnEmpty;
36
37 [Attribute(defvalue: "1", UIWidgets.Slider, desc: "How frequently is the trigger updated and performing calculations. Lower numbers will decrease performance.", params: "0 86400 1", category: "Trigger")]
38 float m_fUpdateRate;
39
40 [Attribute(defvalue: "0", UIWidgets.Slider, desc: "Minimum players needed to activate this trigger when PLAYER Activation presence is selected", params: "0 1 0.01", precision: 2, category: "Trigger")]
41 float m_fMinimumPlayersNeededPercentage;
42
43 [Attribute(defvalue: "0", UIWidgets.Slider, desc: "For how long the trigger conditions must be true in order for the trigger to activate. If conditions become false, timer resets", params: "0 86400 1", category: "Trigger")]
44 float m_fActivationCountdownTimer;
45
46 [Attribute(defvalue: "0", UIWidgets.CheckBox, desc: "Whether or not the notification is allowed to be displayed", category: "Trigger")]
47 bool m_bNotificationEnabled;
48
49 [Attribute(desc: "Notification title text that will be displayed when the PLAYER Activation presence is selected", category: "Trigger")]
50 string m_sPlayerActivationNotificationTitle;
51
52 [Attribute(defvalue: "0", UIWidgets.CheckBox, desc: "Whether or not the audio sound is played and affected by the trigger", category: "Trigger")]
53 bool m_bEnableAudio;
54
55 [Attribute(desc: "Audio sound that will be playing when countdown is active.", category: "Trigger")]
56 string m_sCountdownAudio;
57
58 [Attribute(desc: "Actions that will be activated when entity that went through the filter entered the trigger and is inside (Be carefull as Framework Triggers activate this periodically if you don't disable the Once attribute)", category: "Trigger")]
59 ref array<ref SCR_ScenarioFrameworkActionBase> m_aEntityEnteredActions;
60
61 [Attribute(desc: "Actions that will be activated when entity that went through the filter left the trigger", category: "Trigger")]
62 ref array<ref SCR_ScenarioFrameworkActionBase> m_aEntityLeftActions;
63
64 [Attribute(desc: "Actions that will be activated when all conditions are met and Trigger finishes", category: "Trigger")]
65 ref array<ref SCR_ScenarioFrameworkActionBase> m_aFinishedActions;
66
67 //------------------------------------------------------------------------------------------------
70 override void Init(SCR_ScenarioFrameworkLayerBase object)
71 {
72 if (!object)
73 return;
74
75 super.Init(object);
77 IEntity entity = object.GetSpawnedEntity();
78
80 if (area)
81 {
82 trigger = SCR_ScenarioFrameworkTriggerEntity.Cast(area.GetTrigger());
83 }
84 else
85 {
86 if (!BaseGameTriggerEntity.Cast(entity))
87 {
88 Print("ScenarioFramework: SlotTrigger - The selected prefab is not trigger!", LogLevel.ERROR);
89 return;
90 }
91 trigger = SCR_ScenarioFrameworkTriggerEntity.Cast(entity);
92 }
93
94 // Resolve Alias
95 SCR_FactionAliasComponent factionAliasComponent = SCR_FactionAliasComponent.Cast(GetGame().GetFactionManager().FindComponent(SCR_FactionAliasComponent));
96 if (factionAliasComponent)
97 m_sActivatedByThisFaction = factionAliasComponent.ResolveFactionAlias(m_sActivatedByThisFaction);
98
99 if (trigger)
100 {
101 trigger.SetSphereRadius(m_fAreaRadius);
102 trigger.SetActivationPresence(m_eActivationPresence);
103 trigger.SetOwnerFaction(m_sActivatedByThisFaction);
104 trigger.SetSpecificClassName(m_aSpecificClassNames);
105 trigger.AddSpecificEntityNameFilter(m_aSpecificEntityNames);
106 trigger.SetPrefabFilters(m_aPrefabFilter);
107 trigger.SetCustomTriggerConditions(m_aCustomTriggerConditions);
108 trigger.SetCustomTriggerConditionLogic(m_eCustomTriggerConditionLogic);
109 trigger.SetSearchVehicleInventory(m_bSearchVehicleInventory);
110 trigger.SetOnce(m_bOnce);
111 trigger.SetActivateOnEmpty(m_bActivateOnEmpty);
112 trigger.SetUpdateRate(m_fUpdateRate);
113 trigger.SetNotificationEnabled(m_bNotificationEnabled);
114 trigger.SetEnableAudio(m_bEnableAudio);
115 trigger.SetMinimumPlayersNeeded(m_fMinimumPlayersNeededPercentage);
116 trigger.SetPlayerActivationNotificationTitle(m_sPlayerActivationNotificationTitle);
117 trigger.SetActivationCountdownTimer(m_fActivationCountdownTimer);
118 trigger.SetCountdownAudio(m_sCountdownAudio);
119 trigger.SetEntityEnteredActions(m_aEntityEnteredActions);
120 trigger.SetEntityLefActions(m_aEntityLeftActions);
121 trigger.SetFinishedActions(m_aFinishedActions);
122
123 return;
124 }
125
127 if (factionTrigger)
128 {
129 factionTrigger.SetSphereRadius(m_fAreaRadius);
130 FactionManager factionManager = GetGame().GetFactionManager();
131 if (factionManager)
132 factionTrigger.AddOwnerFaction(m_sActivatedByThisFaction);
133 }
134 }
135
136 //------------------------------------------------------------------------------------------------
138 override void OnWBKeyChanged(SCR_ScenarioFrameworkLayerBase object)
139 {
140 super.OnWBKeyChanged(object);
141 object.SetDebugShapeSize(m_fAreaRadius);
142 //src.Set("m_sAreaName", m_fAreaRadius);
143 }
144
145 //------------------------------------------------------------------------------------------------
146 override array<ref SCR_ScenarioFrameworkActionBase> GetActions()
147 {
148 array<ref SCR_ScenarioFrameworkActionBase> combinedActions = {};
149
150 foreach (SCR_ScenarioFrameworkActionBase action : m_aEntityEnteredActions)
151 {
152 combinedActions.Insert(action);
153 }
154
155 foreach (SCR_ScenarioFrameworkActionBase action : m_aEntityLeftActions)
156 {
157 combinedActions.Insert(action);
158 }
159
160 foreach (SCR_ScenarioFrameworkActionBase action : m_aFinishedActions)
161 {
162 combinedActions.Insert(action);
163 }
164
165 return combinedActions;
166 }
167}
override void Init()
ArmaReforgerScripted GetGame()
Definition game.c:1398
params precision
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_BaseFactionTriggerEntity(IEntitySource src, IEntity parent)
array< ref SCR_MenuActionPreset > GetActions()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
void SetSpecificClassName(notnull array< string > aClassName)
Sets specific classnames to be searched in the trigger.
void AddSpecificEntityNameFilter(notnull array< string > aEntityName)
Adds specific entity name to be searched in the trigger.
void SetCountdownAudio(string sAudioName)
Sets which audio can be played from activating this trigger.
void SetFinishedActions(array< ref SCR_ScenarioFrameworkActionBase > finishedActions)
void SetOnce(bool bOnce)
Sets if trigger can be finished just once.
void SetPlayerActivationNotificationTitle(string sTitle)
Sets HUD activation notification title.
void SetEntityEnteredActions(array< ref SCR_ScenarioFrameworkActionBase > entityEnteredActions)
void SetOwnerFaction(FactionKey sFaction)
Sets faction that "owns" this trigger.
void SetEntityLefActions(array< ref SCR_ScenarioFrameworkActionBase > entityLefActions)
void SetPrefabFilters(notnull array< ref SCR_ScenarioFrameworkPrefabFilter > aPrefabFilter)
Sets specific prefab filters to be searched in the trigger.
void SetActivationPresence(SCR_EScenarioFrameworkTriggerActivation EActivationPresence)
Sets Activation Presence.
void SetMinimumPlayersNeeded(float minimumPlayersNeededPercentage)
Sets minimum player percentage needed to finish this trigger.
void SetCustomTriggerConditionLogic(SCR_EScenarioFrameworkLogicOperators customTriggerConditionLogic)
Sets Custom Trigger Condition Logic.
void SetEnableAudio(bool enableAudio)
Sets if audio features from this trigger are enabled.
void SetCustomTriggerConditions(notnull array< ref SCR_ScenarioFrameworkActivationConditionBase > triggerConditions)
void SetSearchVehicleInventory(bool search)
Sets if trigger should also search vehicle inventory when looking for prefabs/classnames inside.
void SetActivationCountdownTimer(float activationCountdownTimer)
Sets activation coundown timer.
void SetNotificationEnabled(bool notificationEnabled)
Sets if HUD notifications are enabled.
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
SCR_FieldOfViewSettings Attribute