Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetVehicleLights.c
Go to the documentation of this file.
1 class SCR_AISetVehicleLights : AITaskScripted
2 {
3  protected IEntity m_vehicleEnt;
4 
5  [Attribute("0", UIWidgets.ComboBox, "Light Type: ", "", ParamEnumArray.FromEnum(ELightType) )]
6  protected ELightType m_eLightType;
7 
8  [Attribute("0", UIWidgets.CheckBox, "Enabled: ")]
9  protected bool m_bEnabled;
10 
11  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
12  {
13  if (!GetVariableIn("VehicleIn", m_vehicleEnt))
14  return ENodeResult.FAIL;
15 
16  bool bEnabled;
17  if (!GetVariableIn("EnabledIn", bEnabled))
18  bEnabled = m_bEnabled;
19 
20  Vehicle vehicle = Vehicle.Cast(m_vehicleEnt);
21  if (!vehicle)
22  return ENodeResult.FAIL;
23 
24  BaseLightManagerComponent vehicleLightManagerComp = BaseLightManagerComponent.Cast(vehicle.FindComponent(BaseLightManagerComponent));
25  if (!vehicleLightManagerComp)
26  return ENodeResult.FAIL;
27 
28  vehicleLightManagerComp.SetLightsState(m_eLightType, bEnabled);
29 
30  return ENodeResult.SUCCESS;
31  }
32 
33  protected static ref TStringArray s_aVarsIn = {
34  "VehicleIn", "EnabledIn"
35  };
36  override TStringArray GetVariablesIn()
37  {
38  return s_aVarsIn;
39  }
40 
41  override bool VisibleInPalette()
42  {
43  return true;
44  }
45 
46  override string GetOnHoverDescription()
47  {
48  return "Toggles the state of lights in a vehicle";
49  }
50 };
ELightType
ELightType
Definition: ELightType.c:7
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_AISetVehicleLights
Definition: SCR_AISetVehicleLights.c:1
m_bEnabled
private bool m_bEnabled
Definition: SCR_BaseManualCameraComponent.c:3