DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
CrashBase.c
Go to the documentation of this file.
1class CrashBase extends House
2{
4 static bool m_Init = Init();
5
6 static bool Init()
7 {
8 CrashSoundSets.RegisterSoundSet("HeliCrash_Distant_SoundSet");
9 CrashSoundSets.RegisterSoundSet("SledgeCrash_Distant_SoundSet");
10 return true;
11 }
12
13 override void EEOnCECreate()
14 {
15 super.EEOnCECreate();
16 RequestSoundEvent();
17 }
18
20 {
21 Param3<bool, vector, int> playSound = new Param3<bool, vector, int>(true, GetPosition(), GetSoundSet().Hash());
22 GetGame().RPCSingleParam( null, ERPCs.RPC_SOUND_HELICRASH, playSound, true );
23 }
24
25 // needs to have the soundset registered in CrashBase.Init()
26 string GetSoundSet()
27 {
28 return "HeliCrash_Distant_SoundSet";
29 }
30
31 override void EEInit()
32 {
33 super.EEInit();
34 //Setup for local sound tests
35 #ifdef DEVELOPER
36 if ( !GetGame().IsMultiplayer() )
37 {
39 eff.SetAutodestroy(true);
40 }
41 #endif
42 }
43
44 override void EEDelete(EntityAI parent)
45 {
46 if ( !GetGame().IsDedicatedServer() )
47 {
48 if ( m_ParticleEfx )
49 m_ParticleEfx.Stop();
50 }
51 }
52};
override Widget Init()
Definition DayZGame.c:122
ERPCs
Definition ERPCs.c:2
class JsonUndergroundAreaTriggerData GetPosition
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Definition Game.c:882
override string GetSoundSet()
static void RegisterSoundSet(string sound_set)
Definition DayZGame.c:48
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
void RequestSoundEvent()
Definition CrashBase.c:19
override void EEInit()
Definition CrashBase.c:31
override void EEOnCECreate()
Definition CrashBase.c:13
Particle m_ParticleEfx
Definition CrashBase.c:3
override void EEDelete(EntityAI parent)
Definition CrashBase.c:44
string GetSoundSet()
Definition CrashBase.c:26
static bool Init()
Definition CrashBase.c:6
Legacy way of using particles in the game.
Definition Particle.c:7
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition Particle.c:266
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
proto native CGame GetGame()