9enum EBoatOperationalState
17enum EBoatEngineSoundState
101 RegisterNetSyncVariableBool(
"m_PlaySoundEngineStopNoFuel");
102 RegisterNetSyncVariableBool(
"m_PlaySoundPushBoat");
103 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactLight");
104 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactHeavy");
114 if (
g_Game.IsHeadlessOrDedicatedServer())
126 if (
g_Game.IsHeadlessOrDedicatedServer())
134 if (MemoryPointExists(
"ptcFxFront"))
137 if (MemoryPointExists(
"ptcFxBack"))
140 if (MemoryPointExists(
"ptcFxSide1"))
143 if (MemoryPointExists(
"ptcFxSide2"))
150 if (!m_InputActionMap)
177 return "VehicleTypeBoat";
182 return (
g_Game.GetPlayer() && (!
g_Game.GetPlayer().GetCommand_Vehicle() ||
g_Game.GetPlayer().GetCommand_Vehicle().GetTransport() ==
this));
235 override void FillScript(ETransportFluid fluidType,
float amount)
237 Fill(fluidType, amount);
242 return super.IsAreaAtDoorFree(currentSeat, maxAllowedObjHeight, extents, transform);
253 return state == EBoatOperationalState.OK;
264 int state = EBoatOperationalState.OK;
270 state |= EBoatOperationalState.RUINED;
275 state |= EBoatOperationalState.NO_FUEL;
280 item = FindAttachmentBySlotName(
"SparkPlug");
281 if (!item || (item && item.IsRuined()))
282 state |= EBoatOperationalState.NO_IGNITER;
292 if (state == EBoatOperationalState.RUINED)
297 if (state & EBoatOperationalState.NO_IGNITER)
303 if (state & EBoatOperationalState.NO_FUEL)
312 super.OnEngineStart();
314 if (
g_Game.IsHeadlessOrDedicatedServer())
324 super.OnEngineStop();
326 if (
g_Game.IsHeadlessOrDedicatedServer())
334 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
336 if (
g_Game.GetWaterDepth(pos) < 0)
379 m_MomentumPrevTick = GetMomentum();
382 if (!
g_Game.IsHeadlessOrDedicatedServer())
401 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
403 if (
g_Game.GetWaterDepth(pos) < -0.2)
411 if (!
g_Game.IsHeadlessOrDedicatedServer())
433 float momentumDelta = GetMomentum() - m_MomentumPrevTick;
436 momentumDelta = m_MomentumPrevTick;
439 m_ContactData.SetData(localPos, other, momentumDelta);
451 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
462 super.OnVariablesSynchronized();
509 return super.OnSound(ctrl, oldValue);
547 AddHealth(
"Engine",
"Health", -damage);
556 int count = locations.Count();
559 vector pos = GetWorldPosition();
560 for (
int i = 0; i < count; i++)
579 EntityAI item = FindAttachmentBySlotName(
"SparkPlug");
580 if (!item || (item && item.IsRuined()))
589 super.OnDriverExit(player);
602 healthCoef =
Math.
Clamp(healthCoef, 0.0, 1.0);
608 if (
g_Game.IsHeadlessOrDedicatedServer())
615 case EBoatEngineSoundState.START_OK:
618 case EBoatEngineSoundState.STOP_OK:
621 case EBoatEngineSoundState.START_NO_FUEL:
624 case EBoatEngineSoundState.STOP_NO_FUEL:
657 sound.SetAttachmentParent(
this);
662 if (!sound.IsSoundPlaying())
674 float propPosRelative =
g_Game.SurfaceGetSeaLevel() - CoordToParent(PropellerGetPosition())[1];
686 float speed = velocity.
Normalize() * 3.6;
734 orient[2] = orient[2] + 180;
735 SetOrientation(orient);
738 pos[1] = pos[1] + 0.5;
747 float impulse =
Math.
AbsInt(m_ContactData.m_Impulse);
748 m_ContactData = null;
774 typename ai = action.GetInputType();
791 Debug.
ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action" );
795 actionArray.Insert(action);
801 ActionBase action = player.GetActionManager().GetAction(actionName);
802 typename ai = action.GetInputType();
807 actionArray.RemoveItem(action);
813 for (
int i; i < 4; i++)
829 for (
int i; i < 4; i++)
846 super.CleanupEffects();
848 for (
int i; i < 4; i++)
865 super.GetDebugActions(outputList);
870 if (super.OnAction(action_id, player, ctx))
890 return BoatScriptOwnerState;
898 #ifdef DIAG_DEVELOPER
899 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 int GetNeutralGear()
Returns the index of the neutral gear.
proto native void EngineStop()
Stops the engine.
proto native void Fill(MotorbikeFluid fluid, float amount)
Adds to the specified fluid the specified amount.
proto native bool EngineIsOn()
Returns true when engine is running, false otherwise.
proto native float GetFluidFraction(MotorbikeFluid fluid)
proto native int GetGear()
Returns the index of the future gear, -1 if there is no engine.
proto native float GetFluidCapacity(MotorbikeFluid fluid)
proto native ParticleSource GetParticle(int index)
Manually get the particle at index.
override bool IsVitalSparkPlug()
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)
float GetHeatComfortOverride()
void PlaySound(string soundset, inout EffectSound sound, vector position=vector.Zero)
const int DECAY_PLAYER_RANGE
override void OnEngineStop()
string m_SoundEngineStopNoFuel
void HandleEngineSound(EBoatEngineSoundState state)
float m_HeatComfortOverride
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 int GetFluidCapacityScript(ETransportFluid fluidType)
override float GetFluidFractionScript(ETransportFluid fluidType)
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)
override void CleanupEffects()
override void FillScript(ETransportFluid fluidType, float amount)
bool m_EngineFadeDirection
ref EffectSound m_SoundEngineEffect
string m_SoundEngineStart
TInputActionMap m_InputActionMap
bool m_IsEngineSoundFading
override bool CrewCanGetThrough(int posIdx)
bool m_PlaySoundImpactLight
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 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)
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()
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)
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 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,...
@ NONE
body is not in simulation, nor in collision world
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
vector GetPosition()
Get the world position of the Effect.
const float VEHICLE_FLIP_ANGLE_TOLERANCE