9enum EBoatOperationalState
17enum EBoatEngineSoundState
102 RegisterNetSyncVariableBool(
"m_PlaySoundEngineStopNoFuel");
103 RegisterNetSyncVariableBool(
"m_PlaySoundPushBoat");
104 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactLight");
105 RegisterNetSyncVariableBoolSignal(
"m_PlaySoundImpactHeavy");
122 if (
g_Game.IsDedicatedServer())
130 if (MemoryPointExists(
"ptcFxFront"))
133 if (MemoryPointExists(
"ptcFxBack"))
136 if (MemoryPointExists(
"ptcFxSide1"))
139 if (MemoryPointExists(
"ptcFxSide2"))
155 if (!
g_Game.IsDedicatedServer())
162 if (!m_InputActionMap)
189 return "VehicleTypeBoat";
194 return (
g_Game.GetPlayer() && (!
g_Game.GetPlayer().GetCommand_Vehicle() ||
g_Game.GetPlayer().GetCommand_Vehicle().GetTransport() ==
this));
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 (
g_Game.IsDedicatedServer())
316 super.OnEngineStop();
318 if (
g_Game.IsDedicatedServer())
326 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
328 if (
g_Game.GetWaterDepth(pos) < 0)
336 float maxVolume = GetFluidCapacity(
BoatFluid.FUEL);
353 if (GetFluidFraction(
BoatFluid.FUEL) <= 0)
374 if (!
g_Game.IsDedicatedServer())
393 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
395 if (
g_Game.GetWaterDepth(pos) < -0.2)
403 if (!
g_Game.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 (
g_Game.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);
664 float propPosRelative =
g_Game.SurfaceGetSeaLevel() - CoordToParent(PropellerGetPosition())[1];
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.
const int HEALTH_HIGH_SPEED_VALUE
const int HEALTH_LOW_SPEED_VALUE
Base script class for boats.
override bool DisableVicinityIcon()
override bool IsInventoryVisible()
override void MarkCrewMemberUnconscious(int crewMemberIndex)
override void EOnPostSimulate(IEntity other, float timeSlice)
ref EffectSound m_SoundPushBoatEffect
override vector GetTransportCameraOffset()
void SyncSoundPushBoat(bool play)
const float DECAY_FLIPPED_MULT
vector m_VelocityPrevTick
string m_SoundEngineStopNoFuel
override void OnDriverExit(Human player)
void FadeEngineSound(bool fadeIn)
string m_SoundImpactLight
override void MarkCrewMemberDead(int crewMemberIndex)
override float GetTransportCameraDistance()
bool m_PlaySoundEngineStopNoFuel
TInputActionMap m_InputActionMap
const float SPLASH_THRESHOLD
override int Get3rdPersonCameraType()
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
void StopParticleUpdate()
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
override bool OnBeforeEngineStart()
Gets called everytime the game wants to start the engine.
void HandleBoatSplashSound()
override float OnSound(BoatSoundCtrl ctrl, float oldValue)
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
const float SOUND_ENGINE_FADE
const int DECAY_FLAG_RANGE
string m_SoundEngineStartNoFuel
override void EOnSimulate(IEntity other, float dt)
static ref map< typename, ref TInputActionMap > m_BoatTypeActionsMap
bool m_ActionsInitialized
void AddAction(typename actionName)
void OnVehicleJumpOutServer(GetOutTransportActionData data)
bool m_PlaySoundImpactHeavy
override void EEOnCECreate()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override event GetOwnerStateType()
const int DECAY_PLAYER_RANGE
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
ref VehicleContactData m_ContactData
bool m_IsEngineSoundFading
override void OnEngineStart()
override bool DetectFlipped(VehicleFlippedContext ctx)
ref EffectSound m_SoundEngineEffect
override void EEDelete(EntityAI parent)
bool m_PlaySoundImpactLight
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
const float DECAY_TICK_FREQUENCY
int CheckOperationalRequirements()
const float SPLASH_THRESHOLD_CONDITION
void SyncSoundImpactLight()
override string GetVehicleType()
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
string m_SoundEngineStart
void PlaySound(string soundset, inout EffectSound sound, vector position=vector.Zero)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
string m_SoundImpactHeavy
void SyncSoundImpactHeavy()
override event GetMoveType()
override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance=1.0)
void HandleEngineSound(EBoatEngineSoundState state)
override void OnContact(string zoneName, vector localPos, IEntity other, Contact data)
WARNING: Can be called very frequently in one frame, use with caution.
bool m_EngineFadeDirection
override void OnVariablesSynchronized()
bool CheckOperationalState()
string m_SoundWaterSplash
void UpdateParticles(float timeSlice=0)
ref EffectBoatWaterBase m_WaterEffects[4]
ref EffectSound m_SoundEngineEffectDeletion
void RemoveAction(typename actionName)
override void OnInput(float dt)
override void EOnFrame(IEntity other, float timeSlice)
ref EffectSound m_SoundWaterSplashEffect
override void OnEngineStop()
static float GetBoatDecayMultiplier()
static const int DAYZCAMERA_3RD_VEHICLE
generic vehicle 3rd person
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
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.
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Internal ancestor of all Entity implementations.
static bool IsActionLogEnable()
Manager class for managing Effect (EffectParticle, EffectSound).
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 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 DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
static void EffectUnregisterEx(Effect effect)
Unregisters Effect in SEffectManager.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto float Normalize()
Normalizes vector.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
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.
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 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,...
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto int AbsInt(int i)
Returns absolute value.
@ 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
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
proto native ParticleSource GetParticle(int index)
Manually get the particle at index.