PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
ParticleSource Class Reference

Entity which has the particle instance as an ObjectComponent. More...

Private Member Functions

void ParticleSource ()
 ctor
 
void ~ParticleSource ()
 dtor
 
override protected void ParticleInit ()
 Empty - Only needed for Particle.
 
proto native void SetParticleAutoDestroyFlags (ParticleAutoDestroyFlags flags)
 Enables the particle to automatically clean up itself when ending or stopping.
 
void DisableAutoDestroy ()
 Disables the particle automatically cleaning up itself when ending or stopping.
 
proto native int GetParticleAutoDestroyFlags ()
 Gets the currently set ParticleAutoDestroyFlags flags set on this ParticleSource.
 
Playback

Methods regarding playing/stopping of particle

private proto bool PlayParticleNative (int flags)
 Method to tell the particle to start playing.
 
override bool PlayParticleEx (int particle_id=-1, int flags=0)
 Method to tell the particle to start playing.
 
private proto bool StopParticleNative (int flags)
 Method to tell the particle to stop playing.
 
override bool StopParticle (int flags=0)
 Method to tell the particle to stop playing.
 
private proto native bool ResetParticleNative ()
 Method to tell the particle to reset.
 
override bool ResetParticle ()
 Method to tell the particle to reset.
 
private proto native bool RestartParticleNative ()
 Method to tell the particle to restart (reset + play)
 
override bool RestartParticle ()
 Method to tell the particle to restart (reset + play)
 
private proto bool IsParticlePlayingNative ()
 Ask if the particle is still playing.
 
override bool IsParticlePlaying ()
 Ask if the particle is still playing.
 
SetParticle

Methods that set the particle to be used

private proto native bool SetParticleNative (string path)
 Assigns a particle to the ParticleSource.
 
private bool SetParticle (string path)
 Assigns a particle to the ParticleSource.
 
bool SetParticleByID (int id)
 Assigns a particle to the ParticleSource.
 
override void SetSource (int particle_id)
 Sets particle id.
 
GetParticle

Methods that get the particle assigned

private proto bool GetParticleNative (out string path, EGetParticleMode mode)
 Gets the path to the currently assigned particle.
 
bool GetParticle (out string path, EGetParticleMode mode)
 Gets the path to the currently assigned particle.
 
override int GetParticleID ()
 Gets the ParticleList ID of the currently assigned particle.
 
int GetParticleIDLegacy ()
 Gets the ParticleList ID of the currently assigned particle.
 
Apply properties

Methods to apply properties to the particle

private proto native bool ApplyPropertiesNative (ParticleProperties properties)
 Applies the properties given to the ParticleSource.
 
bool ApplyProperties (ParticleProperties properties)
 Applies the properties given to the ParticleSource

 
Properties and state

Obtain information or set properties regarding the state of the Particle

override Object GetDirectParticleEffect ()
 Returns direct particle effect entity.
 
override Object GetParticleParent ()
 Returns the parent of this Particle if there is one.
 
private proto bool HasActiveParticleNative ()
 Returns if there is any particle active.
 
override bool HasActiveParticle ()
 Returns if there is any particle active.
 
private proto int GetParticleCountNative ()
 Returns the total count of active particles in all emitors.
 
override int GetParticleCount ()
 Returns the total count of active particles in all emitors.
 
private proto bool IsRepeatNative ()
 Returns whether there is a repeating particle.
 
override bool IsRepeat ()
 Returns whether there is a repeating particle.
 
private proto float GetMaxLifetimeNative ()
 Returns the approx. max lifetime.
 
override float GetMaxLifetime ()
 Returns the approx. max lifetime.
 
proto native Class GetOwner ()
 Get the owner of this ParticleSource.
 
proto native void SetOwner (Class owner)
 Set the owner of this ParticleSource.
 
proto native void Orphan ()
 null the owner of this ParticleSource
 
Owning ParticleManager

Methods regarding the owner

proto native ParticleManager GetParticleManager ()
 Get the ParticleManager the ParticleSource belongs to if any.
 
proto native int GetIndex ()
 Get the index of this ParticleSource in the owning ParticleManager.
 
Events

ParticleBase events For ParticleSource, these are handed on C++ side For more information, read ParticleEvents

override protected void OnParticleParented (IEntity parent)
 Event when the particle receives a parent.
 
override protected void OnParticleUnParented (IEntity parent)
 Event when the particle is orphaned.
 
override protected void OnParticleStop ()
 Event when the particle stops.
 
Misc backwards compatibility helpers

Helpers for misc backwards compatibility functionality

override 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 from the current parent.
 
Parameter API

Helpful methods for getting or setting parameters

override void SetParticleParam (int parameter_id, float value)
 Set the value of a parameter of all emitors in the particle.
 
override void SetParameter (int emitter, int parameter, float value)
 Set the value of a parameter of an emitor in the particle.
 
override void GetParameter (int emitter, int parameter, out float value)
 Get the value of a parameter of an emitor in the particle.
 
override float GetParameterEx (int emitter, int parameter)
 Get the value of a parameter of an emitor in the particle.
 
override void ScaleParticleParamFromOriginal (int parameter_id, float coef)
 Scales the given parameter on all emitors relatively to their ORIGINAL value.
 
override void ScaleParticleParam (int parameter_id, float coef)
 Scales the given parameter on all emitors relatively to their CURRENT value.
 
override void IncrementParticleParamFromOriginal (int parameter_id, float value)
 Increments the value of the given parameter relatively from the ORIGINAL value.
 
override void IncrementParticleParam (int parameter_id, float value)
 Increments the value of the given parameter relatively from the CURRENT value.
 
Wiggle API

Settings to make the Particle wiggle

override void SetWiggle (float random_angle, float random_interval)
 Makes the particle change direction by random_angle every random_interval seconds.
 
override void StopWiggle ()
 Stops randomized wiggle.
 
override private void RandomizeOrientation ()
 Randomizes a new orientation and applies it.
 
Misc Particle specific helpers

Functionality specific for Particle, so we empty them here

override private void UpdateState ()
 Empty.
 
override private void DestroyParticleEffect ()
 Empty.
 
override private void CreateParticleEffect ()
 Empty.
 
override protected void EOnFrame (IEntity other, float timeSlice)
 Empty.
 
override private void OnCheckAutoDelete ()
 Empty.
 
override private void OnToDelete ()
 Empty.
 

Static Private Member Functions

Create a particle (static)

Helper static methods to create/attach/play a ParticleSource on one line

static ParticleSource CreateParticle (int id, vector pos, bool playOnCreation=false, Object parent=null, vector ori=vector.Zero, bool forceWorldRotation=false, Class owner=null)
 Create function.
 
static ParticleSource CreateParticleEx (int id, vector pos, int flags=ParticlePropertiesFlags.NONE, Object parent=null, vector ori=vector.Zero, Class owner=null)
 Master create function.
 
static override 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.
 
static override 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.
 
static override 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.
 
static override ParticleSource Create (int particle_id, vector global_pos, vector global_ori="0 0 0")
 Legacy function for backwards compatibility with 1.01 and below.
 
Static play on creation

You can use the following Play(...) functions to create and activate a particle in 1 line of your script.

static override 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.
 
static override 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.
 
static override Particle PlayInWorld (int particle_id, vector global_pos)
 Creates a particle emitter on the given position and activates it.
 
static override Particle Play (int particle_id, vector global_pos)
 Legacy function for backwards compatibility with 1.01 and below.
 

Static counter API

Gives counter information for the class

proto int GetCountID ()
 Gets the ID for the ParticleSource.
 
proto static native int GetStaticCount ()
 Gets the amount of ParticleSource that have been created since the start of the program.
 
proto static native int GetStaticActiveCount ()
 Gets the amount of ParticleSource that are currently existing.
 

Detailed Description

Entity which has the particle instance as an ObjectComponent.

Note
Unfortunately the native methods are private and have a script wrapper This is because of backwards compatibility with the old Particle and to avoid confusion As we should continue to use Particle for consistency, as it is too deeply rooted in script Which means switching is no longer possible due to it being harmful for already existing mods Even though using the ParticleSource directly would be preferred
Some variables from Particle are invalid on this level, those marked DEPRECATED by Particle are still DEPRECATED here m_ParticleID; //!< INVALID - Use GetParticleID() instead m_Lifetime; //!< INVALID - No EOnFrame, so no use for it m_IsPlaying; //!< VALID - Set through events - IsParticlePlaying() is still better m_IsRepeat; //!< INVALID - Use IsRepeat() instead m_MarkedForDeletion; //!< INVALID - No EOnFrame, so no use for it Wiggle API variables are still used for Wiggle API m_ParentObject; //!< VALID - Set through events - Or use GetParticleParent() or GetParent() m_ParticleEffect; //!< VALID - Not in the same usage as Particle, as it will always be 'this', never null

Constructor & Destructor Documentation

◆ ParticleSource()

void ParticleSource ( )
inlineprivate

ctor

References Particle::m_ParticleEffect.

◆ ~ParticleSource()

void ~ParticleSource ( )
inlineprivate

dtor

Member Function Documentation

◆ AddAsChild()

override void AddAsChild ( Object  parent,
vector  local_pos = "0 0 0",
vector  local_ori = "0 0 0",
bool  force_rotation_to_world = false 
)
inlineprivate

Attaches this particle onto some object. If null value is provided then the particle will be detached from the current parent.

Note
Unlike Particle, you are free to use AddChild/RemoveChild instead of this one if you know what you are doing
Parameters
parentObject Parent onto which this particle will be attached
local_posvector Attachment position local to the parent (optional)
local_orivector Orientation local to the parent (Pitch, Yawn, Roll in degrees) (Optional)
force_rotation_to_worldbool Force rotation to be in WS (Optional)

References ApplyProperties().

Referenced by DestructionEffectBase::PlayParticle().

◆ ApplyProperties()

bool ApplyProperties ( ParticleProperties  properties)
inlineprivate

Applies the properties given to the ParticleSource

Parameters
propertiesParticleProperties The properties to apply
Returns
bool Whether the properties were successfully applied

References ApplyPropertiesNative().

Referenced by AddAsChild(), CreateParticleEx(), RandomizeOrientation(), and StopWiggle().

◆ ApplyPropertiesNative()

private proto native bool ApplyPropertiesNative ( ParticleProperties  properties)
private

Applies the properties given to the ParticleSource.

Note
Already handles proper reparenting
Parameters
propertiesParticleProperties The properties to apply
Returns
bool Whether the properties were successfully applied

Referenced by ApplyProperties().

◆ Create() [1/2]

static override Particle Create ( int  particle_id,
Object  parent_obj,
vector  local_pos = "0 0 0",
vector  local_ori = "0 0 0" 
)
inlinestaticprivate

Legacy function for backwards compatibility.

References CreateOnObject(), and particle_id.

◆ Create() [2/2]

static override ParticleSource Create ( int  particle_id,
vector  global_pos,
vector  global_ori = "0 0 0" 
)
inlinestaticprivate

Legacy function for backwards compatibility with 1.01 and below.

References CreateInWorld(), and particle_id.

◆ CreateInWorld()

static override Particle CreateInWorld ( int  particle_id,
vector  global_pos,
vector  global_ori = "0 0 0",
bool  force_world_rotation = false 
)
inlinestaticprivate

Creates a particle emitter on the given position.

Parameters
particle_idint Particle ID registered in ParticleList
global_posVector Position where the particel will be created
global_orivector Orientation (Pitch, Yawn, Roll in degrees) (Optional)
force_world_rotationbool Has absolutely no effect here as there is no parent
Returns
Particle Created particle instance

References CreateParticle(), and particle_id.

Referenced by Create().

◆ CreateOnObject()

static override 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 
)
inlinestaticprivate

Creates a particle emitter and attaches it on the given object.

Parameters
particle_idint Particle ID registered in ParticleList
parent_objObject Instance on which this particle will be attached
local_posvector Attachment position local to the parent (Optional)
local_orivector Orientation local to the parent (Pitch, Yaw, Roll in degrees) (Optional)
force_world_rotationbool Forces particle's orientation to rotate relative to the world and not with the object (Optional)
Returns
Particle Created particle instance

References CreateParticle(), and particle_id.

Referenced by Create().

◆ CreateParticle()

static ParticleSource CreateParticle ( int  id,
vector  pos,
bool  playOnCreation = false,
Object  parent = null,
vector  ori = vector.Zero,
bool  forceWorldRotation = false,
Class  owner = null 
)
inlinestaticprivate

Create function.

Parameters
idint Particle ID registered in ParticleList
posvector Position of ParticleSource in LS (WS when no parent)
playOnCreationbool Whether to play immediately after creation (Optional)
parentObject Parent Object which will child the ParticleSource (Optional)
orivector Orientation of ParticleSource in LS (WS when no parent) (Pitch, Yaw, Roll in degrees) (Optional)
forceWorldRotationbool Forces orientation to rotate relative to the world and not with the parent (Optional)
ownerClass The owning instance for this particle (Optional)
Returns
ParticleSource Created particle instance when successful

References CreateParticleEx().

Referenced by PMTPlayback::TestOnePlayingStandAlone(), PMTPlayback::TestOnePlayingStandAloneAutoDestroy(), PMTPlayback::TestStopping(), and PMTPlayback::TestWiggleStress().

◆ CreateParticleEffect()

override private void CreateParticleEffect ( )
inlineprivate

Empty.

References ErrorEx.

◆ CreateParticleEx()

static ParticleSource CreateParticleEx ( int  id,
vector  pos,
int  flags = ParticlePropertiesFlags.NONE,
Object  parent = null,
vector  ori = vector.Zero,
Class  owner = null 
)
inlinestaticprivate

Master create function.

Parameters
idint Particle ID registered in ParticleList
posvector Position of ParticleSource in LS (WS when no parent)
flagsint See ParticlePropertiesFlags (Optional)
parentObject Parent Object which will child the ParticleSource (Optional)
orivector Orientation of ParticleSource in LS (WS when no parent) (Pitch, Yaw, Roll in degrees) (Optional)
ownerClass The owning instance for this particle (Optional)
Returns
ParticleSource Created particle instance when successful

References ApplyProperties(), ECE_LOCAL, ErrorEx, GetGame(), ParticleList::GetParticleFullPath(), and SetParticle().

Referenced by CreateParticle().

◆ DestroyParticleEffect()

override private void DestroyParticleEffect ( )
inlineprivate

Empty.

References ErrorEx.

◆ DisableAutoDestroy()

void DisableAutoDestroy ( )
inlineprivate

Disables the particle automatically cleaning up itself when ending or stopping.

References SetParticleAutoDestroyFlags().

Referenced by PMTPlayback::TestOnePlayingStandAlone(), and PMTPlayback::TestStopping().

◆ EOnFrame()

override protected void EOnFrame ( IEntity  other,
float  timeSlice 
)
inlineprivate

Empty.

References ErrorEx.

◆ GetCountID()

proto int GetCountID ( )
private

Gets the ID for the ParticleSource.

Note
Different every restart, as it is the nth instance created since the start of the program
Returns
int ID for the ParticleSource

◆ GetDirectParticleEffect()

override Object GetDirectParticleEffect ( )
inlineprivate

Returns direct particle effect entity.

Note
Backwards compatibility with Particle, here it is the Object itself
Returns
Object The Object with the particle component (this)

◆ GetIndex()

proto native int GetIndex ( )
private

Get the index of this ParticleSource in the owning ParticleManager.

Returns
int The index in the pool in the owning ParticleManager, -1 if no owner

◆ GetMaxLifetime()

override float GetMaxLifetime ( )
inlineprivate

Returns the approx. max lifetime.

Returns
float The largest lifetime sum among the emitors

References GetMaxLifetimeNative().

◆ GetMaxLifetimeNative()

private proto float GetMaxLifetimeNative ( )
private

Returns the approx. max lifetime.

Returns
float The largest lifetime sum among the emitors

Referenced by GetMaxLifetime().

◆ GetOwner()

proto native Class GetOwner ( )
private

Get the owner of this ParticleSource.

Returns
Class The owner or null

Referenced by RandomizeOrientation(), and StopWiggle().

◆ GetParameter()

override void GetParameter ( int  emitter,
int  parameter,
out float  value 
)
inlineprivate

Get the value of a parameter of an emitor in the particle.

Parameters
emitterint The emitor to get the value from
parameterint The parameter to get the value from (enum EmitorParam)
valuefloat The value

References GetParticleParm().

◆ GetParameterEx()

override float GetParameterEx ( int  emitter,
int  parameter 
)
inlineprivate

Get the value of a parameter of an emitor in the particle.

Parameters
emitterint The emitor to get the value from
parameterint The parameter to get the value from (enum EmitorParam)
Returns
float The value

References GetParticleParm().

◆ GetParticle()

bool GetParticle ( out string  path,
EGetParticleMode  mode 
)
inlineprivate

Gets the path to the currently assigned particle.

Parameters
pathstring Path of particle effect
modeEGetParticleMode What path to return
Returns
bool Whether the path is filled in or not

References GetParticleNative(), and path.

Referenced by PMTPlayback::CheckOnePlaying(), GetParticleID(), and GetParticleIDLegacy().

◆ GetParticleAutoDestroyFlags()

proto native int GetParticleAutoDestroyFlags ( )
private

Gets the currently set ParticleAutoDestroyFlags flags set on this ParticleSource.

Returns
int Currently set ParticleAutoDestroyFlags flags set on this ParticleSource

◆ GetParticleCount()

override int GetParticleCount ( )
inlineprivate

Returns the total count of active particles in all emitors.

Note
Internally does a sum, HasActiveParticle is better for a quick check
Returns
int Total count of active particles

References GetParticleCountNative().

◆ GetParticleCountNative()

private proto int GetParticleCountNative ( )
private

Returns the total count of active particles in all emitors.

Note
Internally does a sum, HasActiveParticle is better for a quick check
Returns
int Total count of active particles

Referenced by GetParticleCount().

◆ GetParticleID()

override int GetParticleID ( )
inlineprivate

Gets the ParticleList ID of the currently assigned particle.

Returns
int ID of particle registered in ParticleList

References GetParticle(), ParticleList::GetParticleIDByName(), and path.

◆ GetParticleIDLegacy()

int GetParticleIDLegacy ( )
inlineprivate

Gets the ParticleList ID of the currently assigned particle.

Note
This is because the new GetParticleID will only work when every particle file name has a unique name In case this is not the case, then this method is what one will want to use
Returns
int ID of particle registered in ParticleList

References GetParticle(), ParticleList::GetParticleID(), and path.

◆ GetParticleManager()

proto native ParticleManager GetParticleManager ( )
private

Get the ParticleManager the ParticleSource belongs to if any.

Returns
ParticleManager The ParticleManager which created the ParticleSource or null

◆ GetParticleNative()

private proto bool GetParticleNative ( out string  path,
EGetParticleMode  mode 
)
private

Gets the path to the currently assigned particle.

Parameters
pathstring Path of particle effect
modeEGetParticleMode What path to return
Returns
bool Whether the path is filled in or not

Referenced by GetParticle().

◆ GetParticleParent()

override Object GetParticleParent ( )
inlineprivate

Returns the parent of this Particle if there is one.

Returns
Object The parent or null if there is none

References GetParent().

Referenced by RandomizeOrientation(), and StopWiggle().

◆ GetStaticActiveCount()

proto static native int GetStaticActiveCount ( )
staticprivate

Gets the amount of ParticleSource that are currently existing.

Returns
int Amount of ParticleSource that are currently existing

Referenced by PMTF::PrintActiveStats(), and TestCleanup().

◆ GetStaticCount()

proto static native int GetStaticCount ( )
staticprivate

Gets the amount of ParticleSource that have been created since the start of the program.

Returns
int Amount of ParticleSource that have been created since the start of the program

◆ HasActiveParticle()

override bool HasActiveParticle ( )
inlineprivate

Returns if there is any particle active.

Returns
bool Whether there is any particle active

References HasActiveParticleNative().

◆ HasActiveParticleNative()

private proto bool HasActiveParticleNative ( )
private

Returns if there is any particle active.

Returns
bool Whether there is any particle active

Referenced by HasActiveParticle().

◆ IncrementParticleParam()

override void IncrementParticleParam ( int  parameter_id,
float  value 
)
inlineprivate

Increments the value of the given parameter relatively from the CURRENT value.

Note
It's a simple sum, so negative value decrements
Parameters
parameter_idint The parameter to adjust (enum EmitorParam)
valuefloat The value to sum

References GetParticleEmitorCount(), GetParticleParm(), and SetParticleParm().

Referenced by HotSpringTrigger::SpawnVaporEffect(), and VolcanicTrigger::SpawnVaporEffect().

◆ IncrementParticleParamFromOriginal()

override void IncrementParticleParamFromOriginal ( int  parameter_id,
float  value 
)
inlineprivate

Increments the value of the given parameter relatively from the ORIGINAL value.

Note
It's a simple sum, so negative value decrements
Parameters
parameter_idint The parameter to adjust (enum EmitorParam)
valuefloat The value to sum

References GetParticleEmitorCount(), GetParticleParmOriginal(), and SetParticleParm().

◆ IsParticlePlaying()

◆ IsParticlePlayingNative()

private proto bool IsParticlePlayingNative ( )
private

Ask if the particle is still playing.

Returns
bool Whether the particle is playing

Referenced by IsParticlePlaying().

◆ IsRepeat()

override bool IsRepeat ( )
inlineprivate

Returns whether there is a repeating particle.

Returns
bool whether there is a repeating particle

References IsRepeatNative().

◆ IsRepeatNative()

private proto bool IsRepeatNative ( )
private

Returns whether there is a repeating particle.

Returns
bool whether there is a repeating particle

Referenced by IsRepeat().

◆ OnCheckAutoDelete()

override private void OnCheckAutoDelete ( )
inlineprivate

Empty.

References ErrorEx.

◆ OnParticleParented()

override protected void OnParticleParented ( IEntity  parent)
inlineprivate

Event when the particle receives a parent.

References Particle::m_ParentObject.

◆ OnParticleStop()

override protected void OnParticleStop ( )
inlineprivate

Event when the particle stops.

References Particle::IsWiggling(), Particle::m_RandomizeOri, and StopWiggle().

◆ OnParticleUnParented()

◆ OnToDelete()

override private void OnToDelete ( )
inlineprivate

Empty.

References ErrorEx.

◆ Orphan()

proto native void Orphan ( )
private

null the owner of this ParticleSource

◆ ParticleInit()

override protected void ParticleInit ( )
inlineprivate

Empty - Only needed for Particle.

◆ Play() [1/2]

static override Particle Play ( int  particle_id,
Object  parent_obj,
vector  local_pos = "0 0 0",
vector  local_ori = "0 0 0" 
)
inlinestaticprivate

Legacy function for backwards compatibility with 1.01 and below.

References particle_id, and PlayOnObject().

◆ Play() [2/2]

static override Particle Play ( int  particle_id,
vector  global_pos 
)
inlinestaticprivate

Legacy function for backwards compatibility with 1.01 and below.

References particle_id, and PlayInWorld().

◆ PlayInWorld()

static override Particle PlayInWorld ( int  particle_id,
vector  global_pos 
)
inlinestaticprivate

Creates a particle emitter on the given position and activates it.

Parameters
particle_idint Particle ID registered in ParticleList
global_posVector Position where the particel will be created
Returns
Particle Created particle instance

References CreateParticle(), and particle_id.

Referenced by Play().

◆ PlayOnObject()

static override 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 
)
inlinestaticprivate

Creates a particle emitter, attaches it on the given object and activates it.

Parameters
particle_idint Particle ID registered in ParticleList
parent_objObject Instance on which this particle will be attached
local_posvector Attachment position local to the parent (Optional)
local_orivector Orientation local to the parent (Pitch, Yaw, Roll in degrees) (Optional)
force_world_rotationbool Forces particle's orientation to rotate relative to the world and not with the object (Optional)
Returns
Particle Created particle instance

References CreateParticle(), and particle_id.

Referenced by Play().

◆ PlayParticleEx()

override bool PlayParticleEx ( int  particle_id = -1,
int  flags = 0 
)
inlineprivate

Method to tell the particle to start playing.

Parameters
particle_idint Particle ID registered in ParticleList to start playing
Returns
bool Whether the particle successfully started

References particle_id, PlayParticleNative(), and SetParticleByID().

◆ PlayParticleNative()

private proto bool PlayParticleNative ( int  flags)
private

Method to tell the particle to start playing.

Note
Will call OnParticleStart when successful
Returns
bool Whether the particle successfully started

Referenced by PlayParticleEx().

◆ RandomizeOrientation()

◆ ResetParticle()

override bool ResetParticle ( )
inlineprivate

Method to tell the particle to reset.

Returns
bool Whether the particle successfully reset

References ResetParticleNative().

◆ ResetParticleNative()

private proto native bool ResetParticleNative ( )
private

Method to tell the particle to reset.

Returns
bool Whether the particle successfully reset

Referenced by ResetParticle().

◆ RestartParticle()

override bool RestartParticle ( )
inlineprivate

Method to tell the particle to restart (reset + play)

Returns
bool Whether the particle successfully restarted

References RestartParticleNative().

◆ RestartParticleNative()

private proto native bool RestartParticleNative ( )
private

Method to tell the particle to restart (reset + play)

Returns
bool Whether the particle successfully restarted

Referenced by RestartParticle().

◆ ScaleParticleParam()

override void ScaleParticleParam ( int  parameter_id,
float  coef 
)
inlineprivate

Scales the given parameter on all emitors relatively to their CURRENT value.

Parameters
parameter_idint The parameter to adjust (enum EmitorParam)
coeffloat The multiplier to apply

References GetParticleEmitorCount(), GetParticleParm(), and SetParticleParm().

◆ ScaleParticleParamFromOriginal()

override void ScaleParticleParamFromOriginal ( int  parameter_id,
float  coef 
)
inlineprivate

Scales the given parameter on all emitors relatively to their ORIGINAL value.

Parameters
parameter_idint The parameter to adjust (enum EmitorParam)
coeffloat The multiplier to apply

References GetParticleEmitorCount(), GetParticleParmOriginal(), and SetParticleParm().

◆ SetOwner()

proto native void SetOwner ( Class  owner)
private

◆ SetParameter()

override void SetParameter ( int  emitter,
int  parameter,
float  value 
)
inlineprivate

Set the value of a parameter of an emitor in the particle.

Parameters
emitterint The emitter to apply the new value to, -1 for all emitter
parameterint The parameter to apply the new value to (enum EmitorParam)
valuefloat The value to apply

References SetParticleParm().

◆ SetParticle()

private bool SetParticle ( string  path)
inlineprivate

Assigns a particle to the ParticleSource.

Note
Intentionally private, as it is best to use 'SetParticleByID' instead from script, because ParticleList
Parameters
pathstring Path of particle effect
Returns
bool Whether the creating and assigning of particle was successful

References path, and SetParticleNative().

Referenced by CreateParticleEx(), and SetParticleByID().

◆ SetParticleAutoDestroyFlags()

proto native void SetParticleAutoDestroyFlags ( ParticleAutoDestroyFlags  flags)
private

Enables the particle to automatically clean up itself when ending or stopping.

Note
Is enabled by default (ALL)
Looping particles never end
ParticleSource belonging to a ParticleManager will ignore these
Parameters
flagsParticleAutoDestroyFlags Flags enabling when the particle should be auto destroyed

Referenced by DisableAutoDestroy(), and Edible_Base::UpdateVaporParticle().

◆ SetParticleByID()

bool SetParticleByID ( int  id)
inlineprivate

Assigns a particle to the ParticleSource.

Parameters
idint ID of particle registered in ParticleList
Returns
bool Whether the creating and assigning of particle was successful

References ParticleList::GetParticleFullPath(), and SetParticle().

Referenced by PlayParticleEx(), and SetSource().

◆ SetParticleNative()

private proto native bool SetParticleNative ( string  path)
private

Assigns a particle to the ParticleSource.

Parameters
pathstring Path of particle effect
Returns
bool Whether the creating and assigning of particle was successful

Referenced by SetParticle().

◆ SetParticleParam()

override void SetParticleParam ( int  parameter_id,
float  value 
)
inlineprivate

Set the value of a parameter of all emitors in the particle.

Parameters
parameterint The parameter to apply the new value to (enum EmitorParam)
valuefloat The value to apply

References SetParticleParm().

Referenced by Edible_Base::UpdateVaporParticle().

◆ SetSource()

override void SetSource ( int  particle_id)
inlineprivate

Sets particle id.

Note
Purely here for backwards compatibility with Particle
Parameters
particle_idint Particle ID registered in ParticleList to start playing

References particle_id, and SetParticleByID().

◆ SetWiggle()

override void SetWiggle ( float  random_angle,
float  random_interval 
)
inlineprivate

Makes the particle change direction by random_angle every random_interval seconds.

Note
This does not actually work on Particle with no parent, it should on ParticleSource
Parameters
random_anglefloat Will be the range [-random_angle, random_angle[ to wiggle between
random_intervalfloat Will be the time range [0, random_interval] to wiggle next time

References GetLocalPosition(), Particle::IsWiggling(), Particle::m_DefaultOri, Particle::m_DefaultPos, Particle::m_DefaultWorldOri, Particle::m_DefaultWorldPos, Particle::m_ForceOrientationRelativeToWorld, Particle::m_MaxOriInterval, Particle::m_MaxOriWiggle, and Update().

Referenced by OnParticleUnParented(), and PMTPlayback::TestWiggleStress().

◆ StopParticle()

override bool StopParticle ( int  flags = 0)
inlineprivate

Method to tell the particle to stop playing.

Parameters
flagsint Flags to pass to the stopping (StopParticleFlags)
Returns
bool Whether the particle successfully stopped

References StopParticleNative().

Referenced by PMTPlayback::CheckStop(), FireworksLauncher::OnFiringStartClient(), GeyserTrigger::StopEffects(), GeyserTrigger::UpdateGeyserState(), and FireworksLauncherClientEvent::~FireworksLauncherClientEvent().

◆ StopParticleNative()

private proto bool StopParticleNative ( int  flags)
private

Method to tell the particle to stop playing.

Note
The particle is not immediately stopped by default, instead it will gradually fade If this is however desired, then pass in StopParticleFlags.IMMEDIATE
Parameters
flagsint Flags to pass to the stopping (StopParticleFlags)
Returns
bool Whether the particle successfully stopped

Referenced by StopParticle().

◆ StopWiggle()

◆ UpdateState()

override private void UpdateState ( )
inlineprivate

Empty.

References ErrorEx.


The documentation for this class was generated from the following file: