9enum EBoatOperationalState
17enum EBoatEngineSoundState
55 private bool m_ActionsInitialized;
102 RegisterNetSyncVariableBool(
"m_PlaySoundEngineStopNoFuel");
103 RegisterNetSyncVariableBool(
"m_PlaySoundPushBoat");
104 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactLight");
105 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactHeavy");
122 if (
GetGame().IsDedicatedServer())
130 if (MemoryPointExists(
"ptcFxFront"))
133 if (MemoryPointExists(
"ptcFxBack"))
136 if (MemoryPointExists(
"ptcFxSide1"))
139 if (MemoryPointExists(
"ptcFxSide2"))
155 if (!
GetGame().IsDedicatedServer())
162 if (!m_InputActionMap)
167 m_BoatTypeActionsMap.Insert(this.
Type(), m_InputActionMap);
173 if (!m_ActionsInitialized)
175 m_ActionsInitialized =
true;
189 return "VehicleTypeBoat";
239 return super.IsAreaAtDoorFree(currentSeat, maxAllowedObjHeight, extents, transform);
250 return state == EBoatOperationalState.OK;
256 int state = EBoatOperationalState.OK;
262 state |= EBoatOperationalState.RUINED;
265 if (GetFluidFraction(
BoatFluid.FUEL) <= 0)
267 state |= EBoatOperationalState.NO_FUEL;
270 if (IsVitalSparkPlug())
272 item = FindAttachmentBySlotName(
"SparkPlug");
273 if (!item || (item && item.IsRuined()))
274 state |= EBoatOperationalState.NO_IGNITER;
284 if (state == EBoatOperationalState.RUINED)
289 if (state & EBoatOperationalState.NO_IGNITER)
295 if (state & EBoatOperationalState.NO_FUEL)
304 super.OnEngineStart();
306 if (
GetGame().IsDedicatedServer())
316 super.OnEngineStop();
318 if (
GetGame().IsDedicatedServer())
326 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
328 if (
GetGame().GetWaterDepth(pos) < 0)
336 float maxVolume = GetFluidCapacity(
BoatFluid.FUEL);
337 float amount =
Math.RandomFloat(0.0, maxVolume * 0.35);
353 if (GetFluidFraction(
BoatFluid.FUEL) <= 0)
374 if (!
GetGame().IsDedicatedServer())
393 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
395 if (
GetGame().GetWaterDepth(pos) < -0.2)
403 if (!
GetGame().IsDedicatedServer())
443 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
454 super.OnVariablesSynchronized();
484 if (!DetectFlippedUsingSurface(ctx,
GameConstants.VEHICLE_FLIP_ANGLE_TOLERANCE))
501 return super.OnSound(ctrl, oldValue);
539 AddHealth(
"Engine",
"Health", -damage);
548 int count = locations.Count();
551 vector pos = GetWorldPosition();
552 for (
int i = 0; i < count; i++)
569 if (IsVitalSparkPlug())
571 EntityAI item = FindAttachmentBySlotName(
"SparkPlug");
572 if (!item || (item && item.IsRuined()))
581 super.OnDriverExit(player);
583 if (GetGear() != GetNeutralGear())
592 vector posMS = data.m_Player.WorldToModel(data.m_Player.GetPosition());
594 healthCoef =
Math.Clamp(healthCoef, 0.0, 1.0);
595 data.m_Player.ProcessDirectDamage(
DamageType.CUSTOM, data.m_Player,
"",
"FallDamageHealth", posMS, healthCoef);
600 if (
GetGame().IsDedicatedServer())
607 case EBoatEngineSoundState.START_OK:
610 case EBoatEngineSoundState.STOP_OK:
613 case EBoatEngineSoundState.START_NO_FUEL:
616 case EBoatEngineSoundState.STOP_NO_FUEL:
642 if (position ==
vector.Zero)
648 sound.SetAttachmentParent(
this);
653 if (!sound.IsSoundPlaying())
655 sound.SetCurrentPosition(position);
676 float speed = velocity.Normalize() * 3.6;
677 float lerp =
Math.InverseLerp(0, 30, speed);
724 orient[2] = orient[2] + 180;
725 SetOrientation(orient);
728 pos[1] = pos[1] + 0.5;
756 ActionBase action = ActionManagerBase.GetAction(actionName);
760 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
767 m_ActionsInitialized =
false;
781 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action" );
784 actionArray.Insert(action);
790 ActionBase action = player.GetActionManager().GetAction(actionName);
796 actionArray.RemoveItem(action);
802 for (
int i; i < 4; i++)
818 for (
int i; i < 4; i++)
835 for (
int i; i < 4; i++)
852 super.GetDebugActions(outputList);
857 if (super.OnAction(action_id, player, ctx))
877 return BoatScriptOwnerState;
885 #ifdef DIAG_DEVELOPER
886 override void FixEntity()
Param4< int, int, string, int > TSelectableActionInfoWithColor
map< typename, ref array< ActionBase_Basic > > TInputActionMap
TInputActionMap m_InputActionMap
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 NO_FUEL
enum EBoatEffects NO_IGNITER
enum EBoatEffects START_NO_FUEL
enum EBoatEffects START_OK
void EffectBoatWaterFront()
void EffectBoatWaterSide()
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
int CheckOperationalRequirements()
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 void OnDriverExit(Human player)
override void MarkCrewMemberUnconscious(int crewMemberIndex)
override int GetAnimInstance()
override void OnInput(float dt)
void SyncSoundImpactHeavy()
override void MarkCrewMemberDead(int crewMemberIndex)
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
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)
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 void OnContact(string zoneName, vector localPos, IEntity other, Contact data)
WARNING: Can be called very frequently in one frame, use with caution.
override bool OnBeforeEngineStart()
override void OnVariablesSynchronized()
void UpdateParticles(float timeSlice=0)
ref EffectSound m_SoundEngineEffectDeletion
override vector GetTransportCameraOffset()
override void OnEngineStart()
string m_SoundEngineStartNoFuel
const float SPLASH_THRESHOLD
override void EEOnCECreate()
bool CheckOperationalState()
override float OnSound(BoatSoundCtrl ctrl, float oldValue)
proto native float SurfaceGetSeaLevel()
void Update(float timeSlice=0)
override void AttachTo(Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
Wrapper class for managing sound through SEffectManager.
override bool IsPlaying()
Returns true when the effect is playing, false otherwise.
override void Start()
Plays sound.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
string GetSoundSet()
Get soundset for the sound.
void SetSoundVolume(float volume)
Set the RELATIVE volume for the sound.
override void Stop()
Stops sound.
void SoundStop()
Stops sound.
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 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.
Serialization general interface. Serializer API works with:
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DamageType
exposed from C++ (do not change)
DayZPlayerConstants
defined in C++
bool IsRegistered()
Get whether this Effect is registered in SEffectManager.
bool IsPlaying()
Returns true when the Effect is playing, false otherwise.
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.
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
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
proto native ParticleSource GetParticle(int index)
Manually get the particle at index.