91 Error(
"ERROR when creating a particle! Parameter parent_obj is NULL!");
247 if (parent && !ToDelete())
250 parent.RemoveChild(
this);
429 ErrorEx(
"Could not play Particle as there is no valid particle id assigned.");
552 if (!parent.ToDelete())
563 parent.AddChild(
this, -1,
false);
bool m_IsPlaying
Whether the Effect is currently playing.
void OnParticleStart()
Event when the particle starts.
void OnParticleEnd()
Event when the particle ends.
void OnParticleStop()
Event when the particle stops.
class JsonUndergroundAreaTriggerData GetPosition
Legacy way of using particles in the game.
bool m_IsRepeat
Whether this particle repeats.
static Particle Create(int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0")
Legacy function for backwards compatibility.
float GetMaxLifetime()
Returns the approx. max lifetime.
bool m_MarkedForDeletion
Whether this particle is queued for deletion.
void SetWiggle(float random_angle, float random_interval)
Makes the particle change direction by random_angle every random_interval seconds.
vector m_GlobalPosPreviousFrame
DEPRECATED.
void ParticleInit()
Purely here so that it can be emptied in ParticleSource.
vector m_DefaultPos
Used for Wiggle API, to restore after unparenting.
override bool StopParticle(int flags=0)
Method to tell the particle to stop playing.
void Play(int particle_id=-1)
Legacy function for backwards compatibility with 1.01 and below.
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.
Object m_ParticleEffect
The child object which contains the actual particle.
bool HasActiveParticle()
Returns if there is any particle active.
vector m_DefaultWorldOri
Used for Wiggle API, to restore after unparenting.
void ScaleParticleParamFromOriginal(int parameter_id, float coef)
Scales the given parameter on all emitors relatively to their ORIGINAL value.
vector m_DefaultOri
Used for Wiggle API, to restore after unparenting.
static Particle CreateInWorld(int particle_id, vector global_pos, vector global_ori="0 0 0", bool force_world_rotation=false)
Creates a particle emitter on the given position.
Object GetParticleParent()
Returns the parent of this Particle if there is one.
bool m_ForceOrientationRelativeToWorld
Used for Wiggle API, to restore after unparenting.
int GetParticleCount()
Returns the total count of active particles in all emitors.
static Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
void SetSource(int particle_id)
Sets particle id.
void ScaleParticleParam(int parameter_id, float coef)
Scales the given parameter on all emitors relatively to their CURRENT value.
void AddAsChild(Object parent, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
Attaches this particle onto some object. If null value is provided then the particle will be detached...
override void PlayParticle(int particle_id=-1)
Method to tell the particle to start playing.
static Particle CreateOnObject(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 and attaches it on the given object.
bool m_WiggleProcessing
Used for Wiggle API, to signal that wiggle API is currently doing work.
override bool PlayParticleEx(int particle_id=-1, int flags=0)
Method to tell the particle to start playing.
const int MAX_EMITORS
DEPRECATED.
void SetParticleParam(int parameter_id, float value)
Set the value of a parameter of all emitors in the particle.
static Particle Play(int particle_id, vector global_pos)
Legacy function for backwards compatibility with 1.01 and below.
int GetParticleID()
Gets particle id.
void OnCheckAutoDelete()
Creates ParticleEffect child, called from UpdateState.
void CreateParticleEffect()
Creates ParticleEffect child, called from UpdateState.
int m_PreviousFrame
DEPRECATED.
vector m_DefaultWorldPos
Used for Wiggle API, to restore after unparenting.
void SetParameter(int emitter, int parameter, float value)
Set the value of a parameter of an emitor in the particle.
float m_Lifetime
Approx. remaining lifetime of particle.
void DestroyParticleEffect()
Destroys ParticleEffect child, called from UpdateState.
vector RandWiggleVector()
Helper to get a randomized wiggle vector.
Object m_ParentObject
Parent Object the Particle is child of.
int m_ParticleID
ID from ParticleList if assigned.
void GetParameter(int emitter, int parameter, out float value)
Get the value of a parameter of an emitor in the particle.
void RandomizeOrientation()
Randomizes a new orientation and applies it.
bool IsRepeat()
Returns whether there is a repeating particle.
float GetParameterEx(int emitter, int parameter)
Get the value of a parameter of an emitor in the particle.
void UpdateState()
Creates/Destroys ParticleEffect child according to current state.
static Particle Play(int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0")
Legacy function for backwards compatibility with 1.01 and below.
float m_MaxOriWiggle
Used for Wiggle API, Wiggle room [-m_MaxOriWiggle, m_MaxOriWiggle].
float m_MaxOriInterval
Used for Wiggle API, Interval for wiggling [0, m_MaxOriInterval[.
float RandWiggleFloat()
Helper to get a randomized wiggle float value.
void OnToDelete()
Called before deletion from OnCheckAutoDelete.
void IncrementParticleParamFromOriginal(int parameter_id, float value)
Increments the value of the given parameter relatively from the ORIGINAL value.
static Particle Create(int particle_id, vector global_pos, vector global_ori="0 0 0")
Legacy function for backwards compatibility with 1.01 and below.
override void EOnFrame(IEntity other, float timeSlice)
OnFrame update event decrementing the stored approx. lifetime and checking for deletion.
void StopWiggle()
Stops randomized wiggle.
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Object GetDirectParticleEffect()
Returns direct particle effect entity which is usually handled by this class 'Particle' if there is o...
ref Timer m_RandomizeOri
Used for Wiggle API, calls the Wiggle functionality.
void IncrementParticleParam(int parameter_id, float value)
Increments the value of the given parameter relatively from the CURRENT value.
bool IsWiggling()
Checks if particle is currently wiggling.
static string GetParticleFullPath(int particle_id)
Returns particle's full path (with .ptc suffix) based on its ID.
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto native void SetPosition(vector position)
Set the world position of the Effect.
proto native void SetFlags(ShapeFlags flags)
EntityEvent
Entity events for event-mask, or throwing event from code.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
proto void SetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, void value)
bool ParticleHasActive(IEntity ent)
proto void GetParticleParmOriginal(notnull IEntity ent, int emitor, EmitorParam parameter, out void value)
int ParticleGetCount(IEntity ent)
proto int GetParticleEmitorCount(notnull IEntity ent)
proto void GetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, out void value)
proto native void ReleaseObject(vobject object, int flag=0)