Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionSetFuelConsumption.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Target entity to manipulate fuel consumption (Optional if action is attached on Slot that spawns target entity)")]
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute(defvalue: "20", desc: "Fuel consumption at max power RPM\n[liters/hour]", params: "0 inf")]
8 float m_fFuelConsumption;
9
10 [Attribute(defvalue: "0.5", desc: "Fuel consumption idle\n[liters/hour]", params: "0 inf")]
11 float m_fFuelConsumptionIdle;
12
13 //------------------------------------------------------------------------------------------------
14 override void OnActivate(IEntity object)
15 {
16 if (!CanActivate())
17 return;
18
19 IEntity entity;
20 if (!ValidateInputEntity(object, m_Getter, entity))
21 return;
22
23 SCR_FuelConsumptionComponent fuelConsumptionComponent = SCR_FuelConsumptionComponent.Cast(entity.FindComponent(SCR_FuelConsumptionComponent));
24 if (!fuelConsumptionComponent)
25 {
26 if (object)
27 Print(string.Format("ScenarioFramework Action: No Fuel Consumption Component found for Action %1 attached on %2.", this, object.GetName()), LogLevel.ERROR);
28 else
29 Print(string.Format("ScenarioFramework Action: No Fuel Consumption Components found for Action %1.", this), LogLevel.ERROR);
30
31 return;
32 }
33
34 SCR_FuelConsumptionComponentClass componentData = SCR_FuelConsumptionComponentClass.Cast(fuelConsumptionComponent.GetComponentData(entity));
35 if (!componentData)
36 return;
37
38 componentData.m_fFuelConsumption = m_fFuelConsumption;
39 componentData.m_fFuelConsumptionIdle = m_fFuelConsumptionIdle;
40 }
41}
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)
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