9enum EBoatOperationalState
17enum EBoatEngineSoundState
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)
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);
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();
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:
648 sound.SetAttachmentParent(
this);
653 if (!sound.IsSoundPlaying())
655 sound.SetCurrentPosition(position);
676 float speed = velocity.
Normalize() * 3.6;
724 orient[2] = orient[2] + 180;
725 SetOrientation(orient);
728 pos[1] = pos[1] + 0.5;
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
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
@ OK
0 - No error. Can be returned from any call.
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()
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
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
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)
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()
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 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