DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл CarScript.c

См. исходные тексты.

Перечисления

enum  CarDoorState { DOORS_MISSING , DOORS_OPEN , DOORS_CLOSED }
 

Функции

void CarScript ()
 
override void EEInit ()
 
override string GetVehicleType ()
 
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 ()
 
override void EEHitBy (TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
 
override void EEDelete (EntityAI parent)
 
void ~CarScript ()
 
void CleanupEffects ()
 
void CleanupSound (EffectSound sound)
 
override void GetDebugActions (out TSelectableActionInfoArrayEx outputList)
 
override bool OnAction (int action_id, Man player, ParamsReadContext ctx)
 
override void OnVariablesSynchronized ()
 
void CreateCarDestroyedEffect ()
 
override void EEItemAttached (EntityAI item, string slot_name)
 
void UpdateHeadlightState ()
 
override void EEItemDetached (EntityAI item, string slot_name)
 
override void OnAttachmentRuined (EntityAI attachment)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanReleaseAttachment (EntityAI attachment)
 
bool CanManipulateSpareWheel (string slotSelectionName)
 
override void EOnPostSimulate (IEntity other, float timeSlice)
 
void OnBrakesPressed ()
 
void OnBrakesReleased ()
 
void OnVehicleJumpOutServer (GetOutTransportActionData gotActionData)
 
override void OnUpdate (float dt)
 
override void EEKilled (Object killer)
 
override void OnContact (string zoneName, vector localPos, IEntity other, Contact data)
 WARNING: Can be called very frequently in one frame, use with caution.
 
void CheckContactCache ()
 Responsible for damaging the car according to contact events from OnContact.
 
void DamageCrew (float dmg)
 Responsible for damaging crew in a car crash.
 
override float OnSound (CarSoundCtrl ctrl, float oldValue)
 
override void OnAnimationPhaseStarted (string animSource, float phase)
 
void HandleDoorsSound (string animSource, float phase)
 
void HandleSeatAdjustmentSound (string animSource, float phase)
 
void HandleCarHornSound (ECarHornState pState)
 
void HandleEngineSound (CarEngineSoundState state)
 
override void HandleByCrewMemberState (ECrewMemberState state)
 
float GetEnviroHeatComfortOverride ()
 DEPRECATED

 
override void OnFluidChanged (CarFluid fluid, float newValue, float oldValue)
 
override bool OnBeforeEngineStart ()
 
override void OnGearChanged (int newGear, int oldGear)
 
override void OnEngineStart ()
 Gets called everytime the engine starts.
 
override void OnEngineStop ()
 Gets called everytime the engine stops.
 
bool OnBeforeSwitchLights (bool toOn)
 
bool IsScriptedLightsOn ()
 Propper way to get if light is swiched on. Use instead of IsLightsOn().
 
void ToggleHeadlights ()
 Switches headlights on/off, including the illumination of the control panel and synchronizes this change to all clients.
 
void UpdateLights (int new_gear=-1)
 
void UpdateLightsClient (int newGear=-1)
 
void UpdateLightsServer (int newGear=-1)
 
void BrakesRearLight ()
 
void ReverseRearLight ()
 
void BrakeAndReverseRearLight ()
 
void NoRearLight ()
 
void LeftFrontLightShineOn ()
 
void RightFrontLightShineOn ()
 
void LeftFrontLightShineOff ()
 
void RightFrontLightShineOff ()
 
void ReverseLightsShineOn ()
 
void ReverseLightsShineOff ()
 
void BrakeLightsShineOn ()
 
void BrakeLightsShineOff ()
 
void TailLightsShineOn ()
 
void TailLightsShineOff ()
 
void DashboardShineOn ()
 
void DashboardShineOff ()
 
CarRearLightBase CreateRearLight ()
 
CarLightBase CreateFrontLight ()
 
void CheckVitalItem (bool isVital, string itemName)
 
void LeakFluid (CarFluid fluid)
 
void CarPartsHealthCheck ()
 
bool GetCrashLightSound ()
 
void SynchCrashLightSound (bool play)
 
void PlayCrashLightSound ()
 
bool GetCrashHeavySound ()
 
void SynchCrashHeavySound (bool play)
 
void PlayCrashHeavySound ()
 
void PlaySoundEx (string soundset, EffectSound sound, out bool soundbool)
 
void PlaySound (string soundset, ref EffectSound sound, out bool soundbool)
 
string GetAnimSourceFromSelection (string selection)
 
string GetDoorConditionPointFromSelection (string selection)
 
string GetDoorSelectionNameFromSeatPos (int posIdx)
 
string GetDoorInvSlotNameFromSeatPos (int posIdx)
 
int GetCrewIndex (string selection)
 
override bool CanReachSeatFromDoors (string pSeatSelection, vector pFromPos, float pDistance=1.0)
 
bool IsVitalCarBattery ()
 
bool IsVitalTruckBattery ()
 
bool IsVitalGlowPlug ()
 
bool IsVitalEngineBelt ()
 
bool IsVitalRadiator ()
 
bool IsVitalFuelTank ()
 
bool HasRadiator ()
 
EntityAI GetRadiator ()
 
bool IsMoving ()
 
bool IsHandbrakeActive ()
 
override int Get3rdPersonCameraType ()
 camera type
 
void SetEngineStarted (bool started)
 
int GetCarDoorsState (string slotType)
 
CarDoorState TranslateAnimationPhaseToCarDoorState (string animation)
 
string GetActionCompNameCoolant ()
 
float GetActionDistanceCoolant ()
 
string GetActionCompNameOil ()
 
float GetActionDistanceOil ()
 
string GetActionCompNameBrakes ()
 
float GetActionDistanceBrakes ()
 
override bool CanPutIntoHands (EntityAI parent)
 
void InitializeActions ()
 
override void GetActions (typename action_input_type, out array< ActionBase_Basic > actions)
 
void SetActions ()
 
void AddAction (typename actionName)
 
void RemoveAction (typename actionName)
 
override bool IsInventoryVisible ()
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
override void EEOnCECreate ()
 
void ForceUpdateLightsStart ()
 
void ForceUpdateLightsEnd ()
 
float GetBatteryConsumption ()
 
float GetBatteryRuntimeConsumption ()
 
float GetBatteryRechargeRate ()
 
ItemBase GetBattery ()
 
void SetCarHornState (int pState)
 
void SetCarEngineSoundState (CarEngineSoundState pState)
 
void GenerateCarHornAINoise (int pState)
 
override vector GetDefaultHitPosition ()
 
float GetPushForceCoefficientMultiplier ()
 
void SpawnUniversalParts ()
 
void SpawnAdditionalItems ()
 
void FillUpCarFluids ()
 

Переменные

enum CarDoorState NONE
 
enum CarDoorState LEFT
 
enum CarDoorState RIGHT
 
enum CarDoorState BRAKES_ONLY
 
enum CarDoorState REVERSE_ONLY
 
enum CarDoorState STARTING
 
enum CarDoorState START_OK
 
enum CarDoorState START_NO_FUEL
 
enum CarDoorState START_NO_BATTERY
 
enum CarDoorState START_NO_SPARKPLUG
 
enum CarDoorState STOP_OK
 
enum CarDoorState OFF = 0
 
enum CarDoorState SHORT = 1
 
enum CarDoorState LONG
 
enum CarDoorState typename
 
enum CarDoorState m_CarTypeActionsMap = new map<typename, ref TInputActionMap>
 
TInputActionMap m_InputActionMap
 
bool m_ActionsInitialize
 
float m_MomentumPrevTick
 
vector m_VelocityPrevTick
 
ref CarContactCache m_ContactCache
 
float m_Time
 
static float DROWN_ENGINE_THRESHOLD = 0.5
 
static float DROWN_ENGINE_DAMAGE = 350.0
 
static const string MEMORY_POINT_NAME_CAR_HORN = "pos_carHorn"
 
float m_FuelAmmount
 keeps ammount of each fluid
 
float m_CoolantAmmount
 
float m_OilAmmount
 
float m_BrakeAmmount
 
float m_dmgContactCoef = 0.058
 
float m_EnviroHeatComfortOverride
 
float m_DrownTime
 
static vector m_DrownEnginePos
 
float m_EngineHealth
 
float m_RadiatorHealth
 
float m_FuelTankHealth
 
float m_BatteryHealth
 
float m_PlugHealth
 
EntityAI m_Radiator
 
float m_BatteryConsume = 15
 
float m_BatteryContinuousConsume = 0.25
 
float m_BatteryRecharge = 0.15
 
float m_BatteryTimer = 0
 
const float BATTERY_UPDATE_DELAY = 100
 
float m_BatteryEnergyStartMin = 5.0
 
ref EffVehicleSmoke m_coolantFx
 Particles.
 
ref EffVehicleSmoke m_engineFx
 
ref EffVehicleSmoke m_exhaustFx
 
int m_enginePtcFx
 
int m_coolantPtcFx
 
int m_exhaustPtcFx
 
vector m_exhaustPtcPos
 
vector m_exhaustPtcDir
 
vector m_enginePtcPos
 
vector m_coolantPtcPos
 
vector m_enginePos
 
vector m_frontPos
 
vector m_backPos
 
vector m_side_1_1Pos
 
vector m_side_1_2Pos
 
vector m_side_2_1Pos
 
vector m_side_2_2Pos
 
string m_EngineStartOK = ""
 Sounds.
 
string m_EngineStartBattery = ""
 
string m_EngineStartPlug = ""
 
string m_EngineStartFuel = ""
 
string m_EngineStopFuel = ""
 
string m_CarDoorOpenSound = ""
 
string m_CarDoorCloseSound = ""
 
string m_CarSeatShiftInSound = ""
 
string m_CarSeatShiftOutSound = ""
 
string m_CarHornShortSoundName = ""
 
string m_CarHornLongSoundName = ""
 
ref EffectSound m_CrashSoundLight
 
ref EffectSound m_CrashSoundHeavy
 
ref EffectSound m_WindowSmall
 
ref EffectSound m_WindowLarge
 
ref EffectSound m_PreStartSound
 
ref EffectSound m_CarHornSoundEffect
 
ref NoiseParams m_NoisePar
 
NoiseSystem m_NoiseSystem
 
bool m_PlayCrashSoundLight
 
bool m_PlayCrashSoundHeavy
 
bool m_HeadlightsOn
 
bool m_HeadlightsState
 
bool m_BrakesArePressed
 
bool m_RearLightType
 
bool m_ForceUpdateLights
 
bool m_EngineStarted
 
bool m_EngineDestroyed
 
int m_CarHornState
 
int m_CarEngineSoundState
 
int m_CarEngineLastSoundState
 
CarLightBase m_Headlight
 
CarRearLightBase m_RearLight
 
static string m_ReverseLightPoint = "light_reverse"
 
static string m_LeftHeadlightPoint = "light_left"
 
static string m_RightHeadlightPoint = "light_right"
 
static string m_LeftHeadlightTargetPoint = "light_left_dir"
 
static string m_RightHeadlightTargetPoint = "light_right_dir"
 
static string m_DrownEnginePoint = "drown_engine"
 
static const int SELECTION_ID_FRONT_LIGHT_L = 0
 
static const int SELECTION_ID_FRONT_LIGHT_R = 1
 
static const int SELECTION_ID_BRAKE_LIGHT_L = 2
 
static const int SELECTION_ID_BRAKE_LIGHT_R = 3
 
static const int SELECTION_ID_REVERSE_LIGHT_L = 4
 
static const int SELECTION_ID_REVERSE_LIGHT_R = 5
 
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
 
ref array< ref EffWheelSmokem_WheelSmokeFx
 
ref array< intm_WheelSmokePtcFx
 

Перечисления

◆ CarDoorState

Элементы перечислений
DOORS_MISSING 
DOORS_OPEN 
DOORS_CLOSED 
2{
6}
@ DOORS_CLOSED
Definition CarScript.c:5
@ DOORS_MISSING
Definition CarScript.c:3
@ DOORS_OPEN
Definition CarScript.c:4

Функции

◆ AddAction()

void AddAction ( typename actionName )
protected
2556 {
2557 ActionBase action = ActionManagerBase.GetAction(actionName);
2558
2559 if (!action)
2560 {
2561 Debug.LogError("Action " + actionName + " dosn't exist!");
2562 return;
2563 }
2564
2565 typename ai = action.GetInputType();
2566 if (!ai)
2567 {
2568 m_ActionsInitialize = false;
2569 return;
2570 }
2572
2573 if (!action_array)
2574 {
2577 }
2578
2580 {
2581 Debug.ActionLog(action.ToString() + " -> " + ai, this.ToString() , "n/a", "Add action" );
2582 }
2583 action_array.Insert(action);
2584 }
TInputActionMap m_InputActionMap
Definition CarScript.c:140
bool m_ActionsInitialize
Definition CarScript.c:141
Definition ActionBase.c:53
Definition Debug.c:14
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:141
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:259
Definition Debug.c:600
static bool IsActionLogEnable()
Definition Debug.c:644
Definition EntityAI.c:95

Перекрестные ссылки Debug::ActionLog(), LogManager::IsActionLogEnable(), Debug::LogError(), m_ActionsInitialize и m_InputActionMap.

◆ BrakeAndReverseRearLight()

void BrakeAndReverseRearLight ( )
protected
2058 {
2059 m_RearLight.AggregateLight();
2060 m_RearLight.SetFadeOutTime(1);
2061 }
CarRearLightBase m_RearLight
Definition CarScript.c:248

Перекрестные ссылки m_RearLight.

Используется в UpdateLightsClient().

◆ BrakeLightsShineOff()

void BrakeLightsShineOff ( )
protected
2143 {
2144 string material = ConfigGetString("brakeReflectorMatOff");
2145
2146 if (material)
2147 {
2148 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_L, material);
2149 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_R, material);
2150 }
2151 }
static const int SELECTION_ID_BRAKE_LIGHT_R
Definition CarScript.c:263
static const int SELECTION_ID_BRAKE_LIGHT_L
Definition CarScript.c:262

Перекрестные ссылки SELECTION_ID_BRAKE_LIGHT_L и SELECTION_ID_BRAKE_LIGHT_R.

Используется в UpdateLightsServer().

◆ BrakeLightsShineOn()

void BrakeLightsShineOn ( )
protected
2132 {
2133 string material = ConfigGetString("brakeReflectorMatOn");
2134
2135 if (material)
2136 {
2137 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_L, material);
2138 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_R, material);
2139 }
2140 }

Перекрестные ссылки SELECTION_ID_BRAKE_LIGHT_L и SELECTION_ID_BRAKE_LIGHT_R.

Используется в UpdateLightsServer().

◆ BrakesRearLight()

void BrakesRearLight ( )
protected
2048 {
2049 m_RearLight.SetAsSegregatedBrakeLight();
2050 }

Перекрестные ссылки m_RearLight.

Используется в UpdateLightsClient().

◆ CanManipulateSpareWheel()

bool CanManipulateSpareWheel ( string slotSelectionName)
protected
858 {
859 return false;
860 }

◆ CanPutIntoHands()

override bool CanPutIntoHands ( EntityAI parent)
protected
2517 {
2518 return false;
2519 }

◆ CanReachSeatFromDoors()

override bool CanReachSeatFromDoors ( string pSeatSelection,
vector pFromPos,
float pDistance = 1.0 )
protected

skip the height for now

2384 {
2386 if (conPointName.Length() > 0)
2387 {
2388 if ( MemoryPointExists(conPointName) )
2389 {
2390 vector conPointMS = GetMemoryPointPos(conPointName);
2391 vector conPointWS = ModelToWorld(conPointMS);
2392
2394 conPointWS[1] = 0;
2395 pFromPos[1] = 0;
2396
2398 {
2399 return true;
2400 }
2401 }
2402 }
2403
2404 return false;
2405 }
string GetDoorConditionPointFromSelection(string selection)
Definition CarScript.c:2347
Definition EnConvert.c:106
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

Перекрестные ссылки vector::Distance() и CarScript::GetDoorConditionPointFromSelection().

◆ CanReceiveAttachment()

override bool CanReceiveAttachment ( EntityAI attachment,
int slotId )
protected
797 {
798 if (!super.CanReceiveAttachment(attachment, slotId))
799 return false;
800
802 attachment.GetInventory().GetCurrentInventoryLocation(attachmentInventoryLocation);
803 if (attachmentInventoryLocation.GetParent() == null)
804 {
805 return true;
806 }
807
808 if (attachment && attachment.Type().IsInherited(CarWheel))
809 {
810 string slotSelectionName;
812
813 switch (slotSelectionName)
814 {
815 case "wheel_spare_1":
816 case "wheel_spare_2":
818 break;
819 }
820 }
821
822 return true;
823 }
bool CanManipulateSpareWheel(string slotSelectionName)
Definition CarScript.c:857
Definition InventoryItem.c:413
InventoryLocation.
Definition InventoryLocation.c:29
provides access to slot configuration
Definition InventorySlots.c:6
static proto bool GetSelectionForSlotId(int slot_Id, out string selection)

Перекрестные ссылки CarScript::CanManipulateSpareWheel() и InventorySlots::GetSelectionForSlotId().

◆ CanReleaseAttachment()

override bool CanReleaseAttachment ( EntityAI attachment)
protected
826 {
827 if (!super.CanReleaseAttachment(attachment))
828 {
829 return false;
830 }
831
832 if (EngineIsOn() && IsMoving())
833 {
834 return false;
835 }
836
837 if (attachment && attachment.Type().IsInherited(CarWheel))
838 {
840 attachment.GetInventory().GetCurrentInventoryLocation(attachmentInventoryLocation);
841
842 string slotSelectionName;
844
845 switch (slotSelectionName)
846 {
847 case "wheel_spare_1":
848 case "wheel_spare_2":
850 break;
851 }
852 }
853
854 return true;
855 }
bool IsMoving()
Definition CarScript.c:2447

Перекрестные ссылки CarScript::CanManipulateSpareWheel(), InventorySlots::GetSelectionForSlotId() и IsMoving().

◆ CarPartsHealthCheck()

void CarPartsHealthCheck ( )
protected
2258 {
2259 if (GetGame().IsServer())
2260 {
2261 if (HasRadiator())
2262 {
2263 m_RadiatorHealth = GetRadiator().GetHealth01("", "");
2264 }
2265 else
2266 {
2267 m_RadiatorHealth = 0;
2268 }
2269
2270 m_EngineHealth = GetHealth01("Engine", "");
2271 m_FuelTankHealth = GetHealth01("FuelTank", "");
2272 }
2273 }
float m_FuelTankHealth
Definition CarScript.c:171
float m_EngineHealth
Definition CarScript.c:169
bool HasRadiator()
Definition CarScript.c:2437
EntityAI GetRadiator()
Definition CarScript.c:2442
float m_RadiatorHealth
Definition CarScript.c:170
proto native CGame GetGame()

Перекрестные ссылки GetGame(), GetRadiator(), HasRadiator(), m_EngineHealth, m_FuelTankHealth и m_RadiatorHealth.

Используется в EOnPostSimulate().

◆ CarScript()

void CarScript ( )
protected
281 {
282#ifdef DEVELOPER
283 _car = this;
284#endif
285
286 SetEventMask(EntityEvent.POSTSIMULATE);
287 SetEventMask(EntityEvent.POSTFRAME);
288
290
291 m_Time = 0;
292 // sets max health for all components at init
293 m_EngineHealth = 1;
295 m_RadiatorHealth = -1;
296 m_BatteryHealth = -1;
297 m_PlugHealth = -1;
298
299 m_enginePtcFx = -1;
300 m_coolantPtcFx = -1;
301 m_exhaustPtcFx = -1;
302
304
305 m_PlayCrashSoundLight = false;
306 m_PlayCrashSoundHeavy = false;
307
310
311 RegisterNetSyncVariableBool("m_HeadlightsOn");
312 RegisterNetSyncVariableBool("m_BrakesArePressed");
313 RegisterNetSyncVariableBool("m_ForceUpdateLights");
314 RegisterNetSyncVariableBoolSignal("m_PlayCrashSoundLight");
315 RegisterNetSyncVariableBoolSignal("m_PlayCrashSoundHeavy");
316 RegisterNetSyncVariableInt("m_CarHornState", ECarHornState.OFF, ECarHornState.LONG);
317 RegisterNetSyncVariableInt("m_CarEngineSoundState", CarEngineSoundState.NONE, CarEngineSoundState.STOP_NO_FUEL);
318
319 if ( MemoryPointExists("ptcExhaust_end") )
320 {
321 m_exhaustPtcPos = GetMemoryPointPos("ptcExhaust_end");
322 if ( MemoryPointExists("ptcExhaust_start") )
323 {
324 vector exhaustStart = GetMemoryPointPos("ptcExhaust_start");
326
327 m_exhaustPtcDir[0] = -tempOri[2];
328 m_exhaustPtcDir[1] = tempOri[1];
329 m_exhaustPtcDir[2] = tempOri[0];
330
331 m_exhaustPtcDir = m_exhaustPtcDir.Normalized().VectorToAngles();
332 }
333 }
334 else
335 {
336 m_exhaustPtcPos = "0 0 0";
337 m_exhaustPtcDir = "1 1 1";
338 }
339
340 if ( MemoryPointExists("ptcEnginePos") )
341 m_enginePtcPos = GetMemoryPointPos("ptcEnginePos");
342 else
343 m_enginePtcPos = "0 0 0";
344
345 if ( MemoryPointExists("ptcCoolantPos") )
346 m_coolantPtcPos = GetMemoryPointPos("ptcCoolantPos");
347 else
348 m_coolantPtcPos = "0 0 0";
349
350 if ( MemoryPointExists("drown_engine") )
351 m_DrownEnginePos = GetMemoryPointPos("drown_engine");
352 else
353 m_DrownEnginePos = "0 0 0";
354
355 if ( MemoryPointExists("dmgZone_engine") )
356 m_enginePos = GetMemoryPointPos("dmgZone_engine");
357 else
358 m_enginePos = "0 0 0";
359
360 if ( MemoryPointExists("dmgZone_front") )
361 m_frontPos = GetMemoryPointPos("dmgZone_front");
362 else
363 m_frontPos = "0 0 0";
364
365 if ( MemoryPointExists("dmgZone_back") )
366 m_backPos = GetMemoryPointPos("dmgZone_back");
367 else
368 m_backPos = "0 0 0";
369
370 if ( MemoryPointExists("dmgZone_fender_1_1") )
371 m_side_1_1Pos = GetMemoryPointPos("dmgZone_fender_1_1");
372 else
373 m_side_1_1Pos = "0 0 0";
374
375 if ( MemoryPointExists("dmgZone_fender_1_2") )
376 m_side_1_2Pos = GetMemoryPointPos("dmgZone_fender_1_2");
377 else
378 m_side_1_2Pos = "0 0 0";
379
380 if ( MemoryPointExists("dmgZone_fender_2_1") )
381 m_side_2_1Pos = GetMemoryPointPos("dmgZone_fender_2_1");
382 else
383 m_side_2_1Pos = "0 0 0";
384
385 if ( MemoryPointExists("dmgZone_fender_2_2") )
386 m_side_2_2Pos = GetMemoryPointPos("dmgZone_fender_2_2");
387 else
388 m_side_2_2Pos = "0 0 0";
389
390 if (!GetGame().IsDedicatedServer())
391 {
393 m_WheelSmokeFx.Resize(WheelCount());
395 m_WheelSmokePtcFx.Resize(WheelCount());
396 for (int i = 0; i < m_WheelSmokePtcFx.Count(); i++)
397 {
398 m_WheelSmokePtcFx.Set(i, -1);
399 }
400 }
401 }
float m_Time
Definition CarScript.c:146
ref array< ref EffWheelSmoke > m_WheelSmokeFx
Definition CarScript.c:270
float m_BatteryHealth
Definition CarScript.c:172
vector m_exhaustPtcPos
Definition CarScript.c:193
int m_CarHornState
Definition CarScript.c:243
int m_coolantPtcFx
Definition CarScript.c:190
vector m_enginePos
Definition CarScript.c:198
vector m_backPos
Definition CarScript.c:200
int m_enginePtcFx
Definition CarScript.c:189
int m_CarEngineSoundState
Definition CarScript.c:244
float m_EnviroHeatComfortOverride
Definition CarScript.c:162
bool m_PlayCrashSoundLight
Definition CarScript.c:231
int m_exhaustPtcFx
Definition CarScript.c:191
ref array< int > m_WheelSmokePtcFx
Definition CarScript.c:271
vector m_coolantPtcPos
Definition CarScript.c:196
vector m_frontPos
Definition CarScript.c:199
vector m_side_1_2Pos
Definition CarScript.c:202
vector m_enginePtcPos
Definition CarScript.c:195
vector m_exhaustPtcDir
Definition CarScript.c:194
vector m_side_1_1Pos
Definition CarScript.c:201
vector m_side_2_2Pos
Definition CarScript.c:204
float m_PlugHealth
Definition CarScript.c:173
vector m_side_2_1Pos
Definition CarScript.c:203
bool m_PlayCrashSoundHeavy
Definition CarScript.c:232
static vector m_DrownEnginePos
Definition CarScript.c:166
ref CarContactCache m_ContactCache
Definition CarScript.c:144
proto vector Normalized()
return normalized vector (keeps orginal vector untouched)
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
Definition EnConvert.c:220
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:45

Перекрестные ссылки vector::Direction(), GetGame(), m_backPos, m_BatteryHealth, m_CarEngineSoundState, m_CarHornState, m_ContactCache, m_coolantPtcFx, m_coolantPtcPos, m_DrownEnginePos, m_EngineHealth, m_enginePos, m_enginePtcFx, m_enginePtcPos, m_EnviroHeatComfortOverride, m_exhaustPtcDir, m_exhaustPtcFx, m_exhaustPtcPos, m_frontPos, m_FuelTankHealth, m_PlayCrashSoundHeavy, m_PlayCrashSoundLight, m_PlugHealth, m_RadiatorHealth, m_side_1_1Pos, m_side_1_2Pos, m_side_2_1Pos, m_side_2_2Pos, m_Time, m_WheelSmokeFx, m_WheelSmokePtcFx и vector::Normalized().

◆ CheckContactCache()

void CheckContactCache ( )
protected

Responsible for damaging the car according to contact events from OnContact.

1303 {
1304
1305 int contactZonesCount = m_ContactCache.Count();
1306
1307 if (contactZonesCount == 0)
1308 return;
1309
1310
1311 for (int i = 0; i < contactZonesCount; ++i)
1312 {
1313 string zoneName = m_ContactCache.GetKey(i);
1315
1317 float crewDmgBase = Math.AbsInt((data[0].impulse / dBodyGetMass(this)) * 1000 * m_dmgContactCoef);// calculates damage as if the object's weight was 1000kg instead of its actual weight
1318
1319 #ifdef DIAG_DEVELOPER
1320 CrashDebugData.m_CrashDataPoint = new CrashDebugData();
1321 CrashDebugData.m_CrashDataPoint.m_VehicleType = GetDisplayName();
1322 CrashDebugData.m_CrashDataPoint.m_Damage = dmg;
1323 CrashDebugData.m_CrashDataPoint.m_Zone = zoneName;
1324 CrashDebugData.m_CrashDataPoint.m_MomentumCurr = GetMomentum();
1325 CrashDebugData.m_CrashDataPoint.m_MomentumPrev = m_MomentumPrevTick;
1326 CrashDebugData.m_CrashDataPoint.m_MomentumDelta = data[0].impulse;
1327 CrashDebugData.m_CrashDataPoint.m_SpeedWorld = GetVelocity(this).Length() * 3.6;
1328 CrashDebugData.m_CrashDataPoint.m_SpeedWorldPrev = m_VelocityPrevTick.Length() * 3.6;
1329 CrashDebugData.m_CrashDataPoint.m_SpeedWorldDelta = (m_VelocityPrevTick.Length() - GetVelocity(this).Length()) * 3.6;
1330 CrashDebugData.m_CrashDataPoint.m_VelocityCur = GetVelocity(this);
1331 CrashDebugData.m_CrashDataPoint.m_VelocityPrev = m_VelocityPrevTick;
1332 CrashDebugData.m_CrashDataPoint.m_VelocityDot = vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized());
1333 CrashDebugData.m_CrashDataPoint.m_Time = GetGame().GetTime();
1334
1335
1336
1337 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_CONSIDERED)
1338 {
1339 Debug.Log("--------------------------------------------------");
1340 Debug.Log("Vehicle:" + GetDisplayName());
1341 Debug.Log("DMG: " + dmg);
1342 Debug.Log("zoneName : "+ zoneName);
1343 Debug.Log("momentumCurr : "+ GetMomentum());
1344 Debug.Log("momentumPrev : "+ m_MomentumPrevTick);
1345 Debug.Log("momentumDelta : "+ data[0].impulse);
1346 Debug.Log("speed(km/h): "+ GetVelocity(this).Length() * 3.6);
1347 Debug.Log("speedPrev(km/h): "+ m_VelocityPrevTick.Length() * 3.6);
1348 Debug.Log("speedDelta(km/h) : "+ (m_VelocityPrevTick.Length() - GetVelocity(this).Length()) * 3.6);
1349 Debug.Log("velocityCur.): "+ GetVelocity(this));
1350 Debug.Log("velocityPrev.): "+ m_VelocityPrevTick);
1351 Debug.Log("velocityDot): "+ vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized()));
1352 Debug.Log("GetGame().GetTime(): "+ GetGame().GetTime());
1353 Debug.Log("--------------------------------------------------");
1354 }
1355 #endif
1357 continue;
1358
1359 int pddfFlags;
1360 #ifdef DIAG_DEVELOPER
1361 CrashDebugData.m_CrashData.Insert(CrashDebugData.m_CrashDataPoint);
1362 CrashDebugData.m_CrashDataPoint.m_Speedometer = GetSpeedometer();
1363 //Print("Crash data recorded");
1364 #endif
1366 {
1367 #ifdef DIAG_DEVELOPER
1368 CrashDebugData.m_CrashDataPoint.m_DamageType = "Small";
1369 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1370 Debug.Log(string.Format("[Vehiles:Damage]:: DMG %1 to the %2 zone is SMALL (threshold: %3), SPEEDOMETER: %4, TIME: %5", dmg, zoneName, GameConstants.CARS_CONTACT_DMG_MIN, GetSpeedometer(), GetGame().GetTime() ));
1371 #endif
1373 pddfFlags = ProcessDirectDamageFlags.NO_TRANSFER;
1374 }
1375 else
1376 {
1377 #ifdef DIAG_DEVELOPER
1378 CrashDebugData.m_CrashDataPoint.m_DamageType = "Big";
1379 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1380 Debug.Log(string.Format("[Vehiles:Damage]:: DMG %1 to the %2 zone is BIG (threshold: %3), SPEED: %4, TIME: %5", dmg, zoneName, GameConstants.CARS_CONTACT_DMG_THRESHOLD, GetSpeedometer(), GetGame().GetTime() ));
1381 #endif
1384 pddfFlags = 0;
1385 }
1386
1387 #ifdef DEVELOPER
1388 m_DebugContactDamageMessage += string.Format("%1: %2\n", zoneName, dmg);
1389 #endif
1390
1391 ProcessDirectDamage(DT_CUSTOM, null, zoneName, "EnviroDmg", "0 0 0", dmg, pddfFlags);
1392
1393 //if (data[0].impulse > TRESHOLD)
1394 //{
1395 /* Object targetEntity = Object.Cast(data[0].other);
1396 if (targetEntity && targetEntity.IsTree())
1397 {
1398 SEffectManager.CreateParticleServer(targetEntity.GetPosition(), new TreeEffecterParameters("TreeEffecter", 1.0, 0.1));
1399 }*/
1400 //}
1401 }
1402
1404 UpdateLights();
1405
1406 m_ContactCache.Clear();
1407
1408 }
vector m_VelocityPrevTick
Definition CarScript.c:143
void DamageCrew(float dmg)
Responsible for damaging crew in a car crash.
Definition CarScript.c:1411
float m_MomentumPrevTick
Definition CarScript.c:142
void UpdateLights(int new_gear=-1)
Definition CarScript.c:1803
void SynchCrashHeavySound(bool play)
Definition CarScript.c:2299
void UpdateHeadlightState()
Definition CarScript.c:714
float m_dmgContactCoef
Definition CarScript.c:161
void SynchCrashLightSound(bool play)
Definition CarScript.c:2280
static string GetDisplayName(int liquid_type)
Definition Liquid.c:360
float GetTime()
Definition NotificationSystem.c:35
ProcessDirectDamageFlags
Definition Object.c:2
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136
Definition constants.c:638
Definition EnMath.c:7
proto native float Length()
Returns length of vector (magnitude)
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
const float CARS_CONTACT_DMG_MIN
Definition constants.c:798
const float CARS_CONTACT_DMG_THRESHOLD
Definition constants.c:797
static proto int AbsInt(int i)
Returns absolute value.
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native float dBodyGetMass(notnull IEntity ent)

Перекрестные ссылки Math::AbsInt(), GameConstants::CARS_CONTACT_DMG_MIN, GameConstants::CARS_CONTACT_DMG_THRESHOLD, DamageCrew(), dBodyGetMass(), vector::Dot(), GetDisplayName(), GetGame(), GetTime(), GetVelocity(), vector::Length(), Debug::Log(), m_ContactCache, m_dmgContactCoef, m_MomentumPrevTick, m_VelocityPrevTick, vector::Normalized(), SynchCrashHeavySound(), SynchCrashLightSound(), UpdateHeadlightState() и UpdateLights().

Используется в EOnPostSimulate().

◆ CheckVitalItem()

void CheckVitalItem ( bool isVital,
string itemName )
protected
2222 {
2223 if ( !isVital )
2224 return;
2225
2226 EntityAI item = FindAttachmentBySlotName(itemName);
2227
2228 if ( !item )
2229 EngineStop();
2230 else if ( item.IsRuined() )
2231 EngineStop();
2232 }
Definition Building.c:6

Используется в EOnPostSimulate().

◆ CleanupEffects()

void CleanupEffects ( )
protected
516 {
517 for (int i = 0; i < m_WheelSmokeFx.Count(); i++ )
518 {
519 Effect ps = m_WheelSmokeFx.Get(i);
520 if (ps)
521 {
523 }
524 }
525
526 m_WheelSmokeFx.Clear();
527 m_WheelSmokePtcFx.Clear();
528
532
533 if (m_Headlight)
534 m_Headlight.Destroy();
535
536 if (m_RearLight)
537 m_RearLight.Destroy();
538
544 }
ref EffVehicleSmoke m_coolantFx
Particles.
Definition CarScript.c:185
ref EffectSound m_WindowLarge
Definition CarScript.c:224
void CleanupSound(EffectSound sound)
Definition CarScript.c:546
ref EffectSound m_WindowSmall
Definition CarScript.c:223
ref EffVehicleSmoke m_engineFx
Definition CarScript.c:186
ref EffectSound m_CrashSoundHeavy
Definition CarScript.c:222
ref EffVehicleSmoke m_exhaustFx
Definition CarScript.c:187
ref EffectSound m_CrashSoundLight
Definition CarScript.c:221
ref EffectSound m_CarHornSoundEffect
Definition CarScript.c:227
CarLightBase m_Headlight
Definition CarScript.c:247
Manager class for managing Effect (EffectParticle, EffectSound)
Definition EffectManager.c:6
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Definition EffectManager.c:271

Перекрестные ссылки CleanupSound(), SEffectManager::DestroyEffect(), m_CarHornSoundEffect, m_coolantFx, m_CrashSoundHeavy, m_CrashSoundLight, m_engineFx, m_exhaustFx, m_Headlight, m_RearLight, m_WheelSmokeFx, m_WheelSmokePtcFx, m_WindowLarge и m_WindowSmall.

Используется в EEDelete() и ~CarScript().

◆ CleanupSound()

void CleanupSound ( EffectSound sound)
protected
547 {
549 }

Перекрестные ссылки SEffectManager::DestroyEffect().

Используется в CleanupEffects() и HandleCarHornSound().

◆ CreateCarDestroyedEffect()

void CreateCarDestroyedEffect ( )
protected
653 {
654 if ( !SEffectManager.IsEffectExist( m_enginePtcFx ) && GetGame().GetWaterDepth( GetEnginePosWS() ) <= 0 )
655 {
657 m_engineFx.SetParticleStateHeavy();
659 }
660 }
vector GetEnginePosWS()
Definition CarScript.c:448
Definition EngineSmoke.c:2
static int PlayOnObject(notnull Effect eff, Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_relative_to_world=false)
Play an Effect.
Definition EffectManager.c:70
static bool IsEffectExist(int effect_id)
Checks whether an Effect ID is registered in SEffectManager.
Definition EffectManager.c:294
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

Перекрестные ссылки GetEnginePosWS(), GetGame(), SEffectManager::IsEffectExist(), m_engineFx, m_enginePtcFx, m_enginePtcPos, SEffectManager::PlayOnObject() и Vector().

Используется в EEHealthLevelChanged().

◆ CreateFrontLight()

CarLightBase CreateFrontLight ( )
protected
2217 {
2218 return CarLightBase.Cast(ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight));
2219 }
Definition CarRearLightBase.c:2
Definition PointLightBase.c:2

◆ CreateRearLight()

CarRearLightBase CreateRearLight ( )
protected
2211 {
2212 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight));
2213 }
Definition CivilianSedanRearLight.c:2

◆ DamageCrew()

void DamageCrew ( float dmg)
protected

Responsible for damaging crew in a car crash.

1412 {
1413 for ( int c = 0; c < CrewSize(); ++c )
1414 {
1415 Human crew = CrewMember( c );
1416 if ( !crew )
1417 continue;
1418
1420 if ( Class.CastTo(player, crew ) )
1421 {
1423 {
1424 #ifdef DIAG_DEVELOPER
1425 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1426 CrashDebugData.m_CrashDataPoint.m_DMGHealth = -100;
1427 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1428 {
1429 Debug.Log("--------------------------------------------------");
1430 Debug.Log("Killing the player");
1431 Debug.Log("Crew DMG Base: " + dmg);
1432 Debug.Log("--------------------------------------------------");
1433
1434 }
1435 #endif
1436 player.SetHealth(0.0);
1437 }
1438 else
1439 {
1442 float shock = Math.Lerp( 50, 150, shockTemp );
1443 float hp = Math.Lerp( 2, 100, shockTemp );
1444
1445 #ifdef DIAG_DEVELOPER
1446 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1447 CrashDebugData.m_CrashDataPoint.m_ShockTemp = shockTemp;
1448 CrashDebugData.m_CrashDataPoint.m_DMGHealth = hp;
1449 CrashDebugData.m_CrashDataPoint.m_DMGShock = shock;
1450 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1451 {
1452 Debug.Log("--------------------------------------------------");
1453 Debug.Log("Crew DMG Base: " + dmg);
1454 Debug.Log("Crew shockTemp: " + shockTemp);
1455 Debug.Log("Crew DMG Health: " + hp);
1456 Debug.Log("Crew DMG Shock: " + shock);
1457 Debug.Log("--------------------------------------------------");
1458 }
1459 #endif
1460
1461 player.AddHealth("", "Shock", -shock );
1462 player.AddHealth("", "Health", -hp );
1463 }
1464 }
1465 }
1466 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition PlayerBaseClient.c:2
const float CARS_CONTACT_DMG_KILLCREW
Definition constants.c:799
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.

Перекрестные ссылки GameConstants::CARS_CONTACT_DMG_KILLCREW, GameConstants::CARS_CONTACT_DMG_THRESHOLD, Class::CastTo(), Math::Clamp(), Math::InverseLerp(), Math::Lerp() и Debug::Log().

Используется в CheckContactCache().

◆ DashboardShineOff()

void DashboardShineOff ( )
protected
2200 {
2201 string material = ConfigGetString("dashboardMatOff");
2202
2203 if (material)
2204 {
2205 SetObjectMaterial(SELECTION_ID_DASHBOARD_LIGHT, material);
2206 }
2207 }
static const int SELECTION_ID_DASHBOARD_LIGHT
Definition CarScript.c:268

Перекрестные ссылки SELECTION_ID_DASHBOARD_LIGHT.

Используется в UpdateLightsServer().

◆ DashboardShineOn()

void DashboardShineOn ( )
protected
2190 {
2191 string material = ConfigGetString("dashboardMatOn");
2192
2193 if (material)
2194 {
2195 SetObjectMaterial(SELECTION_ID_DASHBOARD_LIGHT, material);
2196 }
2197 }

Перекрестные ссылки SELECTION_ID_DASHBOARD_LIGHT.

Используется в UpdateLightsServer().

◆ EEDelete()

override void EEDelete ( EntityAI parent)
protected
502 {
503 #ifndef SERVER
505 #endif
506 }
void CleanupEffects()
Definition CarScript.c:515

Перекрестные ссылки CleanupEffects().

◆ EEHealthLevelChanged()

override void EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
protected
2605 {
2606 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2607
2609 {
2610 bool dummy;
2611 switch ( zone )
2612 {
2613 case "WindowLR":
2614 case "WindowRR":
2615 if (m_Initialized)
2616 {
2617 PlaySoundEx("offroad_hit_window_small_SoundSet", m_WindowSmall, dummy);
2618 }
2619 break;
2620
2621 case "WindowFront":
2622 case "WindowBack":
2623 case "WindowFrontLeft":
2624 case "WindowFrontRight":
2625 if (m_Initialized)
2626 {
2627 PlaySoundEx("offroad_hit_window_large_SoundSet", m_WindowLarge, dummy);
2628 }
2629 break;
2630
2631 case "Engine":
2632 #ifndef SERVER
2634 #endif
2635 break;
2636 }
2637 }
2638 }
void CreateCarDestroyedEffect()
Definition CarScript.c:652
void PlaySoundEx(string soundset, EffectSound sound, out bool soundbool)
Definition CarScript.c:2313
bool m_Initialized
Definition UiHintPanel.c:317
const int STATE_RUINED
Definition constants.c:807

Перекрестные ссылки CreateCarDestroyedEffect(), m_Initialized, m_WindowLarge, m_WindowSmall, PlaySoundEx() и GameConstants::STATE_RUINED.

◆ EEHitBy()

override void EEHitBy ( TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo,
vector modelPos,
float speedCoef )
protected
494 {
496
498 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(ForceUpdateLightsEnd, 100, false);
499 }
void ForceUpdateLightsStart()
Definition CarScript.c:2654
void ForceUpdateLightsEnd()
Definition CarScript.c:2663
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, component, ForceUpdateLightsEnd(), ForceUpdateLightsStart() и GetGame().

◆ EEInit()

override void EEInit ( )
protected
404 {
405 super.EEInit();
406
407 if (GetGame().IsServer())
408 {
409 m_NoiseSystem = GetGame().GetNoiseSystem();
411 {
412 m_NoisePar = new NoiseParams();
413 m_NoisePar.LoadFromPath("cfgVehicles " + GetType() + " NoiseCarHorn");
414 }
415 }
416 }
eBleedingSourceType GetType()
Definition BleedingSource.c:63
ref NoiseParams m_NoisePar
Definition CarScript.c:228
NoiseSystem m_NoiseSystem
Definition CarScript.c:229
class NoiseSystem NoiseParams()
Definition Noise.c:15

Перекрестные ссылки GetGame(), GetType(), m_NoisePar, m_NoiseSystem и NoiseParams().

◆ EEItemAttached()

override void EEItemAttached ( EntityAI item,
string slot_name )
protected
663 {
664 super.EEItemAttached(item, slot_name);
665
666 switch (slot_name)
667 {
668 case "Reflector_1_1":
669 if (GetGame().IsServer())
670 {
671 SetHealth("Reflector_1_1", "Health", item.GetHealth());
672 }
673 break;
674 case "Reflector_2_1":
675 if (GetGame().IsServer())
676 {
677 SetHealth("Reflector_2_1", "Health", item.GetHealth());
678 }
679 break;
680 case "CarBattery":
681 case "TruckBattery":
682 if (GetGame().IsServer())
683 {
684 m_BatteryHealth = item.GetHealth01();
685 }
686 break;
687 case "SparkPlug":
688 case "GlowPlug":
689 if (GetGame().IsServer())
690 {
691 m_PlugHealth = item.GetHealth01();
692 }
693 break;
694 case "CarRadiator":
695 if (GetGame().IsServer())
696 {
697 m_RadiatorHealth = item.GetHealth01();
698 }
699
701 break;
702 }
703
704 if (GetGame().IsServer())
705 {
706 Synchronize();
707 }
708
710 UpdateLights();
711 }
EntityAI m_Radiator
Definition CarScript.c:175
void Synchronize()
Definition CombinationLock.c:151

Перекрестные ссылки GetGame(), m_BatteryHealth, m_PlugHealth, m_Radiator, m_RadiatorHealth, Synchronize(), UpdateHeadlightState() и UpdateLights().

◆ EEItemDetached()

override void EEItemDetached ( EntityAI item,
string slot_name )
protected
738 {
739 switch (slot_name)
740 {
741 case "CarBattery":
742 case "TruckBattery":
743 m_BatteryHealth = -1;
744 if (GetGame().IsServer())
745 {
746 if (EngineIsOn())
747 {
748 EngineStop();
749 }
750
751 if (IsScriptedLightsOn())
752 {
754 }
755 }
756 break;
757 case "SparkPlug":
758 case "GlowPlug":
759 m_PlugHealth = -1;
760 if (GetGame().IsServer() && EngineIsOn())
761 {
762 EngineStop();
763 }
764 break;
765 case "CarRadiator":
767 if (GetGame().IsServer())
768 {
769 LeakAll(CarFluid.COOLANT);
770
771 if (m_DamageZoneMap.Contains("Radiator"))
772 {
773 SetHealth("Radiator", "Health", 0);
774 }
775 }
776 break;
777 }
778
779 if (GetGame().IsServer())
780 {
781 Synchronize();
782 }
783
785 UpdateLights();
786 }
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Car.c:19
void ToggleHeadlights()
Switches headlights on/off, including the illumination of the control panel and synchronizes this cha...
Definition CarScript.c:1797
bool IsScriptedLightsOn()
Propper way to get if light is swiched on. Use instead of IsLightsOn().
Definition CarScript.c:1791

Перекрестные ссылки GetGame(), IsScriptedLightsOn(), m_BatteryHealth, m_PlugHealth, m_Radiator, Synchronize(), ToggleHeadlights(), UpdateHeadlightState() и UpdateLights().

◆ EEKilled()

override void EEKilled ( Object killer)
protected
1267 {
1268 super.EEKilled(killer);
1269 m_EngineDestroyed = true;
1270 }
bool m_EngineDestroyed
Definition CarScript.c:241

Перекрестные ссылки m_EngineDestroyed.

◆ EEOnCECreate()

override void EEOnCECreate ( )
protected
2641 {
2642
2643 float maxVolume = GetFluidCapacity( CarFluid.FUEL );
2644 float amount = Math.RandomFloat(0.0, maxVolume * 0.35 );
2645
2646 Fill( CarFluid.FUEL, amount );
2647 }
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

Перекрестные ссылки Math::RandomFloat().

◆ EOnPostSimulate()

override void EOnPostSimulate ( IEntity other,
float timeSlice )
protected

actions runned when the engine on

leaking of coolant from radiator when damaged

863 {
864 m_Time += timeSlice;
865
866 if (GetGame().IsServer())
867 {
870
871 #ifdef DIAG_DEVELOPER
873 {
874 if (m_ContactCalled)
875 {
876 Debug.Log("Momentum delta: " + (GetMomentum() - m_MomentumPrevTick));
877 Debug.Log("--------------------------------------------------------------------");
878 m_ContactCalled = false;
879 }
880 }
881 #endif
882
883
886 m_MomentumPrevTick = GetMomentum();
887 #ifdef DEVELOPER
890 {
893 }
894 #endif
895 }
896
898 {
899 m_Time = 0;
900
902
903 //First of all check if the car should stop the engine
904 if (GetGame().IsServer() && EngineIsOn())
905 {
906 if ( GetFluidFraction(CarFluid.FUEL) <= 0 || m_EngineHealth <= 0 )
907 EngineStop();
908
909 CheckVitalItem(IsVitalCarBattery(), "CarBattery");
910 CheckVitalItem(IsVitalTruckBattery(), "TruckBattery");
911 CheckVitalItem(IsVitalSparkPlug(), "SparkPlug");
912 CheckVitalItem(IsVitalGlowPlug(), "GlowPlug");
913 }
914
915 if (GetGame().IsServer())
916 {
917 if (IsVitalFuelTank())
918 {
920 {
921 SetHealth("Engine", "Health", GameConstants.DAMAGE_RUINED_VALUE);
922 }
923 }
924 }
925
927 if ( EngineIsOn() )
928 {
929 if ( GetGame().IsServer() )
930 {
931 float dmg;
932
933 if ( EngineGetRPM() >= EngineGetRPMRedline() )
934 {
935 if (EngineGetRPM() > EngineGetRPMMax())
936 AddHealth( "Engine", "Health", -GetMaxHealth("Engine", "") * 0.05 ); //CAR_RPM_DMG
937
938 dmg = EngineGetRPM() * 0.001 * Math.RandomFloat( 0.02, 1.0 ); //CARS_TICK_DMG_MIN; //CARS_TICK_DMG_MAX
939 ProcessDirectDamage(DamageType.CUSTOM, null, "Engine", "EnviroDmg", vector.Zero, dmg);
940 SetEngineZoneReceivedHit(true);
941 }
942 else
943 {
944 SetEngineZoneReceivedHit(false);
945 }
946
948 if ( IsVitalRadiator() )
949 {
950 if ( GetFluidFraction(CarFluid.COOLANT) > 0 && m_RadiatorHealth < 0.5 ) //CARS_LEAK_THRESHOLD
951 LeakFluid( CarFluid.COOLANT );
952 }
953
954 if ( GetFluidFraction(CarFluid.FUEL) > 0 && m_FuelTankHealth < GameConstants.DAMAGE_DAMAGED_VALUE )
955 LeakFluid( CarFluid.FUEL );
956
957 if ( GetFluidFraction(CarFluid.BRAKE) > 0 && m_EngineHealth < GameConstants.DAMAGE_DAMAGED_VALUE )
958 LeakFluid( CarFluid.BRAKE );
959
960 if ( GetFluidFraction(CarFluid.OIL) > 0 && m_EngineHealth < GameConstants.DAMAGE_DAMAGED_VALUE )
961 LeakFluid( CarFluid.OIL );
962
963 if ( m_EngineHealth < 0.25 )
964 LeakFluid( CarFluid.OIL );
965
966 if ( IsVitalRadiator() )
967 {
968 if ( GetFluidFraction( CarFluid.COOLANT ) < 0.5 && GetFluidFraction( CarFluid.COOLANT ) >= 0 )
969 {
970 dmg = ( 1 - GetFluidFraction(CarFluid.COOLANT) ) * Math.RandomFloat( 0.02, 10.00 ); //CARS_DMG_TICK_MIN_COOLANT; //CARS_DMG_TICK_MAX_COOLANT
971 AddHealth( "Engine", "Health", -dmg );
972 SetEngineZoneReceivedHit(true);
973 }
974 }
975 }
976
977 //FX only on Client and in Single
978 if (!GetGame().IsDedicatedServer())
979 {
981 {
984 m_exhaustFx.SetParticleStateLight();
985 }
986
987 if (IsVitalRadiator() && GetFluidFraction(CarFluid.COOLANT) < 0.5)
988 {
990 {
993 }
994
995 if (m_coolantFx)
996 {
997 if (GetFluidFraction(CarFluid.COOLANT) > 0)
998 m_coolantFx.SetParticleStateLight();
999 else
1000 m_coolantFx.SetParticleStateHeavy();
1001 }
1002 }
1003 else
1004 {
1007 }
1008 }
1009 }
1010 else
1011 {
1012 //FX only on Client and in Single
1013 if ( !GetGame().IsDedicatedServer() )
1014 {
1016 {
1018 m_exhaustPtcFx = -1;
1019 }
1020
1022 {
1024 m_coolantPtcFx = -1;
1025 }
1026 }
1027 }
1028
1029 }
1030
1031 //FX only on Client and in Single
1032 if ( !GetGame().IsDedicatedServer() )
1033 {
1034 float carSpeed = GetVelocity(this).Length();
1035 for (int i = 0; i < WheelCount(); i++)
1036 {
1038 int ptrEff = m_WheelSmokePtcFx.Get(i);
1039 bool haveParticle = false;
1040
1041 if (WheelHasContact(i))
1042 {
1043 CarWheel wheel = CarWheel.Cast(WheelGetEntity(i));
1044 float wheelSpeed = WheelGetAngularVelocity(i) * wheel.GetRadius();
1045
1046 vector wheelPos = WheelGetContactPosition(i);
1048
1049 vector transform[3];
1050 transform[2] = WheelGetDirection(i);
1051 transform[1] = vector.Up;
1052 transform[0] = transform[2] * transform[1];
1053
1054 wheelVel = wheelVel.InvMultiply3(transform);
1055
1056 float bodySpeed = wheelVel[2];
1057
1058 bool applyEffect = false;
1059 if ((wheelSpeed > 0 && bodySpeed > 0) || (wheelSpeed < 0 && bodySpeed < 0))
1060 {
1062 }
1063 else
1064 {
1066 }
1067
1068 if (applyEffect)
1069 {
1070 haveParticle = true;
1071
1072 string surface;
1073 GetGame().SurfaceGetType(wheelPos[0], wheelPos[2], surface);
1074 wheelPos = WorldToModel(wheelPos);
1075
1077 {
1078 eff = new EffWheelSmoke();
1079 eff.SetSurface(surface);
1080 ptrEff = SEffectManager.PlayOnObject(eff, this, wheelPos, "0 1 -1");
1081 eff.SetCurrentLocalPosition(wheelPos);
1082 m_WheelSmokeFx.Set(i, eff);
1084 }
1085 else
1086 {
1087 if (!eff.IsPlaying())
1088 eff.Start();
1089 eff.SetSurface(surface);
1090 eff.SetCurrentLocalPosition(wheelPos);
1091 }
1092 }
1093 }
1094
1095 if (!haveParticle)
1096 {
1097 if (eff && eff.IsPlaying())
1098 eff.Stop();
1099 }
1100 }
1101 }
1102 //}
1103 }
bool IsVitalGlowPlug()
Definition CarScript.c:2417
void CheckVitalItem(bool isVital, string itemName)
Definition CarScript.c:2221
void CheckContactCache()
Responsible for damaging the car according to contact events from OnContact.
Definition CarScript.c:1302
override void HandleByCrewMemberState(ECrewMemberState state)
Definition CarScript.c:1635
void LeakFluid(CarFluid fluid)
Definition CarScript.c:2234
bool IsVitalRadiator()
Definition CarScript.c:2427
bool IsVitalCarBattery()
Definition CarScript.c:2407
bool IsVitalTruckBattery()
Definition CarScript.c:2412
void CarPartsHealthCheck()
Definition CarScript.c:2257
bool IsVitalFuelTank()
Definition CarScript.c:2432
DamageType
exposed from C++ (do not change)
Definition DamageSystem.c:11
ECrewMemberState
Definition ECrewMemberState.c:2
Definition CoolantSteam.c:2
Definition ExhaustSmoke.c:2
Definition WheelSmoke.c:2
const float WHEEL_SMOKE_THRESHOLD
Definition WheelSmoke.c:3
static void Stop(int effect_id)
Stops the Effect.
Definition EffectManager.c:110
static const vector Up
Definition EnConvert.c:107
static const vector Zero
Definition EnConvert.c:110
const int CARS_FLUIDS_TICK
Definition constants.c:786
const float DAMAGE_RUINED_VALUE
Definition constants.c:823
const float DAMAGE_DAMAGED_VALUE
Definition constants.c:821
static proto float AbsFloat(float f)
Returns absolute value.
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)

Перекрестные ссылки Math::AbsFloat(), CarPartsHealthCheck(), GameConstants::CARS_FLUIDS_TICK, CheckContactCache(), CheckVitalItem(), GameConstants::DAMAGE_DAMAGED_VALUE, GameConstants::DAMAGE_RUINED_VALUE, dBodyGetVelocityAt(), GetGame(), GetVelocity(), HandleByCrewMemberState(), SEffectManager::IsEffectExist(), CarScript::IsVitalCarBattery(), IsVitalFuelTank(), CarScript::IsVitalGlowPlug(), CarScript::IsVitalRadiator(), CarScript::IsVitalSparkPlug(), CarScript::IsVitalTruckBattery(), LeakFluid(), Debug::Log(), m_coolantFx, m_coolantPtcFx, m_coolantPtcPos, m_EngineHealth, m_exhaustFx, m_exhaustPtcDir, m_exhaustPtcFx, m_exhaustPtcPos, m_FuelTankHealth, m_MomentumPrevTick, m_RadiatorHealth, m_Time, m_VelocityPrevTick, m_WheelSmokeFx, m_WheelSmokePtcFx, SEffectManager::PlayOnObject(), Math::RandomFloat(), SEffectManager::Stop(), vector::Up, EffWheelSmoke::WHEEL_SMOKE_THRESHOLD и vector::Zero.

◆ FillUpCarFluids()

void FillUpCarFluids ( )
protected
2830 {
2831 Fill(CarFluid.FUEL, 200.0);
2832 Fill(CarFluid.COOLANT, 200.0);
2833 Fill(CarFluid.OIL, 200.0);
2834 }

Используется в CarScript::OnDebugSpawn(), CivilianSedan::OnDebugSpawn(), Hatchback_02::OnDebugSpawn(), Sedan_02::OnDebugSpawn() и Truck_01_Covered::OnDebugSpawn().

◆ ForceUpdateLightsEnd()

void ForceUpdateLightsEnd ( )
protected
2664 {
2666 {
2667 m_ForceUpdateLights = false;
2668 SetSynchDirty();
2669 }
2670 }
bool m_ForceUpdateLights
Definition CarScript.c:239

Перекрестные ссылки m_ForceUpdateLights.

Используется в EEHitBy().

◆ ForceUpdateLightsStart()

void ForceUpdateLightsStart ( )
protected
2655 {
2657 {
2658 m_ForceUpdateLights = true;
2659 SetSynchDirty();
2660 }
2661 }

Перекрестные ссылки m_ForceUpdateLights.

Используется в EEHitBy().

◆ GenerateCarHornAINoise()

void GenerateCarHornAINoise ( int pState)
protected
2721 {
2722 if (pState != ECarHornState.OFF)
2723 {
2725 {
2726 float noiseMultiplier = 1.0;
2727 if (pState == ECarHornState.LONG)
2728 noiseMultiplier = 2.0;
2729
2731
2733 }
2734 }
2735 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
Definition SensesAIEvaluate.c:2
static float GetNoiseReduction(Weather weather)
Definition SensesAIEvaluate.c:18
proto void AddNoiseTarget(vector pos, float lifetime, NoiseParams noise_params, float external_strength_multiplier=1.0)
Will make a noise at that position which the AI will "see" for the duration of 'lifetime'.

Перекрестные ссылки NoiseSystem::AddNoiseTarget(), GetGame(), NoiseAIEvaluate::GetNoiseReduction(), GetPosition, m_NoisePar и m_NoiseSystem.

Используется в SetCarHornState().

◆ Get3rdPersonCameraType()

override int Get3rdPersonCameraType ( )
protected

camera type

2459 {
2461
2462 }
Definition DayZPlayerCameras.c:2
static const int DAYZCAMERA_3RD_VEHICLE
generic vehicle 3rd person
Definition DayZPlayerCameras.c:19

Перекрестные ссылки DayZPlayerCameras::DAYZCAMERA_3RD_VEHICLE.

◆ Get_1_1PointPosWS()

vector Get_1_1PointPosWS ( )
protected
471 {
472 return ModelToWorld( m_side_1_1Pos );
473 }

Перекрестные ссылки m_side_1_1Pos.

◆ Get_1_2PointPosWS()

vector Get_1_2PointPosWS ( )
protected
475 {
476 return ModelToWorld( m_side_1_2Pos );
477 }

Перекрестные ссылки m_side_1_2Pos.

◆ Get_2_1PointPosWS()

vector Get_2_1PointPosWS ( )
protected
479 {
480 return ModelToWorld( m_side_2_1Pos );
481 }

Перекрестные ссылки m_side_2_1Pos.

◆ Get_2_2PointPosWS()

vector Get_2_2PointPosWS ( )
protected
483 {
484 return ModelToWorld( m_side_2_2Pos );
485 }

Перекрестные ссылки m_side_2_2Pos.

◆ GetActionCompNameBrakes()

string GetActionCompNameBrakes ( )
protected
2507 {
2508 return "carradiator";
2509 }

◆ GetActionCompNameCoolant()

string GetActionCompNameCoolant ( )
protected
2487 {
2488 return "radiator";
2489 }

◆ GetActionCompNameOil()

string GetActionCompNameOil ( )
protected
2497 {
2498 return "carradiator";
2499 }

◆ GetActionDistanceBrakes()

float GetActionDistanceBrakes ( )
protected
2512 {
2513 return 2.0;
2514 }

◆ GetActionDistanceCoolant()

float GetActionDistanceCoolant ( )
protected
2492 {
2493 return 2.0;
2494 }

◆ GetActionDistanceOil()

float GetActionDistanceOil ( )
protected
2502 {
2503 return 2.0;
2504 }

◆ GetActions()

override void GetActions ( typename action_input_type ,
out array< ActionBase_Basic > actions )
protected
2534 {
2536 {
2537 m_ActionsInitialize = true;
2539 }
2540
2542 }
void InitializeActions()
Definition CarScript.c:2521

Перекрестные ссылки InitializeActions(), m_ActionsInitialize и m_InputActionMap.

◆ GetAnimSourceFromSelection()

string GetAnimSourceFromSelection ( string selection)
protected
2343 {
2344 return "";
2345 }

◆ GetBackPointPosWS()

vector GetBackPointPosWS ( )
protected
467 {
468 return ModelToWorld( m_backPos );
469 }

Перекрестные ссылки m_backPos.

◆ GetBattery()

ItemBase GetBattery ( )
protected
2689 {
2690 if (IsVitalCarBattery())
2691 {
2692 return ItemBase.Cast(FindAttachmentBySlotName("CarBattery"));
2693 }
2694 else if (IsVitalTruckBattery())
2695 {
2696 return ItemBase.Cast(FindAttachmentBySlotName("TruckBattery"));
2697 }
2698
2699 return null;
2700 }
Definition InventoryItem.c:731

Перекрестные ссылки CarScript::IsVitalCarBattery() и CarScript::IsVitalTruckBattery().

Используется в OnBeforeEngineStart(), OnEngineStart() и OnUpdate().

◆ GetBatteryConsumption()

float GetBatteryConsumption ( )
protected
2674 {
2675 return m_BatteryConsume;
2676 }
float m_BatteryConsume
Definition CarScript.c:177

Перекрестные ссылки m_BatteryConsume.

Используется в OnEngineStart().

◆ GetBatteryRechargeRate()

float GetBatteryRechargeRate ( )
protected
2684 {
2685 return -m_BatteryRecharge;
2686 }
float m_BatteryRecharge
Definition CarScript.c:179

Перекрестные ссылки m_BatteryRecharge.

Используется в OnUpdate().

◆ GetBatteryRuntimeConsumption()

float GetBatteryRuntimeConsumption ( )
protected
2679 {
2681 }
float m_BatteryContinuousConsume
Definition CarScript.c:178

Перекрестные ссылки m_BatteryContinuousConsume.

Используется в OnUpdate().

◆ GetCarDoorsState()

int GetCarDoorsState ( string slotType)
protected
2470 {
2471 return -1;
2472 }

Используется в CarScript::CrewCanGetThrough() и CarScript::OnSound().

◆ GetCoolantPtcPosWS()

vector GetCoolantPtcPosWS ( )
protected
454 {
455 return ModelToWorld( m_coolantPtcPos );
456 }

Перекрестные ссылки m_coolantPtcPos.

◆ GetCrashHeavySound()

bool GetCrashHeavySound ( )
protected
2295 {
2296 return m_PlayCrashSoundHeavy;
2297 }

Перекрестные ссылки m_PlayCrashSoundHeavy.

Используется в OnVariablesSynchronized().

◆ GetCrashLightSound()

bool GetCrashLightSound ( )
protected
2276 {
2277 return m_PlayCrashSoundLight;
2278 }

Перекрестные ссылки m_PlayCrashSoundLight.

Используется в OnVariablesSynchronized().

◆ GetCrewIndex()

int GetCrewIndex ( string selection)
protected
2379 {
2380 return -1;
2381 }

◆ GetDebugActions()

override void GetDebugActions ( out TSelectableActionInfoArrayEx outputList)
protected
552 {
553 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_HORN_START_SHORT, "Car Horn Start Short", FadeColors.LIGHT_GREY));
554 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_HORN_START_LONG, "Car Horn Start Long", FadeColors.LIGHT_GREY));
555 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_HORN_STOP, "Car Horn Stop", FadeColors.LIGHT_GREY));
556
557 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "Car Fuel", FadeColors.RED));
558 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_FUEL_FULL, "Full", FadeColors.LIGHT_GREY));
559 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_FUEL_EMPTY, "Empty", FadeColors.LIGHT_GREY));
560 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_FUEL_INCREASE, "10% increase", FadeColors.LIGHT_GREY));
561 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_FUEL_DECREASE, "10% decrease", FadeColors.LIGHT_GREY));
562 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.RED));
563 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "Car Cooler", FadeColors.RED));
564 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_COOLANT_FULL, "Full", FadeColors.LIGHT_GREY));
565 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_COOLANT_EMPTY, "Empty", FadeColors.LIGHT_GREY));
566 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_COOLANT_INCREASE, "10% increase", FadeColors.LIGHT_GREY));
567 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.CAR_COOLANT_DECREASE, "10% decrease", FadeColors.LIGHT_GREY));
568 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.RED));
569
570 super.GetDebugActions(outputList);
571
572 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.RED));
574 }
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition EntityAI.c:97
EActions
Definition EActions.c:2
const int SAT_DEBUG_ACTION
Definition constants.c:431

Перекрестные ссылки SAT_DEBUG_ACTION.

◆ GetDefaultHitPosition()

override vector GetDefaultHitPosition ( )
protected
2738 {
2739 return vector.Zero;
2740 }

Перекрестные ссылки vector::Zero.

◆ GetDoorConditionPointFromSelection()

string GetDoorConditionPointFromSelection ( string selection)
protected
2348 {
2349 switch( selection )
2350 {
2351 case "seat_driver":
2352 return "seat_con_1_1";
2353 break;
2354 case "seat_codriver":
2355 return "seat_con_2_1";
2356 break;
2357 case "seat_cargo1":
2358 return "seat_con_1_2";
2359 break;
2360 case "seat_cargo2":
2361 return "seat_con_2_2";
2362 break;
2363 }
2364
2365 return "";
2366 }

◆ GetDoorInvSlotNameFromSeatPos()

string GetDoorInvSlotNameFromSeatPos ( int posIdx)
protected
2374 {
2375 return "";
2376 }

◆ GetDoorSelectionNameFromSeatPos()

string GetDoorSelectionNameFromSeatPos ( int posIdx)
protected
2369 {
2370 return "";
2371 }

◆ GetEnginePointPosWS()

vector GetEnginePointPosWS ( )
protected
459 {
460 return ModelToWorld( m_enginePos );
461 }

Перекрестные ссылки m_enginePos.

◆ GetEnginePosWS()

vector GetEnginePosWS ( )
protected
449 {
450 return ModelToWorld( m_DrownEnginePos );
451 }

Перекрестные ссылки m_DrownEnginePos.

Используется в CreateCarDestroyedEffect() и OnUpdate().

◆ GetEnviroHeatComfortOverride()

float GetEnviroHeatComfortOverride ( )
protected

DEPRECATED

◆ GetFrontPointPosWS()

vector GetFrontPointPosWS ( )
protected
463 {
464 return ModelToWorld( m_frontPos );
465 }

Перекрестные ссылки m_frontPos.

◆ GetLiquidThroughputCoef()

override float GetLiquidThroughputCoef ( )
protected
488 {
490 }
const float LIQUID_THROUGHPUT_CAR_DEFAULT
Definition constants.c:549

Перекрестные ссылки LIQUID_THROUGHPUT_CAR_DEFAULT.

◆ GetPushForceCoefficientMultiplier()

float GetPushForceCoefficientMultiplier ( )
protected
2743 {
2744 return 1.0;
2745 }

◆ GetRadiator()

EntityAI GetRadiator ( )
protected
2443 {
2444 return m_Radiator;
2445 }

Перекрестные ссылки m_Radiator.

Используется в CarPartsHealthCheck().

◆ GetVehicleType()

override string GetVehicleType ( )
protected
444 {
445 return "VehicleTypeCar";
446 }

◆ HandleByCrewMemberState()

override void HandleByCrewMemberState ( ECrewMemberState state)
protected
1636 {
1637 switch (state)
1638 {
1639 case ECrewMemberState.UNCONSCIOUS:
1640 foreach (int unconsciousCrewMemberIndex : m_UnconsciousCrewMemberIndices)
1641 {
1642 if (unconsciousCrewMemberIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
1643 {
1644 EngineStop();
1645 SetBrake(0.5);
1646 }
1647
1648 m_UnconsciousCrewMemberIndices.RemoveItem(unconsciousCrewMemberIndex);
1649 }
1650
1651 break
1652
1653 case ECrewMemberState.DEAD:
1654 foreach (int deadCrewMemberIndex : m_DeadCrewMemberIndices)
1655 {
1656 if (deadCrewMemberIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
1657 {
1658 EngineStop();
1659 SetBrake(0.5);
1660 }
1661
1662 m_DeadCrewMemberIndices.RemoveItem(deadCrewMemberIndex);
1663 }
1664
1665 break
1666 }
1667 }
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Используется в EOnPostSimulate().

◆ HandleCarHornSound()

void HandleCarHornSound ( ECarHornState pState)
protected
1540 {
1541 switch (pState)
1542 {
1543 case ECarHornState.SHORT:
1544 PlaySoundSet(m_CarHornSoundEffect, m_CarHornShortSoundName, 0, 0, false);
1545 break;
1546 case ECarHornState.LONG:
1547 PlaySoundSet(m_CarHornSoundEffect, m_CarHornLongSoundName, 0, 0, true);
1548 break;
1549 default:
1551 break;
1552 }
1553 }
string m_CarHornShortSoundName
Definition CarScript.c:218
string m_CarHornLongSoundName
Definition CarScript.c:219

Перекрестные ссылки CleanupSound(), m_CarHornLongSoundName, m_CarHornShortSoundName и m_CarHornSoundEffect.

Используется в OnVariablesSynchronized().

◆ HandleDoorsSound()

void HandleDoorsSound ( string animSource,
float phase )
protected
1497 {
1498 switch (animSource)
1499 {
1500 case "doorsdriver":
1501 case "doorscodriver":
1502 case "doorscargo1":
1503 case "doorscargo2":
1504 case "doorshood":
1505 case "doorstrunk":
1507 if (phase == 0)
1509 else
1511
1512 if (sound)
1513 sound.SetAutodestroy(true);
1514
1515 break;
1516 }
1517 }
string m_CarDoorCloseSound
Definition CarScript.c:214
string m_CarDoorOpenSound
Definition CarScript.c:213
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Definition EffectManager.c:169

Перекрестные ссылки GetPosition, m_CarDoorCloseSound, m_CarDoorOpenSound и SEffectManager::PlaySound().

Используется в OnAnimationPhaseStarted().

◆ HandleEngineSound()

void HandleEngineSound ( CarEngineSoundState state)
protected

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

1556 {
1557 #ifndef SERVER
1560 WaveKind waveKind = WaveKind.WAVEEFFECT;
1561
1563
1564 switch (state)
1565 {
1566 case CarEngineSoundState.STARTING:
1567 m_PreStartSound = SEffectManager.PlaySound("Offroad_02_Starting_SoundSet", ModelToWorld(GetEnginePos()));
1568 m_PreStartSound.SetSoundFadeOut(0.15);
1569 break;
1570 case CarEngineSoundState.START_OK:
1571 // play different sound based on selected camera
1572 if (Class.CastTo(player, CrewMember(0)))
1573 {
1574 if (!player.IsCameraInsideVehicle())
1575 {
1576 waveKind = WaveKind.WAVEEFFECTEX;
1577 }
1578
1579 sound = SEffectManager.CreateSound(m_EngineStartOK, ModelToWorld(GetEnginePos()));
1580 if (sound)
1581 {
1582 sound.SetSoundWaveKind(waveKind);
1583 sound.SoundPlay();
1584 sound.SetAutodestroy(true);
1585 }
1586 }
1587
1589 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(SetEngineStarted, 1000, false, true);
1590 break;
1591
1592 case CarEngineSoundState.START_NO_FUEL:
1593 sound = SEffectManager.PlaySound("offroad_engine_failed_start_fuel_SoundSet", ModelToWorld(GetEnginePos()));
1594 sound.SetAutodestroy(true);
1595 break;
1596
1597 case CarEngineSoundState.START_NO_BATTERY:
1598 sound = SEffectManager.PlaySound("offroad_engine_failed_start_battery_SoundSet", ModelToWorld(GetEnginePos()));
1599 sound.SetAutodestroy(true);
1600 break;
1601
1602 case CarEngineSoundState.START_NO_SPARKPLUG:
1603 sound = SEffectManager.PlaySound("offroad_engine_failed_start_sparkplugs_SoundSet", ModelToWorld(GetEnginePos()));
1604 sound.SetAutodestroy(true);
1605 break;
1606
1607 case CarEngineSoundState.STOP_OK:
1608 case CarEngineSoundState.STOP_NO_FUEL:
1609 // play different sound based on selected camera
1610 if (Class.CastTo(player, CrewMember(0)))
1611 {
1612 if (!player.IsCameraInsideVehicle())
1613 {
1614 waveKind = WaveKind.WAVEEFFECTEX;
1615 }
1616
1617 sound = SEffectManager.CreateSound(m_EngineStopFuel, ModelToWorld(GetEnginePos()));
1618 if (sound)
1619 {
1620 sound.SetSoundWaveKind(waveKind);
1621 sound.SoundPlay();
1622 sound.SetAutodestroy(true);
1623 }
1624 }
1625
1626 SetEngineStarted(false);
1627 break;
1628
1629 default:
1630 break;
1631 }
1632 #endif
1633 }
void SetEngineStarted(bool started)
Definition CarScript.c:2464
string m_EngineStartOK
Sounds.
Definition CarScript.c:207
int m_CarEngineLastSoundState
Definition CarScript.c:245
ref EffectSound m_PreStartSound
Definition CarScript.c:225
string m_EngineStopFuel
Definition CarScript.c:211
WaveKind
Definition Sound.c:2
static EffectSound CreateSound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false, bool enviroment=false)
Create an EffectSound.
Definition EffectManager.c:144

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, Class::CastTo(), SEffectManager::CreateSound(), GetGame(), m_CarEngineLastSoundState, m_EngineStartOK, m_EngineStopFuel, m_PreStartSound, SEffectManager::PlaySound() и SetEngineStarted().

Используется в OnEngineStart(), OnEngineStop() и OnVariablesSynchronized().

◆ HandleSeatAdjustmentSound()

void HandleSeatAdjustmentSound ( string animSource,
float phase )
protected
1520 {
1521 switch (animSource)
1522 {
1523 case "seatdriver":
1524 case "seatcodriver":
1526 if (phase == 0)
1528 else
1530
1531 if (sound)
1532 sound.SetAutodestroy(true);
1533
1534 break;
1535 }
1536 }
string m_CarSeatShiftInSound
Definition CarScript.c:215
string m_CarSeatShiftOutSound
Definition CarScript.c:216

Перекрестные ссылки GetPosition, m_CarSeatShiftInSound, m_CarSeatShiftOutSound и SEffectManager::PlaySound().

Используется в OnAnimationPhaseStarted().

◆ HasRadiator()

bool HasRadiator ( )
protected
2438 {
2439 return m_Radiator != null;
2440 }

Перекрестные ссылки m_Radiator.

Используется в CarPartsHealthCheck().

◆ InitializeActions()

void InitializeActions ( )
protected
2522 {
2524 if (!m_InputActionMap)
2525 {
2528 SetActions();
2530 }
2531 }
map< typename, ref array< ActionBase_Basic > > TInputActionMap
Definition ActionManagerClient.c:1
void SetActions()
Definition CarScript.c:2544
enum CarDoorState m_CarTypeActionsMap
string Type
Definition JsonDataContaminatedArea.c:11

Перекрестные ссылки m_CarTypeActionsMap, m_InputActionMap, CarScript::SetActions() и Type.

◆ IsHandbrakeActive()

bool IsHandbrakeActive ( )
protected
2453 {
2454 return GetHandbrake() > 0.0;
2455 }

◆ IsInventoryVisible()

override bool IsInventoryVisible ( )
protected
2600 {
2601 return ( GetGame().GetPlayer() && ( !GetGame().GetPlayer().GetCommand_Vehicle() || GetGame().GetPlayer().GetCommand_Vehicle().GetTransport() == this ) );
2602 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51

Перекрестные ссылки GetGame() и GetPlayer().

◆ IsMoving()

bool IsMoving ( )
protected
2448 {
2449 return GetSpeedometerAbsolute() > 3.5;
2450 }

Используется в CanReleaseAttachment().

◆ IsScriptedLightsOn()

bool IsScriptedLightsOn ( )
protected

Propper way to get if light is swiched on. Use instead of IsLightsOn().

1792 {
1793 return m_HeadlightsOn;
1794 }
bool m_HeadlightsOn
Definition CarScript.c:234

Перекрестные ссылки m_HeadlightsOn.

Используется в EEItemDetached() и OnUpdate().

◆ IsVitalCarBattery()

bool IsVitalCarBattery ( )
protected
2408 {
2409 return true;
2410 }

◆ IsVitalEngineBelt()

bool IsVitalEngineBelt ( )
protected
2423 {
2424 return true;
2425 }

◆ IsVitalFuelTank()

bool IsVitalFuelTank ( )
protected
2433 {
2434 return true;
2435 }

Используется в EOnPostSimulate().

◆ IsVitalGlowPlug()

bool IsVitalGlowPlug ( )
protected
2418 {
2419 return true;
2420 }

◆ IsVitalRadiator()

bool IsVitalRadiator ( )
protected
2428 {
2429 return true;
2430 }

◆ IsVitalTruckBattery()

bool IsVitalTruckBattery ( )
protected
2413 {
2414 return true;
2415 }

◆ LeakFluid()

void LeakFluid ( CarFluid fluid)
protected
2235 {
2236 float ammount = 0;
2237
2238 switch (fluid)
2239 {
2240 case CarFluid.COOLANT:
2241 ammount = (1- m_RadiatorHealth) * Math.RandomFloat(0.02, 0.05);//CARS_LEAK_TICK_MIN; CARS_LEAK_TICK_MAX
2242 Leak(fluid, ammount);
2243 break;
2244
2245 case CarFluid.OIL:
2246 ammount = ( 1 - m_EngineHealth ) * Math.RandomFloat(0.02, 1.0);//CARS_LEAK_OIL_MIN; CARS_LEAK_OIL_MAX
2247 Leak(fluid, ammount);
2248 break;
2249
2250 case CarFluid.FUEL:
2251 ammount = ( 1 - m_FuelTankHealth ) * Math.RandomFloat(0.02, 0.05);//CARS_LEAK_TICK_MIN; CARS_LEAK_TICK_MAX
2252 Leak(fluid, ammount);
2253 break;
2254 }
2255 }

Перекрестные ссылки m_EngineHealth, m_FuelTankHealth, m_RadiatorHealth и Math::RandomFloat().

Используется в EOnPostSimulate().

◆ LeftFrontLightShineOff()

void LeftFrontLightShineOff ( )
protected
2090 {
2091 string material = ConfigGetString("frontReflectorMatOff");
2092
2093 if (material)
2094 {
2095 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_L, material);
2096 }
2097 }
static const int SELECTION_ID_FRONT_LIGHT_L
Definition CarScript.c:260

Перекрестные ссылки SELECTION_ID_FRONT_LIGHT_L.

Используется в UpdateLightsServer().

◆ LeftFrontLightShineOn()

void LeftFrontLightShineOn ( )
protected
2070 {
2071 string material = ConfigGetString("frontReflectorMatOn");
2072
2073 if (material)
2074 {
2075 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_L, material);
2076 }
2077 }

Перекрестные ссылки SELECTION_ID_FRONT_LIGHT_L.

Используется в UpdateLightsServer().

◆ NoRearLight()

void NoRearLight ( )
protected
2064 {
2065 m_RearLight.FadeOut();
2066 m_RearLight = null;
2067 }

Перекрестные ссылки m_RearLight.

Используется в UpdateLightsClient().

◆ OnAction()

override bool OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
protected
577 {
578 if (super.OnAction(action_id, player, ctx))
579 return true;
580
581 if (!GetGame().IsServer())
582 {
583 return false;
584 }
585
586 switch (action_id)
587 {
588 case EActions.CAR_HORN_START_SHORT:
590 return true;
591 case EActions.CAR_HORN_START_LONG:
593 return true;
594 case EActions.CAR_HORN_STOP:
596 return true;
597
598 case EActions.CAR_FUEL_FULL:
599 Fill(CarFluid.FUEL, GetFluidCapacity(CarFluid.FUEL));
600 return true;
601 case EActions.CAR_FUEL_EMPTY:
602 LeakAll(CarFluid.FUEL);
603 return true;
604 case EActions.CAR_FUEL_INCREASE:
605 Fill(CarFluid.FUEL, GetFluidCapacity(CarFluid.FUEL) * 0.1);
606 return true;
607 case EActions.CAR_FUEL_DECREASE:
608 Leak(CarFluid.FUEL, GetFluidCapacity(CarFluid.FUEL) * 0.1);
609 return true;
610
611 case EActions.CAR_COOLANT_FULL:
612 Fill(CarFluid.COOLANT, GetFluidCapacity(CarFluid.COOLANT));
613 return true;
614 case EActions.CAR_COOLANT_EMPTY:
615 LeakAll(CarFluid.COOLANT);
616 return true;
617 case EActions.CAR_COOLANT_INCREASE:
618 Fill(CarFluid.COOLANT, GetFluidCapacity(CarFluid.COOLANT) * 0.1);
619 return true;
620 case EActions.CAR_COOLANT_DECREASE:
621 Leak(CarFluid.COOLANT, GetFluidCapacity(CarFluid.COOLANT) * 0.1);
622 return true;
623 case EActions.DELETE:
624 Delete();
625 return true;
626 }
627
628 return false;
629 }
void SetCarHornState(int pState)
Definition CarScript.c:2702

Перекрестные ссылки GetGame() и SetCarHornState().

◆ OnAnimationPhaseStarted()

override void OnAnimationPhaseStarted ( string animSource,
float phase )
protected
1489 {
1490 #ifndef SERVER
1493 #endif
1494 }
void HandleDoorsSound(string animSource, float phase)
Definition CarScript.c:1496
void HandleSeatAdjustmentSound(string animSource, float phase)
Definition CarScript.c:1519

Перекрестные ссылки HandleDoorsSound() и HandleSeatAdjustmentSound().

◆ OnAttachmentRuined()

override void OnAttachmentRuined ( EntityAI attachment)
protected
789 {
790 super.OnAttachmentRuined(attachment);
791
793 UpdateLights();
794 }

Перекрестные ссылки UpdateHeadlightState() и UpdateLights().

◆ OnBeforeEngineStart()

override bool OnBeforeEngineStart ( )
protected

Gets called everytime the game wants to start the engine. This callback is called on server only.

Возвращает
true if the engine can start, false otherwise.
1707 {
1708 EntityAI item = null;
1709
1710 if (GetFluidFraction(CarFluid.FUEL) <= 0)
1711 {
1713 return false;
1714 }
1715
1717 {
1718 item = GetBattery();
1719 if (!item || (item && (item.IsRuined() || item.GetCompEM().GetEnergy() < m_BatteryEnergyStartMin)))
1720 {
1722 return false;
1723 }
1724 }
1725
1726 if (IsVitalSparkPlug())
1727 {
1728 item = FindAttachmentBySlotName("SparkPlug");
1729 if (!item || (item && item.IsRuined()))
1730 {
1731 SetCarEngineSoundState(CarEngineSoundState.START_NO_SPARKPLUG);
1732 return false;
1733 }
1734 }
1735
1736 if (IsVitalGlowPlug())
1737 {
1738 item = FindAttachmentBySlotName("GlowPlug");
1739 if (!item || (item && item.IsRuined()))
1740 {
1741 SetCarEngineSoundState(CarEngineSoundState.START_NO_SPARKPLUG);
1742 return false;
1743 }
1744 }
1745
1747
1748 return true;
1749 }
void SetCarEngineSoundState(CarEngineSoundState pState)
Definition CarScript.c:2714
ItemBase GetBattery()
Definition CarScript.c:2688
float m_BatteryEnergyStartMin
Definition CarScript.c:182

Перекрестные ссылки GetBattery(), CarScript::IsVitalCarBattery(), CarScript::IsVitalGlowPlug(), CarScript::IsVitalSparkPlug(), CarScript::IsVitalTruckBattery(), m_BatteryEnergyStartMin и SetCarEngineSoundState().

◆ OnBeforeSwitchLights()

bool OnBeforeSwitchLights ( bool toOn)
protected

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

Возвращает
true when lights can be switched, false otherwise.
1786 {
1787 return true;
1788 }

◆ OnBrakesPressed()

void OnBrakesPressed ( )
protected
1106 {
1107 UpdateLights();
1108 }

Перекрестные ссылки UpdateLights().

Используется в OnUpdate().

◆ OnBrakesReleased()

void OnBrakesReleased ( )
protected
1111 {
1112 UpdateLights();
1113 }

Перекрестные ссылки UpdateLights().

Используется в OnUpdate().

◆ OnContact()

override void OnContact ( string zoneName,
vector localPos,
IEntity other,
Contact data )
protected

WARNING: Can be called very frequently in one frame, use with caution.

1274 {
1275 if (GetGame().IsServer())
1276 {
1277 #ifdef DIAG_DEVELOPER
1278 m_ContactCalled = true;
1280 {
1281 string output = "Zone: " + zoneName + " | Impulse:" + data.Impulse;
1282 Debug.Log(output);
1283 }
1284 #endif
1285 if (m_ContactCache.Count() == 0)
1286 {
1288 m_ContactCache.Insert(zoneName, ccd);
1289 float momentumDelta = GetMomentum() - m_MomentumPrevTick;
1290 float dot = vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized());
1291 if (dot < 0)
1292 {
1294 }
1295
1297 }
1298 }
1299 }

Перекрестные ссылки vector::Dot(), GetGame(), GetVelocity(), Debug::Log(), m_ContactCache, m_MomentumPrevTick, m_VelocityPrevTick и vector::Normalized().

◆ OnEngineStart()

override void OnEngineStart ( )
protected

Gets called everytime the engine starts.

1759 {
1761 if (GetGame().IsServer() && battery)
1762 {
1763 battery.GetCompEM().ConsumeEnergy(GetBatteryConsumption());
1764 }
1765
1766 UpdateLights();
1767
1769 }
float GetBatteryConsumption()
Definition CarScript.c:2673
void HandleEngineSound(CarEngineSoundState state)
Definition CarScript.c:1555

Перекрестные ссылки GetBattery(), GetBatteryConsumption(), GetGame(), HandleEngineSound() и UpdateLights().

◆ OnEngineStop()

override void OnEngineStop ( )
protected

Gets called everytime the engine stops.

1773 {
1774 UpdateLights();
1775
1777
1778 SetEngineZoneReceivedHit(false);
1779 }

Перекрестные ссылки HandleEngineSound() и UpdateLights().

◆ OnFluidChanged()

override void OnFluidChanged ( CarFluid fluid,
float newValue,
float oldValue )
protected

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.

1679 {
1680 switch ( fluid )
1681 {
1682 case CarFluid.FUEL:
1684 break;
1685
1686 case CarFluid.OIL:
1688 break;
1689
1690 case CarFluid.BRAKE:
1692 break;
1693
1694 case CarFluid.COOLANT:
1696 break;
1697 }
1698 }
float m_BrakeAmmount
Definition CarScript.c:157
float m_CoolantAmmount
Definition CarScript.c:155
float m_OilAmmount
Definition CarScript.c:156
float m_FuelAmmount
keeps ammount of each fluid
Definition CarScript.c:154

Перекрестные ссылки m_BrakeAmmount, m_CoolantAmmount, m_FuelAmmount и m_OilAmmount.

◆ OnGearChanged()

override void OnGearChanged ( int newGear,
int oldGear )
protected
1752 {
1753 //Debug.Log(string.Format("OnGearChanged newGear=%1,oldGear=%2", newGear, oldGear));
1755 }

Перекрестные ссылки UpdateLights().

◆ OnSound()

override float OnSound ( CarSoundCtrl ctrl,
float oldValue )
protected

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.

1474 {
1475 switch (ctrl)
1476 {
1477 case CarSoundCtrl.ENGINE:
1478 if (!m_EngineStarted)
1479 {
1480 return 0.0;
1481 }
1482 break;
1483 }
1484
1485 return oldValue;
1486 }
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Definition Car.c:4
bool m_EngineStarted
Definition CarScript.c:240

Перекрестные ссылки m_EngineStarted.

◆ OnUpdate()

override void OnUpdate ( float dt)
protected
1191 {
1192 if ( GetGame().IsServer() )
1193 {
1195 if ( battery )
1196 {
1197 if ( EngineIsOn() )
1198 {
1199 m_BatteryTimer += dt;
1201 {
1202 battery.GetCompEM().ConsumeEnergy(GetBatteryRechargeRate() * m_BatteryTimer);
1203 m_BatteryTimer = 0;
1204 }
1205 }
1206 else if ( !EngineIsOn() && IsScriptedLightsOn() )
1207 {
1208 m_BatteryTimer += dt;
1210 {
1211 battery.GetCompEM().ConsumeEnergy(GetBatteryRuntimeConsumption() * m_BatteryTimer);
1212 m_BatteryTimer = 0;
1213
1214 if ( battery.GetCompEM().GetEnergy() <= 0 )
1215 {
1217 }
1218 }
1219 }
1220 }
1221
1222 if ( GetGame().GetWaterDepth( GetEnginePosWS() ) > 0 )
1223 {
1224 m_DrownTime += dt;
1226 {
1227 // *dt to get damage per second
1228 AddHealth( "Engine", "Health", -DROWN_ENGINE_DAMAGE * dt);
1229 SetEngineZoneReceivedHit(true);
1230 }
1231 }
1232 else
1233 {
1234 m_DrownTime = 0;
1235 }
1236 }
1237
1238 // For visualisation of brake lights for all players
1239 float brake_coef = GetBrake();
1240 if ( brake_coef > 0 )
1241 {
1242 if ( !m_BrakesArePressed )
1243 {
1244 m_BrakesArePressed = true;
1245 SetSynchDirty();
1247 }
1248 }
1249 else
1250 {
1251 if ( m_BrakesArePressed )
1252 {
1253 m_BrakesArePressed = false;
1254 SetSynchDirty();
1256 }
1257 }
1258
1259 if ( (!GetGame().IsDedicatedServer()) && m_ForceUpdateLights )
1260 {
1261 UpdateLights();
1262 m_ForceUpdateLights = false;
1263 }
1264 }
void OnBrakesPressed()
Definition CarScript.c:1105
float GetBatteryRuntimeConsumption()
Definition CarScript.c:2678
float m_DrownTime
Definition CarScript.c:165
static float DROWN_ENGINE_DAMAGE
Definition CarScript.c:149
bool m_BrakesArePressed
Definition CarScript.c:236
float m_BatteryTimer
Definition CarScript.c:180
static float DROWN_ENGINE_THRESHOLD
Definition CarScript.c:148
const float BATTERY_UPDATE_DELAY
Definition CarScript.c:181
float GetBatteryRechargeRate()
Definition CarScript.c:2683
void OnBrakesReleased()
Definition CarScript.c:1110

Перекрестные ссылки BATTERY_UPDATE_DELAY, DROWN_ENGINE_DAMAGE, DROWN_ENGINE_THRESHOLD, GetBattery(), GetBatteryRechargeRate(), GetBatteryRuntimeConsumption(), GetEnginePosWS(), GetGame(), IsScriptedLightsOn(), m_BatteryTimer, m_BrakesArePressed, m_DrownTime, m_ForceUpdateLights, OnBrakesPressed(), OnBrakesReleased(), ToggleHeadlights() и UpdateLights().

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
protected
632 {
633 super.OnVariablesSynchronized();
634
635 if (GetCrashHeavySound())
636 {
638 }
639 else if (GetCrashLightSound())
640 {
642 }
643
645
648
649 UpdateLights();
650 }
void PlayCrashHeavySound()
Definition CarScript.c:2308
void PlayCrashLightSound()
Definition CarScript.c:2289
bool GetCrashHeavySound()
Definition CarScript.c:2294
void HandleCarHornSound(ECarHornState pState)
Definition CarScript.c:1539
bool GetCrashLightSound()
Definition CarScript.c:2275

Перекрестные ссылки GetCrashHeavySound(), GetCrashLightSound(), HandleCarHornSound(), HandleEngineSound(), m_CarEngineLastSoundState, m_CarEngineSoundState, m_CarHornState, PlayCrashHeavySound(), PlayCrashLightSound() и UpdateLights().

◆ OnVehicleJumpOutServer()

void OnVehicleJumpOutServer ( GetOutTransportActionData gotActionData)
protected
1117 {
1118 PlayerBase player = gotActionData.m_Player;
1119
1121 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("LEGS")));
1122 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BACK")));
1123 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("VEST")));
1124 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("HeadGear")));
1125 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("Mask")));
1126 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BODY")));
1127 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("FEET")));
1128 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("GLOVES")));
1129
1130 // -----------------------------------------------
1132
1133 //Lower shock taken if player uses a helmet
1134 ItemBase headGear = ClothingBase.Cast(player.GetItemOnHead());
1137 shockTaken *= 0.5;
1138
1139 // -----------------------------------------------
1140
1141 int randNum; //value used for probability evaluation
1142 randNum = Math.RandomInt(0, 100);
1144 {
1145 if (randNum < 20)
1146 player.GiveShock(-shockTaken); //To inflict shock, a negative value must be passed
1147
1148 randNum = Math.RandomIntInclusive(0, PlayerBase.m_BleedingSourcesLow.Count() - 1);
1149
1150 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesLow[randNum]);
1151 }
1153 {
1154 if (randNum < 50)
1155 player.GiveShock(-shockTaken);
1156
1157 randNum = Math.RandomInt(0, PlayerBase.m_BleedingSourcesUp.Count() - 1);
1158
1159 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesUp[randNum]);
1160 }
1162 {
1163 if (!headGear)
1164 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection("Head");
1165
1166 if (randNum < 75)
1167 player.GiveShock(-shockTaken);
1168 }
1169
1171
1172 //Damage all currently equipped clothes
1174 {
1175 //If no item is equipped on slot, slot is ignored
1176 if (cloth == null)
1177 continue;
1178
1179 cloth.DecreaseHealth(dmgTaken, false);
1180 }
1181
1182 vector posMS = gotActionData.m_Player.WorldToModel(gotActionData.m_Player.GetPosition());
1183 gotActionData.m_Player.DamageAllLegs(dmgTaken); //Additionnal leg specific damage dealing
1184
1186 healthCoef = Math.Clamp(healthCoef, 0.0, 1.0);
1187 gotActionData.m_Player.ProcessDirectDamage(DamageType.CUSTOM, gotActionData.m_Player, "", "FallDamageHealth", posMS, healthCoef);
1188 }
Definition ActionGetOutTransport.c:24
const int HEALTH_HIGH_SPEED_VALUE
Definition ActionGetOutTransport.c:37
const int SHOCK_FACTOR
Definition ActionGetOutTransport.c:27
const int DMG_FACTOR
Definition ActionGetOutTransport.c:26
const int LOW_SPEED_VALUE
Definition ActionGetOutTransport.c:30
const int HEALTH_LOW_SPEED_VALUE
Definition ActionGetOutTransport.c:36
const int HIGH_SPEED_VALUE
Definition ActionGetOutTransport.c:31
Definition DallasMask.c:2
Definition GreatHelm.c:2
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки Class::CastTo(), Math::Clamp(), ActionGetOutTransport::DMG_FACTOR, ActionGetOutTransport::HEALTH_HIGH_SPEED_VALUE, ActionGetOutTransport::HEALTH_LOW_SPEED_VALUE, ActionGetOutTransport::HIGH_SPEED_VALUE, Math::InverseLerp(), ActionGetOutTransport::LOW_SPEED_VALUE, Math::RandomInt(), Math::RandomIntInclusive() и ActionGetOutTransport::SHOCK_FACTOR.

◆ PlayCrashHeavySound()

void PlayCrashHeavySound ( )
protected
2309 {
2310 PlaySoundEx("offroad_hit_heavy_SoundSet", m_CrashSoundHeavy, m_PlayCrashSoundHeavy);
2311 }

Перекрестные ссылки m_CrashSoundHeavy, m_PlayCrashSoundHeavy и PlaySoundEx().

Используется в OnVariablesSynchronized().

◆ PlayCrashLightSound()

void PlayCrashLightSound ( )
protected
2290 {
2291 PlaySoundEx("offroad_hit_light_SoundSet", m_CrashSoundLight, m_PlayCrashSoundLight);
2292 }

Перекрестные ссылки m_CrashSoundLight, m_PlayCrashSoundLight и PlaySoundEx().

Используется в OnVariablesSynchronized().

◆ PlaySound()

void PlaySound ( string soundset,
ref EffectSound sound,
out bool soundbool )
protected
2338 {
2340 }

Перекрестные ссылки PlaySoundEx().

◆ PlaySoundEx()

void PlaySoundEx ( string soundset,
EffectSound sound,
out bool soundbool )
protected
2314 {
2315 #ifndef SERVER
2316 if (!sound)
2317 {
2319 if( sound )
2320 {
2321 sound.SetAutodestroy(true);
2322 }
2323 }
2324 else
2325 {
2326 if (!sound.IsSoundPlaying())
2327 {
2328 sound.SetPosition(GetPosition());
2329 sound.SoundPlay();
2330 }
2331 }
2332
2333 soundbool = false;
2334 #endif
2335 }
static EffectSound PlaySoundCachedParams(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, using or creating cached SoundParams.
Definition EffectManager.c:207

Перекрестные ссылки GetPosition и SEffectManager::PlaySoundCachedParams().

Используется в EEHealthLevelChanged(), PlayCrashHeavySound(), PlayCrashLightSound() и PlaySound().

◆ RemoveAction()

void RemoveAction ( typename actionName )
protected
2587 {
2589 ActionBase action = player.GetActionManager().GetAction(actionName);
2590 typename ai = action.GetInputType();
2592
2593 if (action_array)
2594 {
2595 action_array.RemoveItem(action);
2596 }
2597 }

Перекрестные ссылки GetGame(), GetPlayer() и m_InputActionMap.

◆ ReverseLightsShineOff()

void ReverseLightsShineOff ( )
protected
2121 {
2122 string material = ConfigGetString("ReverseReflectorMatOff");
2123
2124 if (material)
2125 {
2126 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_L, material);
2127 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_R, material);
2128 }
2129 }
static const int SELECTION_ID_REVERSE_LIGHT_L
Definition CarScript.c:264
static const int SELECTION_ID_REVERSE_LIGHT_R
Definition CarScript.c:265

Перекрестные ссылки SELECTION_ID_REVERSE_LIGHT_L и SELECTION_ID_REVERSE_LIGHT_R.

Используется в UpdateLightsServer().

◆ ReverseLightsShineOn()

void ReverseLightsShineOn ( )
protected
2110 {
2111 string material = ConfigGetString("ReverseReflectorMatOn");
2112
2113 if (material)
2114 {
2115 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_L, material);
2116 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_R, material);
2117 }
2118 }

Перекрестные ссылки SELECTION_ID_REVERSE_LIGHT_L и SELECTION_ID_REVERSE_LIGHT_R.

Используется в UpdateLightsServer().

◆ ReverseRearLight()

void ReverseRearLight ( )
protected
2053 {
2054 m_RearLight.SetAsSegregatedReverseLight();
2055 }

Перекрестные ссылки m_RearLight.

Используется в UpdateLightsClient().

◆ RightFrontLightShineOff()

void RightFrontLightShineOff ( )
protected
2100 {
2101 string material = ConfigGetString("frontReflectorMatOff");
2102
2103 if (material)
2104 {
2105 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_R, material);
2106 }
2107 }
static const int SELECTION_ID_FRONT_LIGHT_R
Definition CarScript.c:261

Перекрестные ссылки SELECTION_ID_FRONT_LIGHT_R.

Используется в UpdateLightsServer().

◆ RightFrontLightShineOn()

void RightFrontLightShineOn ( )
protected
2080 {
2081 string material = ConfigGetString("frontReflectorMatOn");
2082
2083 if (material)
2084 {
2085 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_R, material);
2086 }
2087 }

Перекрестные ссылки SELECTION_ID_FRONT_LIGHT_R.

Используется в UpdateLightsServer().

◆ SetActions()

void SetActions ( )
protected
2545 {
2553 }
CarHornActionData ActionData ActionCarHornShort()
Definition ActionCarHorn.c:67
void AddAction(typename actionName)
Definition CarScript.c:2555
Definition ActionCarHorn.c:209
Definition ActionCloseCarDoorsOutside.c:2
Definition ActionGetInTransport.c:2
Definition ActionOpenCarDoorsOutside.c:2
Definition ActionPushCar.c:44
Definition ActionSwitchLights.c:2

Перекрестные ссылки ActionCarHornShort() и AddAction().

◆ SetCarEngineSoundState()

void SetCarEngineSoundState ( CarEngineSoundState pState)
protected
2715 {
2717 SetSynchDirty();
2718 }

Перекрестные ссылки m_CarEngineSoundState.

Используется в OnBeforeEngineStart().

◆ SetCarHornState()

void SetCarHornState ( int pState)
protected
2703 {
2705 SetSynchDirty();
2706
2707 if (GetGame().IsServer())
2708 {
2710 }
2711 }
void GenerateCarHornAINoise(int pState)
Definition CarScript.c:2720

Перекрестные ссылки GenerateCarHornAINoise(), GetGame() и m_CarHornState.

Используется в OnAction().

◆ SetEngineStarted()

void SetEngineStarted ( bool started)
protected
2465 {
2467 }

Перекрестные ссылки m_EngineStarted.

Используется в HandleEngineSound().

◆ SpawnAdditionalItems()

void SpawnAdditionalItems ( )
protected
2800 {
2801 GetInventory().CreateInInventory("Wrench");
2802 GetInventory().CreateInInventory("LugWrench");
2803 GetInventory().CreateInInventory("Screwdriver");
2804 GetInventory().CreateInInventory("EpoxyPutty");
2805
2806 GetInventory().CreateInInventory("CanisterGasoline");
2807
2808 EntityAI ent;
2810 ent = GetInventory().CreateInInventory("CanisterGasoline");
2811 if (Class.CastTo(container, ent))
2812 {
2813 container.SetLiquidType(LIQUID_WATER, true);
2814 }
2815
2816 ent = GetInventory().CreateInInventory("Blowtorch");
2817 if (ent)
2818 {
2819 ent.GetInventory().CreateInInventory("LargeGasCanister");
2820 }
2821
2822 ent = GetInventory().CreateInInventory("Blowtorch");
2823 if (ent)
2824 {
2825 ent.GetInventory().CreateInInventory("LargeGasCanister");
2826 }
2827 }
const int LIQUID_WATER
Definition constants.c:518

Перекрестные ссылки Class::CastTo() и LIQUID_WATER.

Используется в CarScript::OnDebugSpawn(), CivilianSedan::OnDebugSpawn(), Hatchback_02::OnDebugSpawn(), Sedan_02::OnDebugSpawn() и Truck_01_Covered::OnDebugSpawn().

◆ SpawnUniversalParts()

void SpawnUniversalParts ( )
protected
2762 {
2763 GetInventory().CreateInInventory("HeadlightH7");
2764 GetInventory().CreateInInventory("HeadlightH7");
2765 GetInventory().CreateInInventory("HeadlightH7");
2766 GetInventory().CreateInInventory("HeadlightH7");
2767
2768 if (IsVitalCarBattery())
2769 {
2770 GetInventory().CreateInInventory("CarBattery");
2771 GetInventory().CreateInInventory("CarBattery");
2772 }
2773
2774 if (IsVitalTruckBattery())
2775 {
2776 GetInventory().CreateInInventory("TruckBattery");
2777 GetInventory().CreateInInventory("TruckBattery");
2778 }
2779
2780 if (IsVitalRadiator())
2781 {
2782 GetInventory().CreateInInventory("CarRadiator");
2783 GetInventory().CreateInInventory("CarRadiator");
2784 }
2785
2786 if (IsVitalSparkPlug())
2787 {
2788 GetInventory().CreateInInventory("SparkPlug");
2789 GetInventory().CreateInInventory("SparkPlug");
2790 }
2791
2792 if (IsVitalGlowPlug())
2793 {
2794 GetInventory().CreateInInventory("GlowPlug");
2795 GetInventory().CreateInInventory("GlowPlug");
2796 }
2797 }

Перекрестные ссылки CarScript::IsVitalCarBattery(), CarScript::IsVitalGlowPlug(), CarScript::IsVitalRadiator(), CarScript::IsVitalSparkPlug() и CarScript::IsVitalTruckBattery().

Используется в CarScript::OnDebugSpawn(), CivilianSedan::OnDebugSpawn(), Hatchback_02::OnDebugSpawn(), Sedan_02::OnDebugSpawn() и Truck_01_Covered::OnDebugSpawn().

◆ SynchCrashHeavySound()

void SynchCrashHeavySound ( bool play)
protected
2300 {
2302 {
2304 SetSynchDirty();
2305 }
2306 }

Перекрестные ссылки m_PlayCrashSoundHeavy.

Используется в CheckContactCache().

◆ SynchCrashLightSound()

void SynchCrashLightSound ( bool play)
protected
2281 {
2283 {
2285 SetSynchDirty();
2286 }
2287 }

Перекрестные ссылки m_PlayCrashSoundLight.

Используется в CheckContactCache().

◆ TailLightsShineOff()

void TailLightsShineOff ( )
protected
2179 {
2180 string material = ConfigGetString("TailReflectorMatOff");
2181
2182 if (material)
2183 {
2184 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, material);
2185 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, material);
2186 }
2187 }
static const int SELECTION_ID_TAIL_LIGHT_R
Definition CarScript.c:267
static const int SELECTION_ID_TAIL_LIGHT_L
Definition CarScript.c:266

Перекрестные ссылки SELECTION_ID_TAIL_LIGHT_L и SELECTION_ID_TAIL_LIGHT_R.

Используется в UpdateLightsServer().

◆ TailLightsShineOn()

void TailLightsShineOn ( )
protected
2154 {
2155 string material = ConfigGetString("TailReflectorMatOn");
2156 string materialOff = ConfigGetString("TailReflectorMatOff");
2157
2158 if (material && materialOff)
2159 {
2161 {
2162 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, material);
2163 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, materialOff);
2164 }
2165 else if (m_HeadlightsState == CarHeadlightBulbsState.RIGHT)
2166 {
2167 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, materialOff);
2168 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, material);
2169 }
2171 {
2172 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, material);
2173 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, material);
2174 }
2175 }
2176 }
bool m_HeadlightsState
Definition CarScript.c:235

Перекрестные ссылки m_HeadlightsState, SELECTION_ID_TAIL_LIGHT_L и SELECTION_ID_TAIL_LIGHT_R.

Используется в UpdateLightsServer().

◆ ToggleHeadlights()

void ToggleHeadlights ( )
protected

Switches headlights on/off, including the illumination of the control panel and synchronizes this change to all clients.

1798 {
1800 SetSynchDirty();
1801 }

Перекрестные ссылки m_HeadlightsOn.

Используется в EEItemDetached() и OnUpdate().

◆ TranslateAnimationPhaseToCarDoorState()

CarDoorState TranslateAnimationPhaseToCarDoorState ( string animation)
protected
2475 {
2476 if (GetAnimationPhase(animation) > 0.5)
2477 {
2478 return CarDoorState.DOORS_OPEN;
2479 }
2480 else
2481 {
2482 return CarDoorState.DOORS_CLOSED;
2483 }
2484 }
CarDoorState
Definition CarScript.c:2

Используется в CarScript::GetCarDoorsState().

◆ UpdateHeadlightState()

void UpdateHeadlightState ( )
protected
715 {
716 EntityAI bulb_L = FindAttachmentBySlotName("Reflector_1_1");
717 EntityAI bulb_R = FindAttachmentBySlotName("Reflector_2_1");
718
719 if (bulb_L && !bulb_L.IsRuined() && bulb_R && !bulb_R.IsRuined())
720 {
722 }
723 else if (bulb_L && !bulb_L.IsRuined())
724 {
726 }
727 else if (bulb_R && !bulb_R.IsRuined())
728 {
730 }
731 else if ((!bulb_L || bulb_L.IsRuined()) && (!bulb_R || bulb_R.IsRuined()))
732 {
734 }
735 }

Перекрестные ссылки m_HeadlightsState.

Используется в CheckContactCache(), EEItemAttached(), EEItemDetached() и OnAttachmentRuined().

◆ UpdateLights()

void UpdateLights ( int new_gear = -1)
protected
1804 {
1805 #ifndef SERVER
1807 #endif
1809 }
void UpdateLightsServer(int newGear=-1)
Definition CarScript.c:1930
void UpdateLightsClient(int newGear=-1)
Definition CarScript.c:1811

Перекрестные ссылки UpdateLightsClient() и UpdateLightsServer().

Используется в CheckContactCache(), EEItemAttached(), EEItemDetached(), OnAttachmentRuined(), OnBrakesPressed(), OnBrakesReleased(), OnEngineStart(), OnEngineStop(), OnGearChanged(), OnUpdate() и OnVariablesSynchronized().

◆ UpdateLightsClient()

void UpdateLightsClient ( int newGear = -1)
protected
1812 {
1813 int gear;
1814
1815 if (newGear == -1)
1816 {
1817 gear = GetGear();
1818 }
1819 else
1820 {
1821 gear = newGear;
1822 }
1823
1824 if (m_HeadlightsOn)
1825 {
1827 {
1829 }
1830
1831 if (m_Headlight)
1832 {
1833 switch (m_HeadlightsState)
1834 {
1835 case CarHeadlightBulbsState.LEFT:
1837 m_Headlight.SegregateLight();
1838 break;
1839 case CarHeadlightBulbsState.RIGHT:
1841 m_Headlight.SegregateLight();
1842 break;
1843 case CarHeadlightBulbsState.BOTH:
1844 vector local_pos_left = GetMemoryPointPos(m_LeftHeadlightPoint);
1845 vector local_pos_right = GetMemoryPointPos(m_RightHeadlightPoint);
1846
1848 m_Headlight.AttachOnObject(this, local_pos_middle);
1849 m_Headlight.AggregateLight();
1850 break;
1851 default:
1852 m_Headlight.FadeOut();
1853 m_Headlight = null;
1854 }
1855 }
1856 }
1857 else
1858 {
1859 if (m_Headlight)
1860 {
1861 m_Headlight.FadeOut();
1862 m_Headlight = null;
1863 }
1864 }
1865
1866 // brakes & reverse
1867 switch (gear)
1868 {
1869 case CarGear.REVERSE:
1872 m_RearLightType = CarRearLightType.BRAKES_AND_REVERSE;
1873 else
1874 m_RearLightType = CarRearLightType.REVERSE_ONLY;
1875 break;
1876 default:
1878 m_RearLightType = CarRearLightType.BRAKES_ONLY;
1879 else
1881 }
1882
1883 //Debug.Log(string.Format("m_BrakesArePressed=%1, m_RearLightType=%2", m_BrakesArePressed.ToString(), EnumTools.EnumToString(CarRearLightType, m_RearLightType)));
1884
1886 {
1887 if (EngineIsOn() || m_RearLightType == CarRearLightType.BRAKES_ONLY || m_RearLightType == CarRearLightType.BRAKES_AND_REVERSE)
1888 {
1890 vector localPos = GetMemoryPointPos(m_ReverseLightPoint);
1891 m_RearLight.AttachOnObject(this, localPos, "180 0 0");
1892 }
1893 }
1894
1895 // rear lights
1897 {
1898 switch (m_RearLightType)
1899 {
1900 case CarRearLightType.BRAKES_ONLY:
1902 break;
1903 case CarRearLightType.REVERSE_ONLY:
1904 if (EngineIsOn())
1906 else
1907 NoRearLight();
1908
1909 break;
1910 case CarRearLightType.BRAKES_AND_REVERSE:
1911 if (EngineIsOn())
1913 else
1915
1916 break;
1917 default:
1918 NoRearLight();
1919 }
1920 }
1921 else
1922 {
1923 if (m_RearLight)
1924 {
1925 NoRearLight();
1926 }
1927 }
1928 }
CarAutomaticGearboxMode
Enumerated automatic gearbox modes. (native, do not change or extend)
Definition Car.c:69
CarLightBase CreateFrontLight()
Definition CarScript.c:2216
static string m_RightHeadlightPoint
Definition CarScript.c:253
static string m_LeftHeadlightPoint
Definition CarScript.c:252
static string m_ReverseLightPoint
Definition CarScript.c:251
CarRearLightBase CreateRearLight()
Definition CarScript.c:2210
void BrakesRearLight()
Definition CarScript.c:2047
static string m_LeftHeadlightTargetPoint
Definition CarScript.c:254
void NoRearLight()
Definition CarScript.c:2063
void BrakeAndReverseRearLight()
Definition CarScript.c:2057
static string m_RightHeadlightTargetPoint
Definition CarScript.c:255
void ReverseRearLight()
Definition CarScript.c:2052
bool m_RearLightType
Definition CarScript.c:237

Перекрестные ссылки BrakeAndReverseRearLight(), BrakesRearLight(), CarScript::CreateFrontLight(), CarScript::CreateRearLight(), m_BrakesArePressed, m_Headlight, m_HeadlightsOn, m_HeadlightsState, m_LeftHeadlightPoint, m_LeftHeadlightTargetPoint, m_RearLight, m_RearLightType, m_ReverseLightPoint, m_RightHeadlightPoint, m_RightHeadlightTargetPoint, NoRearLight() и ReverseRearLight().

Используется в UpdateLights().

◆ UpdateLightsServer()

void UpdateLightsServer ( int newGear = -1)
protected
1931 {
1932 int gear;
1933
1934 if (newGear == -1)
1935 {
1936 gear = GetGear();
1937 if (GearboxGetType() == CarGearboxType.AUTOMATIC)
1938 {
1939 gear = GearboxGetMode();
1940 }
1941 }
1942 else
1943 {
1944 gear = newGear;
1945 }
1946
1947 if (m_HeadlightsOn)
1948 {
1951
1952 switch (m_HeadlightsState)
1953 {
1954 case CarHeadlightBulbsState.LEFT:
1957 break;
1958 case CarHeadlightBulbsState.RIGHT:
1961 break;
1962 case CarHeadlightBulbsState.BOTH:
1965 break;
1966 default:
1969 }
1970
1971 //Debug.Log(string.Format("m_HeadlightsOn=%1, m_HeadlightsState=%2", m_HeadlightsOn.ToString(), EnumTools.EnumToString(CarHeadlightBulbsState, m_HeadlightsState)));
1972 }
1973 else
1974 {
1979 }
1980
1981
1982 // brakes & reverse
1983 switch (gear)
1984 {
1985 case CarGear.REVERSE:
1988 m_RearLightType = CarRearLightType.BRAKES_AND_REVERSE;
1989 else
1990 m_RearLightType = CarRearLightType.REVERSE_ONLY;
1991 break;
1992 default:
1994 m_RearLightType = CarRearLightType.BRAKES_ONLY;
1995 else
1997 }
1998
1999 //Debug.Log(string.Format("m_BrakesArePressed=%1, m_RearLightType=%2", m_BrakesArePressed.ToString(), EnumTools.EnumToString(CarRearLightType, m_RearLightType)));
2000
2001
2002 // rear lights
2004 {
2005 switch (m_RearLightType)
2006 {
2007 case CarRearLightType.BRAKES_ONLY:
2010 break;
2011 case CarRearLightType.REVERSE_ONLY:
2012 if (EngineIsOn())
2013 {
2016 }
2017 else
2018 {
2021 }
2022 break;
2023 case CarRearLightType.BRAKES_AND_REVERSE:
2024 if (EngineIsOn())
2025 {
2028 }
2029 else
2030 {
2033 }
2034 break;
2035 default:
2038 }
2039 }
2040 else
2041 {
2044 }
2045 }
CarGearboxType
Enumerated gearbox types. (native, do not change or extend)
Definition Car.c:35
void ReverseLightsShineOn()
Definition CarScript.c:2109
void TailLightsShineOn()
Definition CarScript.c:2153
void BrakeLightsShineOff()
Definition CarScript.c:2142
void DashboardShineOff()
Definition CarScript.c:2199
void BrakeLightsShineOn()
Definition CarScript.c:2131
void ReverseLightsShineOff()
Definition CarScript.c:2120
void RightFrontLightShineOn()
Definition CarScript.c:2079
void DashboardShineOn()
Definition CarScript.c:2189
void LeftFrontLightShineOn()
Definition CarScript.c:2069
void LeftFrontLightShineOff()
Definition CarScript.c:2089
void RightFrontLightShineOff()
Definition CarScript.c:2099
void TailLightsShineOff()
Definition CarScript.c:2178

Перекрестные ссылки BrakeLightsShineOff(), BrakeLightsShineOn(), DashboardShineOff(), DashboardShineOn(), LeftFrontLightShineOff(), LeftFrontLightShineOn(), m_BrakesArePressed, m_HeadlightsOn, m_HeadlightsState, m_RearLightType, ReverseLightsShineOff(), ReverseLightsShineOn(), RightFrontLightShineOff(), RightFrontLightShineOn(), TailLightsShineOff() и TailLightsShineOn().

Используется в UpdateLights().

◆ ~CarScript()

void ~CarScript ( )
protected
509 {
510 #ifndef SERVER
512 #endif
513 }

Перекрестные ссылки CleanupEffects().

Переменные

◆ BATTERY_UPDATE_DELAY

const float BATTERY_UPDATE_DELAY = 100
private

Используется в OnUpdate().

◆ BRAKES_ONLY

enum CarDoorState BRAKES_ONLY

◆ DROWN_ENGINE_DAMAGE

float DROWN_ENGINE_DAMAGE = 350.0
staticprotected

Используется в OnUpdate().

◆ DROWN_ENGINE_THRESHOLD

float DROWN_ENGINE_THRESHOLD = 0.5
staticprotected

Используется в OnUpdate().

◆ LEFT

◆ LONG

◆ m_ActionsInitialize

bool m_ActionsInitialize

◆ m_backPos

vector m_backPos
protected

Используется в CarScript() и GetBackPointPosWS().

◆ m_BatteryConsume

float m_BatteryConsume = 15
protected

Используется в GetBatteryConsumption().

◆ m_BatteryContinuousConsume

float m_BatteryContinuousConsume = 0.25
protected

Используется в GetBatteryRuntimeConsumption().

◆ m_BatteryEnergyStartMin

float m_BatteryEnergyStartMin = 5.0
protected

Используется в OnBeforeEngineStart().

◆ m_BatteryHealth

float m_BatteryHealth
protected

Используется в CarScript(), EEItemAttached() и EEItemDetached().

◆ m_BatteryRecharge

float m_BatteryRecharge = 0.15
protected

Используется в GetBatteryRechargeRate().

◆ m_BatteryTimer

float m_BatteryTimer = 0
private

Используется в OnUpdate().

◆ m_BrakeAmmount

float m_BrakeAmmount
protected

Используется в OnFluidChanged().

◆ m_BrakesArePressed

bool m_BrakesArePressed
protected

Используется в OnUpdate(), UpdateLightsClient() и UpdateLightsServer().

◆ m_CarDoorCloseSound

◆ m_CarDoorOpenSound

◆ m_CarEngineLastSoundState

int m_CarEngineLastSoundState
protected

Используется в HandleEngineSound() и OnVariablesSynchronized().

◆ m_CarEngineSoundState

int m_CarEngineSoundState
protected

◆ m_CarHornLongSoundName

◆ m_CarHornShortSoundName

◆ m_CarHornSoundEffect

ref EffectSound m_CarHornSoundEffect
protected

Используется в CleanupEffects() и HandleCarHornSound().

◆ m_CarHornState

int m_CarHornState
protected

Используется в CarScript(), OnVariablesSynchronized() и SetCarHornState().

◆ m_CarSeatShiftInSound

string m_CarSeatShiftInSound = ""
protected

◆ m_CarSeatShiftOutSound

string m_CarSeatShiftOutSound = ""
protected

◆ m_CarTypeActionsMap

enum CarDoorState m_CarTypeActionsMap = new map<typename, ref TInputActionMap>

Используется в InitializeActions().

◆ m_ContactCache

ref CarContactCache m_ContactCache
protected

Используется в CarScript(), CheckContactCache() и OnContact().

◆ m_CoolantAmmount

float m_CoolantAmmount
protected

Используется в OnFluidChanged().

◆ m_coolantFx

ref EffVehicleSmoke m_coolantFx
protected

Particles.

Используется в CleanupEffects() и EOnPostSimulate().

◆ m_coolantPtcFx

int m_coolantPtcFx
protected

Используется в CarScript() и EOnPostSimulate().

◆ m_coolantPtcPos

vector m_coolantPtcPos
protected

Используется в CarScript(), EOnPostSimulate() и GetCoolantPtcPosWS().

◆ m_CrashSoundHeavy

ref EffectSound m_CrashSoundHeavy
protected

Используется в CleanupEffects() и PlayCrashHeavySound().

◆ m_CrashSoundLight

ref EffectSound m_CrashSoundLight
protected

Используется в CleanupEffects() и PlayCrashLightSound().

◆ m_dmgContactCoef

float m_dmgContactCoef = 0.058
protected

Используется в CheckContactCache() и CarScript::Sedan_02().

◆ m_DrownEnginePoint

string m_DrownEnginePoint = "drown_engine"
staticprotected

◆ m_DrownEnginePos

vector m_DrownEnginePos
staticprotected

Используется в CarScript() и GetEnginePosWS().

◆ m_DrownTime

float m_DrownTime
protected

Используется в OnUpdate().

◆ m_EngineDestroyed

bool m_EngineDestroyed
protected

Используется в EEKilled().

◆ m_engineFx

ref EffVehicleSmoke m_engineFx
protected

Используется в CleanupEffects() и CreateCarDestroyedEffect().

◆ m_EngineHealth

float m_EngineHealth
protected

◆ m_enginePos

vector m_enginePos
protected

Используется в CarScript() и GetEnginePointPosWS().

◆ m_enginePtcFx

int m_enginePtcFx
protected

Используется в CarScript() и CreateCarDestroyedEffect().

◆ m_enginePtcPos

vector m_enginePtcPos
protected

◆ m_EngineStartBattery

◆ m_EngineStarted

bool m_EngineStarted
protected

Используется в OnSound() и SetEngineStarted().

◆ m_EngineStartFuel

◆ m_EngineStartOK

◆ m_EngineStartPlug

◆ m_EngineStopFuel

◆ m_EnviroHeatComfortOverride

float m_EnviroHeatComfortOverride
protected

Используется в CarScript().

◆ m_exhaustFx

ref EffVehicleSmoke m_exhaustFx
protected

Используется в CleanupEffects() и EOnPostSimulate().

◆ m_exhaustPtcDir

vector m_exhaustPtcDir
protected

Используется в CarScript() и EOnPostSimulate().

◆ m_exhaustPtcFx

int m_exhaustPtcFx
protected

Используется в CarScript() и EOnPostSimulate().

◆ m_exhaustPtcPos

vector m_exhaustPtcPos
protected

Используется в CarScript() и EOnPostSimulate().

◆ m_ForceUpdateLights

bool m_ForceUpdateLights
protected

◆ m_frontPos

vector m_frontPos
protected

Используется в CarScript() и GetFrontPointPosWS().

◆ m_FuelAmmount

float m_FuelAmmount
protected

keeps ammount of each fluid

Используется в OnFluidChanged().

◆ m_FuelTankHealth

float m_FuelTankHealth
protected

◆ m_Headlight

CarLightBase m_Headlight
protected

Используется в CleanupEffects() и UpdateLightsClient().

◆ m_HeadlightsOn

bool m_HeadlightsOn
protected

◆ m_HeadlightsState

bool m_HeadlightsState
protected

◆ m_InputActionMap

TInputActionMap m_InputActionMap

◆ m_LeftHeadlightPoint

string m_LeftHeadlightPoint = "light_left"
staticprotected

Используется в UpdateLightsClient().

◆ m_LeftHeadlightTargetPoint

string m_LeftHeadlightTargetPoint = "light_left_dir"
staticprotected

Используется в UpdateLightsClient().

◆ m_MomentumPrevTick

float m_MomentumPrevTick
protected

Используется в CheckContactCache(), EOnPostSimulate() и OnContact().

◆ m_NoisePar

ref NoiseParams m_NoisePar
protected

◆ m_NoiseSystem

NoiseSystem m_NoiseSystem
protected

Используется в EEInit() и GenerateCarHornAINoise().

◆ m_OilAmmount

float m_OilAmmount
protected

Используется в OnFluidChanged().

◆ m_PlayCrashSoundHeavy

bool m_PlayCrashSoundHeavy
protected

◆ m_PlayCrashSoundLight

bool m_PlayCrashSoundLight
protected

◆ m_PlugHealth

float m_PlugHealth
protected

Используется в CarScript(), EEItemAttached() и EEItemDetached().

◆ m_PreStartSound

ref EffectSound m_PreStartSound
private

Используется в HandleEngineSound().

◆ m_Radiator

EntityAI m_Radiator
protected

Используется в EEItemAttached(), EEItemDetached(), GetRadiator() и HasRadiator().

◆ m_RadiatorHealth

float m_RadiatorHealth
protected

◆ m_RearLight

◆ m_RearLightType

bool m_RearLightType
protected

Используется в UpdateLightsClient() и UpdateLightsServer().

◆ m_ReverseLightPoint

string m_ReverseLightPoint = "light_reverse"
staticprotected

Используется в UpdateLightsClient().

◆ m_RightHeadlightPoint

string m_RightHeadlightPoint = "light_right"
staticprotected

Используется в UpdateLightsClient().

◆ m_RightHeadlightTargetPoint

string m_RightHeadlightTargetPoint = "light_right_dir"
staticprotected

Используется в UpdateLightsClient().

◆ m_side_1_1Pos

vector m_side_1_1Pos
protected

Используется в CarScript() и Get_1_1PointPosWS().

◆ m_side_1_2Pos

vector m_side_1_2Pos
protected

Используется в CarScript() и Get_1_2PointPosWS().

◆ m_side_2_1Pos

vector m_side_2_1Pos
protected

Используется в CarScript() и Get_2_1PointPosWS().

◆ m_side_2_2Pos

vector m_side_2_2Pos
protected

Используется в CarScript() и Get_2_2PointPosWS().

◆ m_Time

float m_Time
protected

◆ m_VelocityPrevTick

vector m_VelocityPrevTick
protected

Используется в CheckContactCache(), EOnPostSimulate() и OnContact().

◆ m_WheelSmokeFx

ref array<ref EffWheelSmoke> m_WheelSmokeFx
protected

Используется в CarScript(), CleanupEffects() и EOnPostSimulate().

◆ m_WheelSmokePtcFx

ref array<int> m_WheelSmokePtcFx
protected

Используется в CarScript(), CleanupEffects() и EOnPostSimulate().

◆ m_WindowLarge

ref EffectSound m_WindowLarge
protected

Используется в CleanupEffects() и EEHealthLevelChanged().

◆ m_WindowSmall

ref EffectSound m_WindowSmall
protected

Используется в CleanupEffects() и EEHealthLevelChanged().

◆ MEMORY_POINT_NAME_CAR_HORN

const string MEMORY_POINT_NAME_CAR_HORN = "pos_carHorn"
staticprotected

◆ NONE

◆ OFF

enum CarDoorState OFF = 0

◆ REVERSE_ONLY

enum CarDoorState REVERSE_ONLY

◆ RIGHT

◆ SELECTION_ID_BRAKE_LIGHT_L

const int SELECTION_ID_BRAKE_LIGHT_L = 2
staticprotected

Используется в BrakeLightsShineOff() и BrakeLightsShineOn().

◆ SELECTION_ID_BRAKE_LIGHT_R

const int SELECTION_ID_BRAKE_LIGHT_R = 3
staticprotected

Используется в BrakeLightsShineOff() и BrakeLightsShineOn().

◆ SELECTION_ID_DASHBOARD_LIGHT

const int SELECTION_ID_DASHBOARD_LIGHT = 8
staticprotected

Используется в DashboardShineOff() и DashboardShineOn().

◆ SELECTION_ID_FRONT_LIGHT_L

const int SELECTION_ID_FRONT_LIGHT_L = 0
staticprotected

Используется в LeftFrontLightShineOff() и LeftFrontLightShineOn().

◆ SELECTION_ID_FRONT_LIGHT_R

const int SELECTION_ID_FRONT_LIGHT_R = 1
staticprotected

Используется в RightFrontLightShineOff() и RightFrontLightShineOn().

◆ SELECTION_ID_REVERSE_LIGHT_L

const int SELECTION_ID_REVERSE_LIGHT_L = 4
staticprotected

Используется в ReverseLightsShineOff() и ReverseLightsShineOn().

◆ SELECTION_ID_REVERSE_LIGHT_R

const int SELECTION_ID_REVERSE_LIGHT_R = 5
staticprotected

Используется в ReverseLightsShineOff() и ReverseLightsShineOn().

◆ SELECTION_ID_TAIL_LIGHT_L

const int SELECTION_ID_TAIL_LIGHT_L = 6
staticprotected

Используется в TailLightsShineOff() и TailLightsShineOn().

◆ SELECTION_ID_TAIL_LIGHT_R

const int SELECTION_ID_TAIL_LIGHT_R = 7
staticprotected

Используется в TailLightsShineOff() и TailLightsShineOn().

◆ SHORT

enum CarDoorState SHORT = 1

◆ START_NO_BATTERY

enum CarDoorState START_NO_BATTERY

◆ START_NO_FUEL

enum CarDoorState START_NO_FUEL

◆ START_NO_SPARKPLUG

enum CarDoorState START_NO_SPARKPLUG

◆ START_OK

enum CarDoorState START_OK

◆ STARTING

enum CarDoorState STARTING

◆ STOP_OK

enum CarDoorState STOP_OK

◆ typename

enum CarDoorState typename

Base script class for all motorized wheeled vehicles.