Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkVehicleActionResourceUnloadAction.c
Go to the documentation of this file.
3{
4 [Attribute(defvalue: "0", desc: "Resource Type", uiwidget: UIWidgets.ComboBox, enumType: EResourceType)]
5 EResourceType m_eResourceType;
6
7 [Attribute(defvalue: "0", desc: "Resources To Unload", params: "0 inf 0.01")]
8 float m_fResourcesToUnload;
9
10 //------------------------------------------------------------------------------------------------
13 override void Init(Vehicle vehicle)
14 {
15 // Here you can step out to the OnActivate method and debug this specific action if m_bDebug attribute is set to true.
16 // This can be also adjusted during runtime via Debug Menu > ScenarioFramework > Action Inspector
17 if (m_bDebug)
18 Print("[SCR_ScenarioFrameworkVehicleActionBase.Init] debug line (" + __FILE__ + " L" + __LINE__ + ")", LogLevel.WARNING);
19
20 SCR_ResourceComponent resourceComp = SCR_ResourceComponent.Cast(vehicle.FindComponent(SCR_ResourceComponent));
21 if (!resourceComp)
22 return;
23
24 SCR_ResourceGenerator resourceGen = resourceComp.GetGenerator(EResourceGeneratorID.VEHICLE_UNLOAD, m_eResourceType);
25 if (!resourceGen)
26 return;
27
28 SCR_ResourceConsumer resourceCon = resourceComp.GetConsumer(EResourceGeneratorID.VEHICLE_UNLOAD, m_eResourceType);
29 if (!resourceCon)
30 return;
31
32 float resourcesToUnload = m_fResourcesToUnload;
33 SCR_ResourceConsumtionResponse response = resourceCon.RequestConsumtion(resourcesToUnload);
34 if (response.GetReason() != EResourceReason.SUFFICIENT)
35 resourcesToUnload = response.GetAvailableSupply();
36
38 if (action)
39 action.PerformAction(resourceGen, resourcesToUnload);
40 }
41}
override void Init()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_ResourceConsumtionResponse(float availableResource=0, float resourceMultiplier=0, float range=0, EResourceReason reasonCode=EResourceReason.UNAVAILABLE)
EResourceGeneratorID
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
override void PerformAction(notnull SCR_ResourceGenerator generator, inout float resourceValue)
enum EPhysicsLayerPresets Vehicle
Definition gameLib.c:24
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