73 Print(
"Vehicle; DamageType; Damage; Zone; Momentum; Momentum Prev; Momentum Delta; Speedometer; SpeedWorld; SpeedWorld Prev; SpeedWorld Delta; Velocity; Velocity Prev; Velocity Dot; TimeStamp (ms); CrewDamageBase; ShockTemp; DMGHealth; DMGShock");
80 string output =
data.m_VehicleType +
";" +
data.m_DamageType +
";" +
data.m_Damage +
";" +
data.m_Zone +
";" +
data.m_MomentumCurr +
";" +
data.m_MomentumPrev +
";" +
data.m_MomentumDelta +
";" +
data.m_Speedometer;
81 output +=
";" +
data.m_SpeedWorld +
";" +
data.m_SpeedWorldPrev +
";" +
data.m_SpeedWorldDelta +
";" +
data.m_VelocityCur;
82 output +=
";" +
data.m_VelocityPrev +
";" +
data.m_VelocityDot +
";" +
data.m_Time +
";" +
data.m_CrewDamageBase +
";" +
data.m_ShockTemp +
";" +
data.m_DMGHealth +
";" +
data.m_DMGShock;
314 RegisterNetSyncVariableBool(
"m_HeadlightsOn");
315 RegisterNetSyncVariableBool(
"m_BrakesArePressed");
316 RegisterNetSyncVariableBool(
"m_ForceUpdateLights");
317 RegisterNetSyncVariableBool(
"m_EngineZoneReceivedHit");
318 RegisterNetSyncVariableBoolSignal(
"m_PlayCrashSoundLight");
319 RegisterNetSyncVariableBoolSignal(
"m_PlayCrashSoundHeavy");
322 if (MemoryPointExists(
"ptcExhaust_end"))
325 if (MemoryPointExists(
"ptcExhaust_start"))
343 if (MemoryPointExists(
"ptcEnginePos"))
348 if (MemoryPointExists(
"ptcCoolantPos"))
353 if (MemoryPointExists(
"refill"))
358 if (MemoryPointExists(
"drown_engine"))
363 if (MemoryPointExists(
"dmgZone_engine"))
368 if (MemoryPointExists(
"dmgZone_front"))
369 m_frontPos = GetMemoryPointPos(
"dmgZone_front");
373 if (MemoryPointExists(
"dmgZone_back"))
374 m_backPos = GetMemoryPointPos(
"dmgZone_back");
378 if (MemoryPointExists(
"dmgZone_fender_1_1"))
383 if (MemoryPointExists(
"dmgZone_fender_1_2"))
388 if (MemoryPointExists(
"dmgZone_fender_2_1"))
393 if (MemoryPointExists(
"dmgZone_fender_2_2"))
423 for (
int i = 5;
i > 0;
i--)
425 if (!
GetGame().IsMultiplayer())
618 super.OnVariablesSynchronized();
646 case "Reflector_1_1":
648 SetHealth(
"Reflector_1_1",
"Health",
item.GetHealth());
650 case "Reflector_2_1":
652 SetHealth(
"Reflector_2_1",
"Health",
item.GetHealth());
714 if (
GetGame().IsServer() && EngineIsOn())
723 if (m_DamageZoneMap.Contains(
"Radiator"))
724 SetHealth(
"Radiator",
"Health", 0);
761 case "wheel_spare_1":
762 case "wheel_spare_2":
789 case "wheel_spare_1":
790 case "wheel_spare_2":
819 Debug.
Log(
"--------------------------------------------------------------------");
846 if (
GetGame().IsServer() && EngineIsOn())
873 if (EngineGetRPM() >= EngineGetRPMRedline())
875 if (EngineGetRPM() > EngineGetRPMMax())
876 AddHealth(
"Engine",
"Health", -GetMaxHealth(
"Engine",
"") * 0.05);
906 if (GetFluidFraction(
CarFluid.COOLANT) < 0.5 && GetFluidFraction(
CarFluid.COOLANT) >= 0)
909 AddHealth(
"Engine",
"Health", -
dmg);
916 if (!
GetGame().IsDedicatedServer())
935 if (GetFluidFraction(
CarFluid.COOLANT) > 0)
951 if (!
GetGame().IsDedicatedServer())
1003 if (
battery.GetCompEM().GetEnergy() <= 0)
1062#ifdef DIAG_DEVELOPER
1102#ifdef DIAG_DEVELOPER
1104 CrashDebugData.m_CrashDataPoint.m_VehicleType = GetDisplayName();
1121 Debug.
Log(
"--------------------------------------------------");
1122 Debug.
Log(
"Vehicle:" + GetDisplayName());
1135 Debug.
Log(
"--------------------------------------------------");
1142#ifdef DIAG_DEVELOPER
1144 CrashDebugData.m_CrashDataPoint.m_Speedometer = GetSpeedometer();
1149#ifdef DIAG_DEVELOPER
1159#ifdef DIAG_DEVELOPER
1186 for (
int c = 0;
c < CrewSize(); ++
c)
1197#ifdef DIAG_DEVELOPER
1202 Debug.
Log(
"--------------------------------------------------");
1205 Debug.
Log(
"--------------------------------------------------");
1218#ifdef DIAG_DEVELOPER
1225 Debug.
Log(
"--------------------------------------------------");
1230 Debug.
Log(
"--------------------------------------------------");
1235 player.AddHealth(
"",
"Health", -
hp);
1272 case "doorscodriver":
1284 sound.SetAutodestroy(
true);
1295 case "seatcodriver":
1303 sound.SetAutodestroy(
true);
1343 if (!
player.IsCameraInsideVehicle())
1351 sound.SetAutodestroy(
true);
1361 sound.SetAutodestroy(
true);
1366 sound.SetAutodestroy(
true);
1371 sound.SetAutodestroy(
true);
1379 if (!
player.IsCameraInsideVehicle())
1387 sound.SetAutodestroy(
true);
1496 if (GetFluidFraction(
CarFluid.FUEL) <= 0)
1515 item = FindAttachmentBySlotName(
"SparkPlug");
1526 item = FindAttachmentBySlotName(
"GlowPlug");
1724 gear = GearboxGetMode();
1853 string material = ConfigGetString(
"frontReflectorMatOn");
1861 string material = ConfigGetString(
"frontReflectorMatOn");
1869 string material = ConfigGetString(
"frontReflectorMatOff");
1877 string material = ConfigGetString(
"frontReflectorMatOff");
1885 string material = ConfigGetString(
"ReverseReflectorMatOn");
1896 string material = ConfigGetString(
"ReverseReflectorMatOff");
1907 string material = ConfigGetString(
"brakeReflectorMatOn");
1918 string material = ConfigGetString(
"brakeReflectorMatOff");
1929 string material = ConfigGetString(
"TailReflectorMatOn");
1930 string materialOff = ConfigGetString(
"TailReflectorMatOff");
1954 string material = ConfigGetString(
"TailReflectorMatOff");
1965 string material = ConfigGetString(
"dashboardMatOn");
1973 string material = ConfigGetString(
"dashboardMatOff");
2000 else if (
item.IsRuined())
2086 sound.SetAutodestroy(
true);
2090 if (!
sound.IsSoundPlaying())
2116 return "seat_con_1_1";
2118 case "seat_codriver":
2119 return "seat_con_2_1";
2122 return "seat_con_1_2";
2125 return "seat_con_2_2";
2216 return GetSpeedometerAbsolute() > 3.5;
2221 return GetHandbrake() > 0.0;
2271 return "carradiator";
2281 return "carradiator";
2292 if (!m_InputActionMap)
2333 typename ai =
action.GetInputType();
2356 typename ai =
action.GetInputType();
2385 case "WindowFrontLeft":
2386 case "WindowFrontRight":
2446 return ItemBase.Cast(FindAttachmentBySlotName(
"CarBattery"));
2448 return ItemBase.Cast(FindAttachmentBySlotName(
"TruckBattery"));
2518 GetInventory().CreateInInventory(
"HeadlightH7");
2519 GetInventory().CreateInInventory(
"HeadlightH7");
2520 GetInventory().CreateInInventory(
"HeadlightH7");
2521 GetInventory().CreateInInventory(
"HeadlightH7");
2525 GetInventory().CreateInInventory(
"CarBattery");
2526 GetInventory().CreateInInventory(
"CarBattery");
2531 GetInventory().CreateInInventory(
"TruckBattery");
2532 GetInventory().CreateInInventory(
"TruckBattery");
2537 GetInventory().CreateInInventory(
"CarRadiator");
2538 GetInventory().CreateInInventory(
"CarRadiator");
2543 GetInventory().CreateInInventory(
"SparkPlug");
2544 GetInventory().CreateInInventory(
"SparkPlug");
2549 GetInventory().CreateInInventory(
"GlowPlug");
2550 GetInventory().CreateInInventory(
"GlowPlug");
2556 GetInventory().CreateInInventory(
"Wrench");
2557 GetInventory().CreateInInventory(
"LugWrench");
2558 GetInventory().CreateInInventory(
"Screwdriver");
2559 GetInventory().CreateInInventory(
"EpoxyPutty");
2561 GetInventory().CreateInInventory(
"CanisterGasoline");
2565 ent = GetInventory().CreateInInventory(
"CanisterGasoline");
2569 ent = GetInventory().CreateInInventory(
"Blowtorch");
2571 ent.GetInventory().CreateInInventory(
"LargeGasCanister");
2573 ent = GetInventory().CreateInInventory(
"Blowtorch");
2575 ent.GetInventory().CreateInInventory(
"LargeGasCanister");
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
CarHornActionData ActionData ActionCarHornShort()
map< typename, ref array< ActionBase_Basic > > TInputActionMap
ref NoiseParams m_NoisePar
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
class PASBroadcaster extends AdvancedCommunication IsInventoryVisible
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
override void OnVariablesSynchronized()
override void EEItemDetached(EntityAI item, string slot_name)
override void EEItemAttached(EntityAI item, string slot_name)
CarAutomaticGearboxMode
Enumerated automatic gearbox modes. (native, do not change or extend)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
CarGearboxType
Enumerated gearbox types. (native, do not change or extend)
void CreateCarDestroyedEffect()
void SetEngineStarted(bool started)
bool m_EngineZoneReceivedHit
static const int SELECTION_ID_TAIL_LIGHT_R
ref set< int > m_DeadCrewMemberIndices
override void MarkCrewMemberUnconscious(int crewMemberIndex)
void SpawnUniversalParts()
string m_CarSeatShiftInSound
void ReverseLightsShineOn()
enum CarDoorState START_NO_BATTERY
vector m_VelocityPrevTick
enum CarDoorState START_NO_FUEL
CarDoorState TranslateAnimationPhaseToCarDoorState(string animation)
float GetEnviroHeatComfortOverride()
DEPRECATED.
void SpawnAdditionalItems()
void BrakeLightsShineOff()
override void MarkCrewMemberDead(int crewMemberIndex)
float GetActionDistanceBrakes()
ref EffVehicleSmoke m_coolantFx
Particles.
string m_EngineStartOK
Sounds.
void PlayCrashHeavySound()
static string m_RightHeadlightPoint
enum CarDoorState m_CarTypeActionsMap
override int Get3rdPersonCameraType()
camera type
float GetBatteryRuntimeConsumption()
float GetBatteryConsumption()
void UpdateLightsServer(int newGear=-1)
void BrakeLightsShineOn()
void CheckVitalItem(bool isVital, string itemName)
static string m_DrownEnginePoint
void ReverseLightsShineOff()
override bool OnBeforeEngineStart()
void GenerateCarHornAINoise(int pState)
string m_CarDoorCloseSound
void SetEngineZoneReceivedHit(bool pState)
ref EffectSound m_WindowLarge
static string m_LeftHeadlightPoint
void RightFrontLightShineOn()
void ForceUpdateLightsStart()
void PlayCrashLightSound()
static string m_ReverseLightPoint
void DamageCrew(float dmg)
Responsible for damaging crew in a car crash.
static const int SELECTION_ID_BRAKE_LIGHT_R
void ForceUpdateLightsEnd()
void CleanupSound(EffectSound sound)
ref EffectSound m_WindowSmall
static const int SELECTION_ID_REVERSE_LIGHT_L
string m_EngineStartBattery
ref EffVehicleSmoke m_engineFx
ref set< int > m_UnconsciousCrewMemberIndices
enum CarDoorState STOP_OK
float m_BatteryEnergyStartMin
static string m_LeftHeadlightTargetPoint
vector GetRefillPointPosWS()
float m_EnviroHeatComfortOverride
bool GetCrashHeavySound()
string GetActionCompNameCoolant()
void CheckContactCache()
Responsible for damaging the car according to contact events from OnContact.
static float DROWN_ENGINE_DAMAGE
float m_BatteryContinuousConsume
string GetActionCompNameBrakes()
ref EffectSound m_PreStartSound
bool m_PlayCrashSoundLight
ref EffectSound m_CrashSoundHeavy
void SetCarHornState(int pState)
static const int SELECTION_ID_BRAKE_LIGHT_L
override void OnFluidChanged(CarFluid fluid, float newValue, float oldValue)
override vector GetDefaultHitPosition()
void HandleCarHornSound(ECarHornState pState)
void UpdateLightsClient(int newGear=-1)
override void HandleByCrewMemberState(ECrewMemberState state)
vector Get_1_2PointPosWS()
void PlaySoundEx(string soundset, EffectSound sound, out bool soundbool)
void LeakFluid(CarFluid fluid)
string m_CarHornShortSoundName
NoiseSystem m_NoiseSystem
static const int SELECTION_ID_FRONT_LIGHT_R
vector Get_2_2PointPosWS()
void BrakeAndReverseRearLight()
void UpdateLights(int new_gear=-1)
static float DROWN_ENGINE_THRESHOLD
static const int SELECTION_ID_FRONT_LIGHT_L
static string m_RightHeadlightTargetPoint
vector Get_1_1PointPosWS()
const float BATTERY_UPDATE_DELAY
enum CarDoorState STARTING
float GetActionDistanceFuel()
override void OnGearChanged(int newGear, int oldGear)
float GetActionDistanceOil()
string GetActionCompNameOil()
bool HasEngineZoneReceivedHit()
float GetActionDistanceCoolant()
static const string MEMORY_POINT_NAME_CAR_HORN
vector GetEnginePointPosWS()
vector GetCoolantPtcPosWS()
static const int SELECTION_ID_TAIL_LIGHT_L
vector GetFrontPointPosWS()
void ToggleHeadlights()
Switches headlights on/off, including the illumination of the control panel and synchronizes this cha...
enum CarDoorState REVERSE_ONLY
float GetBatteryRechargeRate()
float m_FuelAmmount
keeps ammount of each fluid
void LeftFrontLightShineOn()
void HandleDoorsSound(string animSource, float phase)
enum CarDoorState START_OK
override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance=1.0)
void LeftFrontLightShineOff()
string m_CarHornLongSoundName
override void OnContact(string zoneName, vector localPos, IEntity other, Contact data)
WARNING: Can be called very frequently in one frame, use with caution.
ref EffVehicleSmoke m_exhaustFx
vector GetBackPointPosWS()
CarRearLightBase m_RearLight
enum CarDoorState BRAKES_ONLY
ref EffectSound m_CrashSoundLight
bool OnBeforeSwitchLights(bool toOn)
string GetActionCompNameFuel()
void SynchCrashHeavySound(bool play)
void RightFrontLightShineOff()
ref EffectSound m_CarHornSoundEffect
void TailLightsShineOff()
void UpdateHeadlightState()
void SynchCrashLightSound(bool play)
bool GetCrashLightSound()
vector Get_2_1PointPosWS()
override float GetLiquidThroughputCoef()
string m_CarSeatShiftOutSound
static const int SELECTION_ID_DASHBOARD_LIGHT
void HandleSeatAdjustmentSound(string animSource, float phase)
void HandleEngineSound(CarEngineSoundState state)
void CarPartsHealthCheck()
enum CarDoorState START_NO_SPARKPLUG
static const int SELECTION_ID_REVERSE_LIGHT_R
bool m_PlayCrashSoundHeavy
bool IsScriptedLightsOn()
Propper way to get if light is swiched on. Use instead of IsLightsOn().
string m_CarDoorOpenSound
static vector m_DrownEnginePos
ref CarContactCache m_ContactCache
override void EEDelete(EntityAI parent)
DamageType
exposed from C++ (do not change)
override void EEKilled(Object killer)
override void OnAttachmentRuined(EntityAI attachment)
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
class NoiseSystem NoiseParams()
class JsonUndergroundAreaTriggerData GetPosition
override float OnSound(CarSoundCtrl ctrl, float oldValue)
override bool IsVitalEngineBelt()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCrewIndex(string selection)
override CarRearLightBase CreateRearLight()
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
override string GetDoorConditionPointFromSelection(string selection)
override CarLightBase CreateFrontLight()
override bool IsVitalGlowPlug()
override int GetCarDoorsState(string slotType)
override bool IsVitalTruckBattery()
override void OnAnimationPhaseStarted(string animSource, float phase)
override string GetAnimSourceFromSelection(string selection)
override void EOnPostSimulate(IEntity other, float timeSlice)
override void OnEngineStart()
override bool CanReleaseAttachment(EntityAI attachment)
override void SetActions()
override bool IsVitalRadiator()
override bool IsVitalCarBattery()
override bool IsVitalSparkPlug()
bool CanManipulateSpareWheel(string slotSelectionName)
override float GetPushForceCoefficientMultiplier()
override void OnEngineStop()
Super root of all classes in Enforce script.
static const int DAYZCAMERA_3RD_VEHICLE
generic vehicle 3rd person
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.
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.
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Wrapper class for managing sound through SEffectManager.
provides access to slot configuration
static proto bool GetSelectionForSlotId(int slot_Id, out string selection)
static bool IsActionLogEnable()
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'.
Manager class for managing Effect (EffectParticle, EffectSound)
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.
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.
static void Stop(int effect_id)
Stops the Effect.
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.
static bool IsEffectExist(int effect_id)
Checks whether an Effect ID is registered in SEffectManager.
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.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Serialization general interface. Serializer API works with:
proto vector Normalized()
return normalized vector (keeps orginal vector untouched)
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.
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
const int CARS_FLUIDS_TICK
proto void Print(void var)
Prints content of variable to console/log.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
EntityEvent
Entity events for event-mask, or throwing event from code.
const float DAMAGE_RUINED_VALUE
const float DAMAGE_DAMAGED_VALUE
const float LIQUID_THROUGHPUT_CAR_DEFAULT
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto int AbsInt(int i)
Returns absolute value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
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,...
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native float dBodyGetMass(notnull IEntity ent)
const int SAT_DEBUG_ACTION
proto native HumanCommandVehicle GetCommand_Vehicle()