DIFF

class CarScript

CarScript › Car › Transport › Pawn › EntityAI › Entity › ObjectTyped › Object › IEntity › Managed

Base script class for cars

Constructors 1

Constants 12

static const string MEMORY_POINT_NAME_CAR_HORN = "pos_carHorn"
private const float BATTERY_UPDATE_DELAY = 100
Referenced by OnUpdate()
static const int SELECTION_ID_FRONT_LIGHT_L = 0
Referenced by CarScript()
static const int SELECTION_ID_FRONT_LIGHT_R = 1
Referenced by CarScript()
static const int SELECTION_ID_BRAKE_LIGHT_L = 2
Referenced by CarScript()
static const int SELECTION_ID_BRAKE_LIGHT_R = 3
Referenced by CarScript()
static const int SELECTION_ID_REVERSE_LIGHT_L = 4
Referenced by CarScript()
static const int SELECTION_ID_REVERSE_LIGHT_R = 5
Referenced by CarScript()
static const int SELECTION_ID_TAIL_LIGHT_L = 6
static const int SELECTION_ID_TAIL_LIGHT_R = 7
static const int SELECTION_ID_DASHBOARD_LIGHT = 8
Referenced by CarScript()
private const int DEBUG_MESSAGE_CLEAN_TIME_SECONDS = 10DIAG_DEVELOPER
Referenced by EOnPostSimulate()

Members 82

static ref map<typename, ref TInputActionMap> m_CarTypeActionsMap = new map<typename, ref TInputActionMap>
Referenced by InitializeActions()
TInputActionMap m_InputActionMap
Referenced by AddAction(), GetActions(), InitializeActions()
Show 1 more, RemoveAction()
bool m_ActionsInitialize
Referenced by AddAction(), and GetActions()
protected float m_Time
Referenced by CarScript(), EOnPostSimulate(), ObtainState()
Show 1 more, RewindState()
static float DROWN_ENGINE_THRESHOLD = 0.5
Referenced by OnUpdate()
static float DROWN_ENGINE_DAMAGE = 350.0
Referenced by OnUpdate()
protected float m_FuelAmmount

keeps ammount of each fluid

Referenced by OnFluidChanged()
protected float m_CoolantAmmount
Referenced by OnFluidChanged()
protected float m_OilAmmount
Referenced by OnFluidChanged()
protected float m_BrakeAmmount
Referenced by OnFluidChanged()
protected float m_EnviroHeatComfortOverride
Referenced by CarScript()
protected float m_DrownTime
Referenced by OnUpdate()
static vector m_DrownEnginePos
protected float m_EngineHealth
Referenced by CarScript(), EOnPostSimulate(), LeakFluid()
Show 1 more, PartsHealthCheck()
protected float m_RadiatorHealth
protected float m_FuelTankHealth
Referenced by CarScript(), EOnPostSimulate(), LeakFluid()
Show 1 more, PartsHealthCheck()
protected float m_BatteryHealth
protected float m_PlugHealth
protected EntityAI m_Radiator
Referenced by EEItemAttached(), EEItemDetached(), GetRadiator()
Show 1 more, HasRadiator()
protected float m_BatteryConsume = 15

Battery energy consumption upon engine start

protected float m_BatteryContinuousConsume = 0.25

Battery consumption with lights on and engine is off

protected float m_BatteryRecharge = 0.15

Battery recharge rate when engine is on

private float m_BatteryTimer = 0

Used to factor energy consumption / recharging

Referenced by OnUpdate(), and UpdateBattery()
protected vector m_exhaustPtcDir

Particles

Referenced by InitializeParticles()
protected vector m_enginePos
protected vector m_frontPos
protected vector m_backPos
protected vector m_side_1_1Pos
protected vector m_side_1_2Pos
protected vector m_side_2_1Pos
protected vector m_side_2_2Pos
string m_CarSeatShiftInSound = ""
string m_CarSeatShiftOutSound = ""
ref EffectSound m_WindowSmall
ref EffectSound m_WindowLarge
private ref EffectSound m_PreStartSound
Referenced by HandleEngineSound()
static string m_ReverseLightPoint = "light_reverse"
Referenced by UpdateLightsClient()
static string m_LeftHeadlightPoint = "light_left"
Referenced by UpdateLightsClient()
static string m_RightHeadlightPoint = "light_right"
Referenced by UpdateLightsClient()
static string m_LeftHeadlightTargetPoint = "light_left_dir"
Referenced by UpdateLightsClient()
static string m_RightHeadlightTargetPoint = "light_right_dir"
Referenced by UpdateLightsClient()
static string m_DrownEnginePoint = "drown_engine"
protected int m_CarEngineSoundState
protected int m_CarEngineLastSoundState
protected ref VehicleVFXComponent m_VFXComponent
private float m_DebugMessageCleanTimeDIAG_DEVELOPER
Referenced by EOnPostSimulate()
private string m_DebugContactDamageMessageDIAG_DEVELOPER
Referenced by OnAction(), and OnInput()
Referenced by OnInput()
ref Param8<float, float, float, float, float, float, float, float> m_DebugParams = new Param8<float, float, float, float, float, float, float, float>(0,0,0,0,0,0,0,0)DIAG_DEVELOPER
Referenced by OnInput()
CarLightBase m_Headlight

DEPRECATED

Referenced by CleanupEffects()
protected ref EffectSound m_CarHornSoundEffect
Referenced by CleanupEffects()
protected ref NoiseParams m_NoisePar
protected NoiseSystem m_NoiseSystem
protected float m_BatteryEnergyStartMin = 5.0
protected bool m_HeadlightsOn
protected bool m_BrakesArePressed

not yet actually removed, but functionality will be moved to native to prevent requiring updating of lights every game tick

protected ref EffVehicleSmoke m_coolantFx

old particles

protected ref EffVehicleSmoke m_engineFx
protected ref EffVehicleSmoke m_exhaustFx
protected ref array<ref EffWheelSmoke> m_WheelSmokeFx
protected ref array<int> m_WheelSmokePtcFx
protected int m_enginePtcFx
Referenced by CarScript()
protected int m_coolantPtcFx
Referenced by CarScript()
protected int m_exhaustPtcFx
Referenced by CarScript()
protected vector m_exhaustPtcPos
Referenced by InitializeParticles()
protected vector m_coolantPtcPos

Methods 143

override string GetVehicleType()

obsolete handling (since 1.30) - kept for backward compatibility

override VehicleHornComponent GetVehicleHornComponent()
References m_HornComponent
vector GetEnginePosWS()
vector GetCoolantPtcPosWS()
vector GetEnginePointPosWS()
vector GetFrontPointPosWS()
vector GetBackPointPosWS()
vector Get_1_1PointPosWS()
vector Get_1_2PointPosWS()
vector Get_2_1PointPosWS()
vector Get_2_2PointPosWS()
override float GetLiquidThroughputCoef()
void CleanupSound(EffectSound sound)

backward compatibility

Referenced by CleanupEffects()
override int GetFluidCapacityScript(ETransportFluid fluidType)
override float GetFluidFractionScript(ETransportFluid fluidType)
override void FillScript(ETransportFluid fluidType, float amount)
References Car.Fill()
override protected void PlayCrashLightSound()
override protected void PlayCrashHeavySound()
bool HasGangedTailAndBrakeLights()
Referenced by UpdateLightsServer()
override void OnAttachmentRuined(EntityAI attachment)
protected bool CanManipulateSpareWheel(string slotSelectionName)
void OnBrakesPressed()

leaking of coolant from radiator when damaged

References UpdateLights()
Referenced by OnUpdate()
void OnBrakesReleased()
References UpdateLights()
Referenced by OnUpdate()
override void OnDriverExit(Human player)
override void EEKilled(Object killer)
override float OnSound(CarSoundCtrl ctrl, float oldValue)

Gets called every sound simulation step. In this callback, user can modify behaviour of sound controllers The higher the return value is the more muted sound is.

override void OnAnimationPhaseStarted(string animSource, float phase)
protected void HandleCarHornSound(ECarHornState pState)
void SetCarEngineSoundState(CarEngineSoundState pState)
override void MarkCrewMemberUnconscious(int crewMemberIndex)

postpone the engine sound played from c++ on soundcontroller (via OnSound override)

override void MarkCrewMemberDead(int crewMemberIndex)
override void OnFluidChanged(CarFluid fluid, float newValue, float oldValue)

Gets called everytime when the specified vehicle's fluid changes its current value eg. when vehicle is consuming fuel.

This callback is called on server.

References m_BrakeAmmount, m_CoolantAmmount, m_FuelAmmount
Show 1 more, m_OilAmmount
override bool OnBeforeEngineStart()

Gets called everytime the game wants to start the engine.

Returns: true if the engine can start, false otherwise.

void OnIgnition()
bool CheckOperationalState()
override void OnGearChanged(int newGear, int oldGear)
References UpdateLights()
override bool OnBeforeLightOn()
protected void LeakFluid(CarFluid fluid)
Referenced by EOnPostSimulate()
string GetDoorConditionPointFromSelection(string selection)
int GetCrewIndex(string selection)
override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance = 1.0)
bool IsVitalEngineBelt()

skip the height for now

bool IsVitalRadiator()
bool HasRadiator()
References m_Radiator
EntityAI GetRadiator()
References m_Radiator
override bool IsMoving()
bool IsHandbrakeActive()
override int Get3rdPersonCameraType()

camera type

void SetEngineStarted(bool started)
string GetActionCompNameCoolant()
float GetActionDistanceCoolant()
string GetActionCompNameOil()
float GetActionDistanceOil()
string GetActionCompNameBrakes()
float GetActionDistanceBrakes()
void InitializeActions()
Referenced by GetActions()
override void GetActions(typename action_input_type, out array<ActionBase_Basic> actions)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void EEOnCECreate()
float GetBatteryConsumption()
References m_BatteryConsume
float GetBatteryRuntimeConsumption()
Referenced by UpdateBattery()
float GetBatteryRechargeRate()
Referenced by UpdateBattery()
void SetCarHornState(int pState)
override vector GetDefaultHitPosition()

old usage (pre 1.30)

References vector.Zero
float GetPushForceCoefficientMultiplier()
protected override event typename GetOwnerStateType()
protected override event typename GetMoveType()
protected override event void ObtainState(PawnOwnerState pState)
References Class.Cast(), and m_Time
protected override event void RewindState(PawnOwnerState pState, PawnMove pMove, inout NetworkRewindType pRewindType)
References Class.Cast(), and m_Time
bool OnBeforeSwitchLights(bool toOn)

DEPRECATED Gets called everytime the game wants to switch the lights.

Returns: true when lights can be switched, false otherwise.

float GetEnviroHeatComfortOverride()
void ForceUpdateLightsStart()
void ForceUpdateLightsEnd()
bool IsVitalCarBattery()
bool IsVitalTruckBattery()
bool IsScriptedLightsOn()
protected void BrakeAndReverseRearLight()
protected void NoRearLight()
protected void LeftFrontLightShineOn()
protected void RightFrontLightShineOn()
protected void LeftFrontLightShineOff()
protected void RightFrontLightShineOff()
protected void ReverseLightsShineOn()
protected void ReverseLightsShineOff()
protected void BrakeLightsShineOn()
protected void BrakeLightsShineOff()
protected void TailLightsShineOff()
protected void DashboardShineOn()
protected void DashboardShineOff()
protected CarRearLightBase CreateRearLight()
protected CarLightBase CreateFrontLight()
protected void CheckVitalItem(bool isVital, int slotId)
protected void CheckVitalItem(bool isVital, string slot_name)
protected void CarPartsHealthCheck()