DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
BoatScript.c
См. документацию.
8
9enum EBoatOperationalState
10{
11 OK = 0,
12 RUINED = 1,
15}
16
17enum EBoatEngineSoundState
18{
24}
25
26class BoatScriptOwnerState : BoatOwnerState
27{
28};
29
31{
32};
33
34#ifdef DIAG_DEVELOPER
35BoatScript _boat;
36#endif
37
41class BoatScript : Boat
42{
43 protected const int DECAY_PLAYER_RANGE = 300; // when a player is found within this range, decay is deactivated
44 protected const int DECAY_FLAG_RANGE = 100; // when a boat is parked around a territoryflag, decay is deactivated
45 protected const float DECAY_TICK_FREQUENCY = 10; // seconds
46 protected const float DECAY_DAMAGE = 0.017;
47 protected const float DECAY_FLIPPED_MULT = 4;
48
49 protected const float SOUND_ENGINE_FADE = 0.2;
50 protected const float SPLASH_THRESHOLD_CONDITION = 0.08; // diff between sea surface and propeller pos which determines if the splash should happen
51 protected const float SPLASH_THRESHOLD = 0.18; // diff between sea surface and propeller pos which determines when the splash happens
52
55 private bool m_ActionsInitialized;
56
57 protected ref Timer m_DecayTimer;
58
59 // particles
60 protected bool m_UpdateParticles;
62
63 // sounds
64 protected bool m_SplashIncoming; // boat is high enough for the splash to trigger when it falls back down to sea level
66 protected bool m_PlaySoundImpactLight;
67 protected bool m_PlaySoundImpactHeavy;
68 protected bool m_PlaySoundPushBoat;
69 protected bool m_IsEngineSoundFading;
70 protected bool m_EngineFadeDirection; // true>in | false>out
71 protected float m_EngineFadeTime;
72 protected string m_SoundImpactLight;
73 protected string m_SoundImpactHeavy;
74 protected string m_SoundPushBoat;
75 protected string m_SoundWaterSplash;
76 protected string m_SoundEngineStart;
77 protected string m_SoundEngineStop;
78 protected string m_SoundEngineStartNoFuel;
79 protected string m_SoundEngineStopNoFuel;
80
81 // caches to avoid multiple triggers
85 protected ref EffectSound m_SoundEngineEffectDeletion; // hold engine sound which is being stopped & deleted while another is starting
86
87 protected float m_HeatComfortOverride;
88
90 {
91#ifdef DIAG_DEVELOPER
92 _boat = this;
93#endif
94
95 SetEventMask(EntityEvent.POSTSIMULATE);
96 SetEventMask(EntityEvent.FRAME);
97
100
101 RegisterNetSyncVariableBool("m_PlaySoundEngineStopNoFuel");
102 RegisterNetSyncVariableBool("m_PlaySoundPushBoat");
103 RegisterNetSyncVariableBoolSignal("m_PlaySoundImpactLight");
104 RegisterNetSyncVariableBoolSignal("m_PlaySoundImpactHeavy");
105
106 if (g_Game.IsServer())
107 {
109
111 m_DecayTimer.Run(DECAY_TICK_FREQUENCY, this, "DecayHealthTick", NULL, true);
112 }
113
114 if (g_Game.IsHeadlessOrDedicatedServer())
115 return;
116
117 m_SoundImpactHeavy = "boat_01_hit_light_SoundSet";
118 m_SoundImpactLight = "boat_01_hit_heavy_SoundSet";
119 m_SoundPushBoat = "boat_01_push_SoundSet";
120 m_SoundWaterSplash = "boat_01_splash_SoundSet";
121 m_SoundEngineStart = "boat_01_engine_start_SoundSet";
122 m_SoundEngineStop = "boat_01_engine_stop_SoundSet";
123 m_SoundEngineStartNoFuel = "boat_01_engine_start_no_fuel_SoundSet";
124 m_SoundEngineStopNoFuel = "boat_01_engine_stop_no_fuel_SoundSet";
125
126 if (g_Game.IsHeadlessOrDedicatedServer())
127 return;
128
133
134 if (MemoryPointExists("ptcFxFront"))
135 m_WaterEffects[EBoatEffects.PTC_FRONT].AttachTo(this, GetMemoryPointPos("ptcFxFront"));
136
137 if (MemoryPointExists("ptcFxBack"))
138 m_WaterEffects[EBoatEffects.PTC_BACK].AttachTo(this, GetMemoryPointPos("ptcFxBack"));
139
140 if (MemoryPointExists("ptcFxSide1"))
141 m_WaterEffects[EBoatEffects.PTC_SIDE_L].AttachTo(this, GetMemoryPointPos("ptcFxSide1"));
142
143 if (MemoryPointExists("ptcFxSide2"))
144 m_WaterEffects[EBoatEffects.PTC_SIDE_R].AttachTo(this, GetMemoryPointPos("ptcFxSide2"));
145 }
146
148 {
150 if (!m_InputActionMap)
151 {
153 m_InputActionMap = iam;
154 SetActions();
155 m_BoatTypeActionsMap.Insert(this.Type(), m_InputActionMap);
156 }
157 }
158
159 override void GetActions(typename action_input_type, out array<ActionBase_Basic> actions)
160 {
162 {
165 }
166
167 actions = m_InputActionMap.Get(action_input_type);
168 }
169
170 override bool DisableVicinityIcon()
171 {
172 return true;
173 }
174
175 override string GetVehicleType()
176 {
177 return "VehicleTypeBoat";
178 }
179
180 override bool IsInventoryVisible()
181 {
182 return (g_Game.GetPlayer() && (!g_Game.GetPlayer().GetCommand_Vehicle() || g_Game.GetPlayer().GetCommand_Vehicle().GetTransport() == this));
183 }
184
186 {
187 return 4.5;
188 }
189
191 {
192 return "0 1.4 0";
193 }
194
195 override int GetAnimInstance()
196 {
197 return VehicleAnimInstances.ZODIAC;
198 }
199
204
205 override bool CrewCanGetThrough(int posIdx)
206 {
207 return true;
208 }
209
210 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
211 {
212 return true;
213 }
214
215 override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance = 1.0)
216 {
217 return true;
218 }
219
220 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
221 {
222 return true;
223 }
224
225 override int GetFluidCapacityScript(ETransportFluid fluidType)
226 {
227 return GetFluidCapacity(fluidType);
228 }
229
230 override float GetFluidFractionScript(ETransportFluid fluidType)
231 {
232 return GetFluidFraction(fluidType);
233 }
234
235 override void FillScript(ETransportFluid fluidType, float amount)
236 {
237 Fill(fluidType, amount);
238 }
239
240 override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
241 {
242 return super.IsAreaAtDoorFree(currentSeat, maxAllowedObjHeight, extents, transform);
243 }
244
250 override bool OnBeforeEngineStart()
251 {
252 EBoatOperationalState state = CheckOperationalRequirements();
253 return state == EBoatOperationalState.OK;
254 }
255
257 {
259 }
260
261 // Whether the car engine can be started
263 {
264 int state = EBoatOperationalState.OK;
265
266 EntityAI item = null;
267
268 if (GetHealthLevel("") >= GameConstants.STATE_RUINED || GetHealthLevel("Engine") >= GameConstants.STATE_RUINED)
269 {
270 state |= EBoatOperationalState.RUINED;
271 }
272
273 if (GetFluidFraction(BoatFluid.FUEL) <= 0)
274 {
275 state |= EBoatOperationalState.NO_FUEL;
276 }
277
278 if (IsVitalSparkPlug())
279 {
280 item = FindAttachmentBySlotName("SparkPlug");
281 if (!item || (item && item.IsRuined()))
282 state |= EBoatOperationalState.NO_IGNITER;
283 }
284
285 return state;
286 }
287
289 {
290 EBoatOperationalState state = CheckOperationalRequirements();
291
292 if (state == EBoatOperationalState.RUINED)
293 {
294 return;
295 }
296
297 if (state & EBoatOperationalState.NO_IGNITER)
298 {
299 HandleEngineSound(EBoatEngineSoundState.START_NO_FUEL);
300 return;
301 }
302
303 if (state & EBoatOperationalState.NO_FUEL)
304 {
305 HandleEngineSound(EBoatEngineSoundState.START_NO_FUEL);
306 return;
307 }
308 }
309
310 override void OnEngineStart()
311 {
312 super.OnEngineStart();
313
314 if (g_Game.IsHeadlessOrDedicatedServer())
315 return;
316
317 FadeEngineSound(true);
318 HandleEngineSound(EBoatEngineSoundState.START_OK);
319 ClearWaterEffects(); // in case they are still active
320 }
321
322 override void OnEngineStop()
323 {
324 super.OnEngineStop();
325
326 if (g_Game.IsHeadlessOrDedicatedServer())
327 return;
328
329 FadeEngineSound(false);
330 HandleEngineSound(EBoatEngineSoundState.STOP_OK);
331
332 vector mat[4];
333 dBodyGetWorldTransform(this, mat);
334 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
335
336 if (g_Game.GetWaterDepth(pos) < 0) // stop instantly
338 else
339 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(StopParticleUpdate, 3000);
340 }
341
342 override void EEOnCECreate()
343 {
344 float maxVolume = GetFluidCapacity(BoatFluid.FUEL);
345 float amount = Math.RandomFloat(0.0, maxVolume * 0.35);
346
347 Fill(BoatFluid.FUEL, amount);
348 }
349
350 override void OnInput(float dt)
351 {
352 super.OnInput(dt);
353 }
354
355 override void EOnPostSimulate(IEntity other, float timeSlice)
356 {
357 if (!IsProxy())
358 {
359 if (EngineIsOn())
360 {
361 if (GetFluidFraction(BoatFluid.FUEL) <= 0)
362 {
363 if (g_Game.IsServer())
364 {
366 SetSynchDirty();
368 }
369
370 EngineStop();
371 }
372 }
373 }
374
375 if (g_Game.IsServer())
376 {
378 m_VelocityPrevTick = GetVelocity(this);
379 m_MomentumPrevTick = GetMomentum();
380 }
381
382 if (!g_Game.IsHeadlessOrDedicatedServer())
383 {
384 if (EngineIsOn())
385 m_UpdateParticles = true;
386
389
390 }
391 }
392
393 override void EOnSimulate(IEntity other, float dt)
394 {
395 if (!IsProxy())
396 {
397 if (EngineIsOn())
398 {
399 vector mat[4];
400 dBodyGetWorldTransform(this, mat);
401 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
402
403 if (g_Game.GetWaterDepth(pos) < -0.2)
404 EngineStop();
405 }
406 }
407 }
408
409 override void EOnFrame(IEntity other, float timeSlice)
410 {
411 if (!g_Game.IsHeadlessOrDedicatedServer())
412 {
414 UpdateParticles(timeSlice);
415
417 {
418 m_EngineFadeTime -= timeSlice;
419 if (m_EngineFadeTime < 0)
420 m_IsEngineSoundFading = false;
421 }
422 }
423 }
424
426 override void OnContact(string zoneName, vector localPos, IEntity other, Contact data)
427 {
428 if (g_Game.IsServer())
429 {
430 if (m_ContactData)
431 return;
432
433 float momentumDelta = GetMomentum() - m_MomentumPrevTick;
434 float dot = vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized());
435 if (dot < 0)
436 momentumDelta = m_MomentumPrevTick;
437
438 m_ContactData = new VehicleContactData();
439 m_ContactData.SetData(localPos, other, momentumDelta); // change to local pos
440 }
441
442 if (!IsProxy())
443 {
445 EngineStop();
446 }
447 }
448
449 override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
450 {
451 super.EEHitBy(damageResult, damageType, source, component, dmgZone, ammo, modelPos, speedCoef);
452
453 if (!IsProxy())
454 {
456 EngineStop();
457 }
458 }
459
461 {
462 super.OnVariablesSynchronized();
463
465 {
466 EffectSound impactHeavy;
469 }
470
472 {
473 EffectSound impactLight;
476 }
477
480 else if (m_SoundPushBoatEffect && m_SoundPushBoatEffect.IsPlaying())
482
484 {
485 HandleEngineSound(EBoatEngineSoundState.STOP_NO_FUEL);
487 }
488 }
489
490 protected override bool DetectFlipped(VehicleFlippedContext ctx)
491 {
492 if (!DetectFlippedUsingSurface(ctx, GameConstants.VEHICLE_FLIP_ANGLE_TOLERANCE))
493 return false;
494 return true;
495 }
496
497 override float OnSound(BoatSoundCtrl ctrl, float oldValue)
498 {
500 {
503 else
505
506 return oldValue;
507 }
508
509 return super.OnSound(ctrl, oldValue);
510 }
511
512 override void MarkCrewMemberUnconscious(int crewMemberIndex)
513 {
514 if (!IsAuthority())
515 return;
516
517 if (crewMemberIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
518 {
519 EngineStop();
520 }
521 }
522
523 override void MarkCrewMemberDead(int crewMemberIndex)
524 {
525 if (!IsAuthority())
526 return;
527
528 if (crewMemberIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
529 {
530 EngineStop();
531 }
532 }
533
534 protected void DecayHealthTick()
535 {
537 return;
538
540
541 if (IsFlipped())
542 damage *= DECAY_FLIPPED_MULT;
543
544 if (IsInFlagRange())
545 damage *= 0.3;
546
547 AddHealth("Engine","Health", -damage);
548 }
549
550 protected bool IsInFlagRange()
551 {
552 array<vector> locations = g_Game.GetMission().GetActiveRefresherLocations();
553 if (!locations)
554 return false;
555
556 int count = locations.Count();
557 if (count > 0)
558 {
559 vector pos = GetWorldPosition();
560 for (int i = 0; i < count; i++)
561 {
562 if (vector.Distance(pos, locations.Get(i)) < DECAY_FLAG_RANGE)
563 return true;
564 }
565
566 return false;
567 }
568 else
569 return false;
570 }
571
573 {
574 if (GetHealthLevel("") >= GameConstants.STATE_RUINED || GetHealthLevel("Engine") >= GameConstants.STATE_RUINED)
575 return false;
576
577 if (IsVitalSparkPlug())
578 {
579 EntityAI item = FindAttachmentBySlotName("SparkPlug");
580 if (!item || (item && item.IsRuined()))
581 return false;
582 }
583
584 return true;
585 }
586
587 override void OnDriverExit(Human player)
588 {
589 super.OnDriverExit(player);
590
591 if (GetGear() != GetNeutralGear())
592 {
593 EngineStop();
594 }
595 }
596
597 // Server side event for jump out processing
599 {
600 vector posMS = data.m_Player.WorldToModel(data.m_Player.GetPosition());
602 healthCoef = Math.Clamp(healthCoef, 0.0, 1.0);
603 data.m_Player.ProcessDirectDamage(DamageType.CUSTOM, data.m_Player, "", "FallDamageHealth", posMS, healthCoef);
604 }
605
606 protected void HandleEngineSound(EBoatEngineSoundState state)
607 {
608 if (g_Game.IsHeadlessOrDedicatedServer())
609 return;
610
611 string soundset;
612
613 switch (state)
614 {
615 case EBoatEngineSoundState.START_OK:
616 soundset = m_SoundEngineStart;
617 break;
618 case EBoatEngineSoundState.STOP_OK:
619 soundset = m_SoundEngineStop;
620 break;
621 case EBoatEngineSoundState.START_NO_FUEL:
622 soundset = m_SoundEngineStartNoFuel;
623 break;
624 case EBoatEngineSoundState.STOP_NO_FUEL:
625 soundset = m_SoundEngineStopNoFuel;
626 break;
627 }
628
629 // already playing same type of sound
631 {
632 if (m_SoundEngineEffect.GetSoundSet() == soundset) // already playing same type of sound
633 return;
634 else
635 {
637 m_SoundEngineEffectDeletion.SoundStop(); // stop the existing sound
638
639 m_SoundEngineEffect = null;
640 }
641
642 }
643
644 PlaySound(soundset, m_SoundEngineEffect, ModelToWorld(PropellerGetPosition()));
645 }
646
647 protected void PlaySound(string soundset, inout EffectSound sound, vector position = vector.Zero)
648 {
649 #ifndef SERVER
650 #ifndef NO_GUI
651 if (position == vector.Zero)
653
654 if (!sound)
655 {
657 sound.SetAttachmentParent(this);
658 sound.SetAutodestroy(true); // SoundWaveObjects tend to null themselves for unknown reasons, breaking the effect in the process
659 }
660 else
661 {
662 if (!sound.IsSoundPlaying())
663 {
664 sound.SetCurrentPosition(position);
665 sound.SoundPlay();
666 }
667 }
668 #endif
669 #endif
670 }
671
672 protected void HandleBoatSplashSound()
673 {
674 float propPosRelative = g_Game.SurfaceGetSeaLevel() - CoordToParent(PropellerGetPosition())[1];
675 if (propPosRelative < SPLASH_THRESHOLD_CONDITION)
676 m_SplashIncoming = true;
677
678 if (m_SplashIncoming && propPosRelative > SPLASH_THRESHOLD)
679 {
681 m_SoundWaterSplashEffect.SetAttachmentParent(this);
682 m_SoundWaterSplashEffect.SetLocalPosition(PropellerGetPosition());
683 m_SoundWaterSplashEffect.SetAutodestroy(true);
684
685 vector velocity = dBodyGetVelocityAt(this, CoordToParent(PropellerGetPosition()));
686 float speed = velocity.Normalize() * 3.6; // to km/h
687 float lerp = Math.InverseLerp(0, 30, speed);
688 m_SoundWaterSplashEffect.SetSoundVolume(lerp);
689
691
692 m_SplashIncoming = false;
693 }
694 }
695
696 protected void SyncSoundImpactLight()
697 {
699 {
701 SetSynchDirty();
702 }
703 }
704
705 protected void SyncSoundImpactHeavy()
706 {
708 {
710 SetSynchDirty();
711 }
712 }
713
714 void SyncSoundPushBoat(bool play)
715 {
716 if (m_PlaySoundPushBoat != play)
717 {
718 m_PlaySoundPushBoat = play;
719 SetSynchDirty();
720 }
721 }
722
723 // Set engine sound to fade on start/stop
724 protected void FadeEngineSound(bool fadeIn)
725 {
727 m_EngineFadeDirection = fadeIn;
729 }
730
731 protected void FlipVehicle()
732 {
733 vector orient = GetOrientation();
734 orient[2] = orient[2] + 180;
735 SetOrientation(orient);
736
737 vector pos = GetPosition();
738 pos[1] = pos[1] + 0.5;
739 SetPosition(pos);
740 }
741
742 protected void CheckContactCache()
743 {
744 if (!m_ContactData)
745 return;
746
747 float impulse = Math.AbsInt(m_ContactData.m_Impulse);
748 m_ContactData = null;
749
751 return;
752 else if (impulse < GameConstants.CARS_CONTACT_DMG_THRESHOLD)
754 else
756 }
757
758 protected void SetActions()
759 {
762 }
763
764 void AddAction(typename actionName)
765 {
766 ActionBase action = ActionManagerBase.GetAction(actionName);
767
768 if (!action)
769 {
770 Debug.LogError("Action " + actionName + " dosn't exist!");
771 return;
772 }
773
774 typename ai = action.GetInputType();
775 if (!ai)
776 {
777 m_ActionsInitialized = false;
778 return;
779 }
780
781 array<ActionBase_Basic> actionArray = m_InputActionMap.Get(ai);
782
783 if (!actionArray)
784 {
785 actionArray = new array<ActionBase_Basic>;
786 m_InputActionMap.Insert(ai, actionArray);
787 }
788#ifdef ENABLE_LOGGING
790 {
791 Debug.ActionLog(action.ToString() + " -> " + ai, this.ToString() , "n/a", "Add action" );
792 }
793#endif
794
795 actionArray.Insert(action);
796 }
797
798 void RemoveAction(typename actionName)
799 {
800 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
801 ActionBase action = player.GetActionManager().GetAction(actionName);
802 typename ai = action.GetInputType();
803 array<ActionBase_Basic> actionArray = m_InputActionMap.Get(ai);
804
805 if (actionArray)
806 {
807 actionArray.RemoveItem(action);
808 }
809 }
810
811 protected void UpdateParticles(float timeSlice = 0)
812 {
813 for (int i; i < 4; i++)
814 {
815 m_WaterEffects[i].Update(timeSlice);
816 }
817 }
818
819 protected void StopParticleUpdate()
820 {
821 m_UpdateParticles = false;
823 }
824
825 protected void ClearWaterEffects()
826 {
827 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(StopParticleUpdate);
828
829 for (int i; i < 4; i++)
830 {
831 if (m_WaterEffects[i].IsPlaying())
832 {
834 {
835 m_WaterEffects[i].GetParticle().SetParticleParam(EmitorParam.BIRTH_RATE, 0);
836 m_WaterEffects[i].GetParticle().SetParticleParam(EmitorParam.BIRTH_RATE_RND, 0);
837 }
838 m_WaterEffects[i].Stop();
839 }
840 }
841 }
842
843 // Called on destroy/stream out
844 override void CleanupEffects()
845 {
846 super.CleanupEffects();
847
848 for (int i; i < 4; i++)
849 {
851 {
852 m_WaterEffects[i].Stop();
854 }
855 }
856
859 }
860
861 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
862 {
863 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.FLIP_ENTITY, "Flip vehicle", FadeColors.LIGHT_GREY));
864
865 super.GetDebugActions(outputList);
866 }
867
868 override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
869 {
870 if (super.OnAction(action_id, player, ctx))
871 return true;
872
873 if (!g_Game.IsServer())
874 {
875 return false;
876 }
877
878 switch (action_id)
879 {
880 case EActions.FLIP_ENTITY:
881 FlipVehicle();
882 return true;
883 }
884
885 return false;
886 }
887
888 protected override event typename GetOwnerStateType()
889 {
890 return BoatScriptOwnerState;
891 }
892
893 protected override event typename GetMoveType()
894 {
895 return BoatScriptMove;
896 }
897
898 #ifdef DIAG_DEVELOPER
899 override void FixEntity()
900 {
901 super.FixEntity();
902
903 if (g_Game.IsServer())
905
906
907 }
908 #endif
909}
Param4< int, int, string, int > TSelectableActionInfoWithColor
void ActionBase()
Определения ActionBase.c:82
void ActionManagerBase(PlayerBase player)
Определения ActionManagerBase.c:63
map< typename, ref array< ActionBase_Basic > > TInputActionMap
Определения ActionManagerClient.c:1
vector GetOrientation()
Определения AreaDamageManager.c:306
@ OK
0 - No error. Can be returned from any call.
Определения BIOSErrorModule.c:9
BoatSoundCtrl
Boat's sound controller list. (native, do not change or extend)
Определения Boat.c:3
BoatFluid
Type of vehicle's fluid. (native, do not change or extend)
Определения Boat.c:13
enum EBoatEffects STOP_OK
enum EBoatEffects NO_FUEL
enum EBoatEffects NO_IGNITER
enum EBoatEffects START_NO_FUEL
enum EBoatEffects START_OK
EBoatEffects
Определения BoatScript.c:2
@ PTC_SIDE_L
Определения BoatScript.c:5
@ PTC_BACK
Определения BoatScript.c:4
@ PTC_FRONT
Определения BoatScript.c:3
@ PTC_SIDE_R
Определения BoatScript.c:6
void EffectBoatWaterFront()
Определения BoatWaterEffects.c:14
void EffectBoatWaterSide()
Определения BoatWaterEffects.c:203
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.
map
Определения ControlsXboxNew.c:4
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
DayZGame g_Game
Определения DayZGame.c:4074
vector position
Определения DustKickupEffects.c:20
EActions
Определения EActions.c:2
bool IsRegistered()
Get whether this Effect is registered in SEffectManager.
Определения Effect.c:570
bool IsPlaying()
Returns true when the Effect is playing, false otherwise.
Определения Effect.c:197
bool IsProxy()
Определения Hand_Events.c:65
void PlaySound()
Определения HungerSoundHandler.c:39
@ RUINED
Определения InjuryHandler.c:24
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
string Type
Определения JsonDataContaminatedArea.c:11
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)
@ STOP_NO_FUEL
Определения MotorbikeScript.c:50
proto native ParticleSource GetParticle(int index)
Manually get the particle at index.
VehicleAnimInstances
Определения VehicleAnimInstances.c:2
override bool IsVitalSparkPlug()
PlayerBase m_Player
Определения ActionBase.c:40
const int HEALTH_HIGH_SPEED_VALUE
Определения ActionGetOutTransport.c:39
const int HEALTH_LOW_SPEED_VALUE
Определения ActionGetOutTransport.c:38
Определения ActionPushBoat.c:18
Определения Boat.c:24
Определения Boat.c:20
void HandleBoatSplashSound()
Определения BoatScript.c:672
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Определения BoatScript.c:861
ref EffectBoatWaterBase m_WaterEffects[4]
Определения BoatScript.c:61
void AddAction(typename actionName)
Определения BoatScript.c:764
float GetHeatComfortOverride()
Определения BoatScript.c:256
bool m_PlaySoundPushBoat
Определения BoatScript.c:68
void PlaySound(string soundset, inout EffectSound sound, vector position=vector.Zero)
Определения BoatScript.c:647
bool m_UpdateParticles
Определения BoatScript.c:60
const int DECAY_PLAYER_RANGE
Определения BoatScript.c:43
override void OnEngineStop()
Определения BoatScript.c:322
string m_SoundEngineStopNoFuel
Определения BoatScript.c:79
void HandleEngineSound(EBoatEngineSoundState state)
Определения BoatScript.c:606
float m_HeatComfortOverride
Определения BoatScript.c:87
void DecayHealthTick()
Определения BoatScript.c:534
bool m_PlaySoundEngineStopNoFuel
Определения BoatScript.c:65
override void EOnFrame(IEntity other, float timeSlice)
Определения BoatScript.c:409
void FadeEngineSound(bool fadeIn)
Определения BoatScript.c:724
ref EffectSound m_SoundPushBoatEffect
Определения BoatScript.c:82
int CheckOperationalRequirements()
Определения BoatScript.c:262
override void EOnPostSimulate(IEntity other, float timeSlice)
Определения BoatScript.c:355
override int GetFluidCapacityScript(ETransportFluid fluidType)
Определения BoatScript.c:225
override float GetFluidFractionScript(ETransportFluid fluidType)
Определения BoatScript.c:230
override bool IsInventoryVisible()
Определения BoatScript.c:180
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Определения BoatScript.c:159
string m_SoundPushBoat
Определения BoatScript.c:74
ref Timer m_DecayTimer
Определения BoatScript.c:57
void FlipVehicle()
Определения BoatScript.c:731
override event GetOwnerStateType()
Определения BoatScript.c:888
bool IsInFlagRange()
Определения BoatScript.c:550
string m_SoundImpactHeavy
Определения BoatScript.c:73
string m_SoundWaterSplash
Определения BoatScript.c:75
override bool DetectFlipped(VehicleFlippedContext ctx)
Определения BoatScript.c:490
string m_SoundImpactLight
Определения BoatScript.c:72
override event GetMoveType()
Определения BoatScript.c:893
override int Get3rdPersonCameraType()
Определения BoatScript.c:200
void OnIgnition()
Определения BoatScript.c:288
override void OnDriverExit(Human player)
Определения BoatScript.c:587
void CheckContactCache()
Определения BoatScript.c:742
override void MarkCrewMemberUnconscious(int crewMemberIndex)
Определения BoatScript.c:512
override int GetAnimInstance()
Определения BoatScript.c:195
override void OnInput(float dt)
Определения BoatScript.c:350
void SyncSoundImpactHeavy()
Определения BoatScript.c:705
override void MarkCrewMemberDead(int crewMemberIndex)
Определения BoatScript.c:523
void SyncSoundPushBoat(bool play)
Определения BoatScript.c:714
override void EOnSimulate(IEntity other, float dt)
Определения BoatScript.c:393
const float DECAY_FLIPPED_MULT
Определения BoatScript.c:47
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
Определения BoatScript.c:449
override void CleanupEffects()
Определения BoatScript.c:844
override void FillScript(ETransportFluid fluidType, float amount)
Определения BoatScript.c:235
bool m_EngineFadeDirection
Определения BoatScript.c:70
ref EffectSound m_SoundEngineEffect
Определения BoatScript.c:84
string m_SoundEngineStart
Определения BoatScript.c:76
TInputActionMap m_InputActionMap
Определения BoatScript.c:54
bool m_IsEngineSoundFading
Определения BoatScript.c:69
override bool CrewCanGetThrough(int posIdx)
Определения BoatScript.c:205
bool m_PlaySoundImpactLight
Определения BoatScript.c:66
void ClearWaterEffects()
Определения BoatScript.c:825
override bool DisableVicinityIcon()
Определения BoatScript.c:170
const float DECAY_TICK_FREQUENCY
Определения BoatScript.c:45
void OnVehicleJumpOutServer(GetOutTransportActionData data)
Определения BoatScript.c:598
float m_EngineFadeTime
Определения BoatScript.c:71
void SetActions()
Определения BoatScript.c:758
void SyncSoundImpactLight()
Определения BoatScript.c:696
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
Определения BoatScript.c:868
ref EffectSound m_SoundWaterSplashEffect
Определения BoatScript.c:83
override float GetTransportCameraDistance()
Определения BoatScript.c:185
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Определения BoatScript.c:220
bool m_PlaySoundImpactHeavy
Определения BoatScript.c:67
override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance=1.0)
Определения BoatScript.c:215
const int DECAY_FLAG_RANGE
Определения BoatScript.c:44
bool m_SplashIncoming
Определения BoatScript.c:64
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
Определения BoatScript.c:210
void BoatScript()
Определения BoatScript.c:89
void StopParticleUpdate()
Определения BoatScript.c:819
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
Определения BoatScript.c:240
override string GetVehicleType()
Определения BoatScript.c:175
const float SPLASH_THRESHOLD_CONDITION
Определения BoatScript.c:50
void RemoveAction(typename actionName)
Определения BoatScript.c:798
const float SOUND_ENGINE_FADE
Определения BoatScript.c:49
string m_SoundEngineStop
Определения BoatScript.c:77
override void OnContact(string zoneName, vector localPos, IEntity other, Contact data)
WARNING: Can be called very frequently in one frame, use with caution.
Определения BoatScript.c:426
override bool OnBeforeEngineStart()
Определения BoatScript.c:250
override void OnVariablesSynchronized()
Определения BoatScript.c:460
bool m_ActionsInitialized
Определения BoatScript.c:55
void UpdateParticles(float timeSlice=0)
Определения BoatScript.c:811
ref EffectSound m_SoundEngineEffectDeletion
Определения BoatScript.c:85
override vector GetTransportCameraOffset()
Определения BoatScript.c:190
static ref map< typename, ref TInputActionMap > m_BoatTypeActionsMap
Определения BoatScript.c:53
void InitializeActions()
Определения BoatScript.c:147
const float DECAY_DAMAGE
Определения BoatScript.c:46
override void OnEngineStart()
Определения BoatScript.c:310
string m_SoundEngineStartNoFuel
Определения BoatScript.c:78
const float SPLASH_THRESHOLD
Определения BoatScript.c:51
override void EEOnCECreate()
Определения BoatScript.c:342
bool CheckOperationalState()
Определения BoatScript.c:572
override float OnSound(BoatSoundCtrl ctrl, float oldValue)
Определения BoatScript.c:497
Определения BoatScript.c:42
Определения BoatScript.c:31
static float GetBoatDecayMultiplier()
Определения CfgGameplayHandler.c:488
Определения Contact.c:10
static const int DAYZCAMERA_3RD_VEHICLE
generic vehicle 3rd person
Определения DayZPlayerCameras.c:19
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.
Определения 3_Game/DayZ/tools/Debug.c:318
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения 3_Game/DayZ/tools/Debug.c:188
Определения 3_Game/DayZ/tools/Debug.c:2
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:607
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
Определения human.c:1360
Определения EnEntity.c:165
static bool IsActionLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:749
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
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.
Определения EffectManager.c:216
static void EffectUnregisterEx(Effect effect)
Unregisters Effect in SEffectManager.
Определения EffectManager.c:400
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.
Определения EffectManager.c:153
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Определения EffectManager.c:280
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
Определения DayZPlayerImplement.c:39
Определения DamageSystem.c:2
Определения Transport.c:1145
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения Transport.c:70
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:305
static const vector Zero
Определения EnConvert.c:123
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.
Определения EnConvert.c:119
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
Serializer ParamsReadContext
Определения gameplay.c:15
const float CARS_CONTACT_DMG_THRESHOLD
Определения 3_Game/DayZ/constants.c:888
const float CARS_CONTACT_DMG_MIN
Определения 3_Game/DayZ/constants.c:889
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:463
EntityEvent
Entity events for event-mask, or throwing event from code.
Определения EnEntity.c:45
const int STATE_RUINED
Определения 3_Game/DayZ/constants.c:909
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,...
EmitorParam
Определения EnVisual.c:114
@ NONE
body is not in simulation, nor in collision world
Определения SimulationState.c:15
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
Определения 3_Game/DayZ/constants.c:486
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8
const float VEHICLE_FLIP_ANGLE_TOLERANCE
Определения 3_Game/DayZ/constants.c:868