9enum EBoatEngineSoundState
91 RegisterNetSyncVariableBool(
"m_PlaySoundEngineStopNoFuel");
92 RegisterNetSyncVariableBool(
"m_PlaySoundPushBoat");
93 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactLight");
94 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactHeavy");
111 if (
GetGame().IsDedicatedServer())
119 if (MemoryPointExists(
"ptcFxFront"))
122 if (MemoryPointExists(
"ptcFxBack"))
125 if (MemoryPointExists(
"ptcFxSide1"))
128 if (MemoryPointExists(
"ptcFxSide2"))
144 if (!
GetGame().IsDedicatedServer())
151 if (!m_InputActionMap)
178 return "VehicleTypeBoat";
228 return super.IsAreaAtDoorFree(currentSeat, maxAllowedObjHeight, extents, transform);
233 if (IsVitalSparkPlug())
235 EntityAI item = FindAttachmentBySlotName(
"SparkPlug");
236 if (!item || (item && item.IsRuined()))
243 if (GetFluidFraction(
BoatFluid.FUEL) <= 0)
254 super.OnEngineStart();
256 if (
GetGame().IsDedicatedServer())
266 super.OnEngineStop();
268 if (
GetGame().IsDedicatedServer())
276 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
278 if (
GetGame().GetWaterDepth(pos) < 0)
286 float maxVolume = GetFluidCapacity(
BoatFluid.FUEL);
301 if (GetFluidFraction(
BoatFluid.FUEL) <= 0)
322 if (!
GetGame().IsDedicatedServer())
341 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
343 if (
GetGame().GetWaterDepth(pos) < -0.2)
351 if (!
GetGame().IsDedicatedServer())
391 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
402 super.OnVariablesSynchronized();
449 return super.OnSound(ctrl, oldValue);
457 foreach (
int unconsciousCrewMemberIndex : m_UnconsciousCrewMemberIndices)
462 m_UnconsciousCrewMemberIndices.RemoveItem(unconsciousCrewMemberIndex);
468 foreach (
int deadCrewMemberIndex : m_DeadCrewMemberIndices)
473 m_DeadCrewMemberIndices.RemoveItem(deadCrewMemberIndex);
493 AddHealth(
"Engine",
"Health", -damage);
502 int count = locations.Count();
505 vector pos = GetWorldPosition();
506 for (
int i = 0; i < count; i++)
523 if (IsVitalSparkPlug())
525 EntityAI item = FindAttachmentBySlotName(
"SparkPlug");
526 if (!item || (item && item.IsRuined()))
536 vector posMS = data.m_Player.WorldToModel(data.m_Player.GetPosition());
538 healthCoef =
Math.
Clamp(healthCoef, 0.0, 1.0);
539 data.m_Player.ProcessDirectDamage(
DamageType.CUSTOM, data.m_Player,
"",
"FallDamageHealth", posMS, healthCoef);
544 if (
GetGame().IsDedicatedServer())
551 case EBoatEngineSoundState.START_OK:
554 case EBoatEngineSoundState.STOP_OK:
557 case EBoatEngineSoundState.START_NO_FUEL:
560 case EBoatEngineSoundState.STOP_NO_FUEL:
592 sound.SetAttachmentParent(
this);
597 if (!sound.IsSoundPlaying())
599 sound.SetCurrentPosition(position);
620 float speed = velocity.
Normalize() * 3.6;
668 orient[2] = orient[2] + 180;
669 SetOrientation(orient);
672 pos[1] = pos[1] + 0.5;
725 Debug.
ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action" );
728 actionArray.Insert(action);
734 ActionBase action = player.GetActionManager().GetAction(actionName);
740 actionArray.RemoveItem(action);
746 for (
int i; i < 4; i++)
762 for (
int i; i < 4; i++)
779 for (
int i; i < 4; i++)
796 super.GetDebugActions(outputList);
804 if (super.OnAction(action_id, player, ctx))
828 return BoatScriptOwnerState;
836 #ifdef DIAG_DEVELOPER
837 override void FixEntity()
Param4< int, int, string, int > TSelectableActionInfoWithColor
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
BoatSoundCtrl
Boat's sound controller list. (native, do not change or extend)
BoatFluid
Type of vehicle's fluid. (native, do not change or extend)
enum EBoatEffects STOP_OK
enum EBoatEffects START_NO_FUEL
enum EBoatEffects START_OK
void EffectBoatWaterFront()
void EffectBoatWaterSide()
proto native bool AvoidPlayer(vector vPos, float fDistance)
Check if there is a player within a radius.
proto native CEApi GetCEApi()
Get the CE API.
DamageType
exposed from C++ (do not change)
bool IsRegistered()
Get whether this Effect is registered in SEffectManager.
bool IsPlaying()
Returns true when the Effect is playing, false otherwise.
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
proto native ParticleSource GetParticle(int index)
Manually get the particle at index.
const int HEALTH_HIGH_SPEED_VALUE
const int HEALTH_LOW_SPEED_VALUE
void HandleBoatSplashSound()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
ref EffectBoatWaterBase m_WaterEffects[4]
void AddAction(typename actionName)
void PlaySound(string soundset, inout EffectSound sound, vector position=vector.Zero)
const int DECAY_PLAYER_RANGE
override void OnEngineStop()
string m_SoundEngineStopNoFuel
override void EEDelete(EntityAI parent)
void HandleEngineSound(EBoatEngineSoundState state)
bool m_PlaySoundEngineStopNoFuel
override void EOnFrame(IEntity other, float timeSlice)
void FadeEngineSound(bool fadeIn)
ref EffectSound m_SoundPushBoatEffect
override void EOnPostSimulate(IEntity other, float timeSlice)
override bool IsInventoryVisible()
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
override event GetOwnerStateType()
string m_SoundImpactHeavy
string m_SoundWaterSplash
override bool DetectFlipped(VehicleFlippedContext ctx)
string m_SoundImpactLight
override event GetMoveType()
override int Get3rdPersonCameraType()
override int GetAnimInstance()
void SyncSoundImpactHeavy()
void SyncSoundPushBoat(bool play)
override void EOnSimulate(IEntity other, float dt)
const float DECAY_FLIPPED_MULT
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
bool m_EngineFadeDirection
ref EffectSound m_SoundEngineEffect
string m_SoundEngineStart
TInputActionMap m_InputActionMap
bool m_IsEngineSoundFading
override bool CrewCanGetThrough(int posIdx)
bool m_PlaySoundImpactLight
vector m_VelocityPrevTick
override bool DisableVicinityIcon()
const float DECAY_TICK_FREQUENCY
void OnVehicleJumpOutServer(GetOutTransportActionData data)
void SyncSoundImpactLight()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
ref VehicleContactData m_ContactData
ref EffectSound m_SoundWaterSplashEffect
override float GetTransportCameraDistance()
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool m_PlaySoundImpactHeavy
override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance=1.0)
const int DECAY_FLAG_RANGE
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
override void EOnContact(IEntity other, Contact extra)
void StopParticleUpdate()
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
override string GetVehicleType()
const float SPLASH_THRESHOLD_CONDITION
void RemoveAction(typename actionName)
const float SOUND_ENGINE_FADE
override bool OnBeforeEngineStart()
override void OnVariablesSynchronized()
bool m_ActionsInitialized
void UpdateParticles(float timeSlice=0)
ref EffectSound m_SoundEngineEffectDeletion
override vector GetTransportCameraOffset()
static ref map< typename, ref TInputActionMap > m_BoatTypeActionsMap
override void OnEngineStart()
string m_SoundEngineStartNoFuel
const float SPLASH_THRESHOLD
override void EEOnCECreate()
bool CheckOperationalState()
override void HandleByCrewMemberState(ECrewMemberState state)
override float OnSound(BoatSoundCtrl ctrl, float oldValue)
proto native float SurfaceGetSeaLevel()
override ScriptCallQueue GetCallQueue(int call_category)
proto native Mission GetMission()
static float GetBoatDecayMultiplier()
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 ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Wrapper class for managing sound through SEffectManager.
static bool IsActionLogEnable()
array< vector > GetActiveRefresherLocations()
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 void EffectUnregisterEx(Effect effect)
Unregisters Effect 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.
Manager class for managing Effect (EffectParticle, EffectSound)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
Serializer ParamsReadContext
proto native CGame GetGame()
proto native void SetPosition(vector position)
Set the world position of the Effect.
EntityEvent
Entity events for event-mask, or throwing event from code.
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 dBodyGetVelocityAt(notnull IEntity body, vector globalpos)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native void dBodyGetWorldTransform(notnull IEntity body, out vector matrix[4])
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
const float VEHICLE_FLIP_ANGLE_TOLERANCE