Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
particletest.c
Go to the documentation of this file.
1// Particle test for Maxman
2
3class ParticleTest extends ItemBase
4{
5 protected int PARTICLE_PATH;
7
8 // Constructor
10 {
11 if ( !GetGame().IsServer() || !GetGame().IsMultiplayer() ) // Client side
12 {
13 string path = ParticleList.GetPathToParticles();
14
15
16
17
18
19 // Enter particle ID to play when ParticleTest spawns
20 PARTICLE_PATH = ParticleList.DEBUG_DOT;
21
22 // Alternatively, uncomment the second line and enter particle filename without *.ptc suffix instead. Example: "menu_engine_fire"
23 string particle_filename = "menu_engine_fire";
24 //PARTICLE_PATH = ParticleList.GetParticleID( path + particle_filename );
25
26
27
28
29
30 m_Particle = ParticleManager.GetInstance().PlayOnObject( PARTICLE_PATH, this, GetPosition());
31 }
32 }
33
34 // Destructor
35 override void EEDelete(EntityAI parent)
36 {
37 super.EEDelete(parent);
38
39 if (m_Particle && GetGame()) // GetGame() is null when the game is being shut down
40 {
41 m_Particle.Stop();
42 GetGame().ObjectDelete(m_Particle);
43 }
44 }
45}
override void EEDelete(EntityAI parent)
void ParticleTest()
Definition particletest.c:9
Particle m_Particle
Definition particletest.c:6
int PARTICLE_PATH
Definition particletest.c:5
Legacy way of using particles in the game.
Definition particle.c:7
static Particle PlayOnObject(int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_world_rotation=false)
Creates a particle emitter, attaches it on the given object and activates it.
Definition particle.c:152
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition particle.c:266
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)