DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
DynamicArea_Flare.c
Go to the documentation of this file.
1// The dummy entity which is spawned in the announcement process of Dynamic Contaminated Areas
3{
4 const float FALL_SPEED = 0.5; // The speed at which this object falls ( units per second )
5 const float LIFETIME = 40000; // How long this entity will stay in world
8 {
9 SetEventMask( EntityEvent.FRAME );
10 SetFlags( EntityFlags.ACTIVE, false );
11
12 // We create the particle effect
13 m_Particle = ParticleManager.GetInstance().PlayOnObject( ParticleList.FLAREPROJ_ACTIVATE_RED, this );
14
15 // We specify we will delete this object after set time
16 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater( GetGame().ObjectDeleteOnClient, LIFETIME, false, this );
17 }
18
19 // We slowly fall
20 override void EOnFrame( IEntity other, float timeSlice )
21 {
22 vector newPos = GetPosition();
23 newPos[1] = newPos[1] - ( FALL_SPEED * timeSlice );
24 SetPosition( newPos );
25 }
26
27 // We delete the entity and stop the particles
28 override void EEDelete( EntityAI parent )
29 {
30 if ( m_Particle )
32 }
33}
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
class JsonUndergroundAreaTriggerData GetPosition
override ScriptCallQueue GetCallQueue(int call_category)
Definition DayZGame.c:1153
private Particle m_Particle
override void EEDelete(EntityAI parent)
override void EOnFrame(IEntity other, float timeSlice)
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
static const int FLAREPROJ_ACTIVATE_RED
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto native CGame GetGame()
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition Effect.c:427
proto native void SetFlags(ShapeFlags flags)
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:45
EntityFlags
Entity flags.
Definition EnEntity.c:115
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8