Data Structures | |
| class | ParticleManagerConstants |
| Class simply to have easily modded constants. More... | |
| class | ParticleManagerEvents |
| Invokers for ParticleManager events. More... | |
Enumerations | |
| enum | ParticleManagerSettingsFlags { NONE , FIXED_INDEX , BLOCKING , DISABLE_VIRTUAL , REUSE_OWNED } |
| Flags for ParticleManagerSettings. More... | |
Functions | |
| class ParticleManagerConstants | ParticleManagerSettings (int poolSize, int flags=ParticleManagerSettingsFlags.NONE) |
| Settings given to ParticleManager on creation (in ctor) | |
| void | ~ParticleManagerSettings () |
| dtor | |
| static ParticleManager | GetInstance () |
| Access to the static ParticleManager. | |
| static void | CleanupInstance () |
| To clean it up properly before game closes. | |
| void | ParticleManager (ParticleManagerSettings settings) |
| Constructor (ctor) | |
| void | ~ParticleManager () |
| dtor | |
API for compatibility with Particle/ParticleSource create/play | |
Mimics the static Create and Play methods from Particle/ParticleSource | |
| ParticleSource | CreateParticle (int id, vector pos, bool playOnCreation=false, Object parent=null, vector ori=vector.Zero, bool forceWorldRotation=false, Class owner=null) |
| Create function. | |
| ParticleSource | CreateParticleEx (int id, vector pos, int flags=ParticlePropertiesFlags.NONE, Object parent=null, vector ori=vector.Zero, Class owner=null) |
| Master create function. | |
| ParticleSource | 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. | |
| ParticleSource | Create (int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0") |
| Legacy function for backwards compatibility. | |
| ParticleSource | 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. | |
| 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. | |
| ParticleSource | 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. | |
| ParticleSource | 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. | |
| ParticleSource | PlayInWorld (int particle_id, vector global_pos) |
| Creates a particle emitter on the given position and activates it. | |
| ParticleSource | PlayInWorldEx (int particle_id, Object parent_obj, vector global_pos, vector global_ori="0 0 0", bool force_world_rotation=false) |
| ParticleSource | Play (int particle_id, vector global_pos) |
| Legacy function for backwards compatibility with 1.01 and below. | |
Get Particles | |
API for creating, playing or obtaining particles from the pool | |
| proto native int | CreateParticles (array< ParticleSource > particles, string path, notnull ParticlePropertiesArray properties, int count=1) |
| Creates an amount of particles with the properties given. | |
| ParticleSource | CreateParticleByPath (string path, notnull ParticleProperties properties) |
| Create a particle. | |
| int | CreateParticlesById (int id, notnull ParticlePropertiesArray properties, int count) |
| QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as well. | |
| array< ParticleSource > | CreateParticlesByIdArr (int id, notnull ParticlePropertiesArray properties, int count) |
| QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as well. | |
| ParticleSource | CreateParticleById (int id, ParticleProperties properties) |
| QoL function for when only one particle is needed using script ParticleList, strongly recommend to read comments for CreateParticles as well. | |
| proto native int | PlayParticles (out array< ParticleSource > particles, string path, notnull array< vector > positions, int count=1) |
| QoL function for when wanting to play a particle at a position right away. | |
| array< ParticleSource > | PlayParticlesById (int id, array< vector > positions, int count) |
| QoL function using script ParticleList, strongly recommend to read comments for PlayParticles as well. | |
| ParticleSource | PlayParticleById (int id, array< vector > position) |
| QoL function for when only one particle is needed using script ParticleList, strongly recommend to read comments for PlayParticles as well. | |
| proto native ParticleSource | GetParticle (int index) |
| Manually get the particle at index. | |
| proto native int | GetParticles (out array< ParticleSource > outArray, int startIndex, int count) |
| Manually get a portion of the particles in the pool. | |
| array< ParticleSource > | GetParticlesEx (int startIndex, int count) |
| Manually get a portion of the particles in the pool. | |
Identification | |
Identification functionality | |
| proto native void | SetName (string name) |
| Set a name for the ParticleManager to identify it more easily. | |
| proto string | GetName () |
| Gets the name which is set for the ParticleManager, default is "ParticleSourceManager". | |
| proto string | GetDebugNameNative () |
| Gets the debug name for the ParticleManager. | |
| override string | GetDebugName () |
| Gets the debug name for the ParticleManager. | |
| proto int | GetCountID () |
| Gets the ID for the ParticleManager. | |
| proto static native int | GetStaticCount () |
| Gets the amount of ParticleManager that have been created since the start of the program. | |
| proto static native int | GetStaticActiveCount () |
| Gets the amount of ParticleManager that are currently existing. | |
Properties and state | |
Obtain information about the state of the ParticleManager | |
| proto native int | GetPoolSize () |
| Gets the fixed maximum size of the pool. | |
| proto native int | GetAllocatedCount () |
| Gets the amount of particles currently allocated. | |
| proto native int | GetVirtualCount () |
| Gets the amount of virtual particles. | |
| proto native int | GetPlayingCount () |
| Gets the amount of playing particles. | |
| proto native bool | IsFinishedAllocating () |
| Checks if the ParticleManager has allocated all slots in the pool. | |
Script Events API | |
Setting and getting of ScriptEvents | |
| private proto void | SetScriptEvents (Managed events) |
| Set the events. | |
| private proto Managed | GetScriptEvents () |
| Get the events. | |
| ParticleManagerEvents | GetEvents () |
| Get the events. | |
Events | |
Events called from C++ | |
| void | OnAllocation (array< ParticleSource > allocatedParticles) |
| void | OnAllocationEnd () |
Variables | |
| class ParticleManagerEvents | g_ParticleManager |
| Has a fixed pool of precreated and reserved particles. | |
Global ParticleManager settings | |
Settings applied to the global ParticleManager | |
| static const int | POOL_SIZE = 10000 |
| static const int | FLAGS = ParticleManagerSettingsFlags.NONE |
Flags for ParticleManagerSettings.
|
static |
To clean it up properly before game closes.
References g_ParticleManager.
| ParticleSource Create | ( | int | particle_id, |
| Object | parent_obj, | ||
| vector | local_pos = "0 0 0", |
||
| vector | local_ori = "0 0 0" |
||
| ) |
Legacy function for backwards compatibility.
References CreateOnObject(), and particle_id.
| ParticleSource Create | ( | int | particle_id, |
| vector | global_pos, | ||
| vector | global_ori = "0 0 0" |
||
| ) |
Legacy function for backwards compatibility with 1.01 and below.
References CreateInWorld(), and particle_id.
| ParticleSource 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.
| particle_id | int Particle ID registered in ParticleList |
| global_pos | Vector Position where the particel will be created |
| global_ori | vector Orientation (Pitch, Yawn, Roll in degrees) (Optional) |
| force_world_rotation | bool Has absolutely no effect here as there is no parent |
ParticleSource Created particle instance References CreateParticle(), and particle_id.
Referenced by Create().
| ParticleSource 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.
| particle_id | int Particle ID registered in ParticleList |
| parent_obj | Object Instance on which this particle will be attached |
| local_pos | vector Attachment position local to the parent (Optional) |
| local_ori | vector Orientation local to the parent (Pitch, Yaw, Roll in degrees) (Optional) |
| force_world_rotation | bool Forces particle's orientation to rotate relative to the world and not with the object (Optional) |
ParticleSource Created particle instance References CreateParticle(), and particle_id.
Referenced by Create().
| ParticleSource CreateParticle | ( | int | id, |
| vector | pos, | ||
| bool | playOnCreation = false, |
||
| Object | parent = null, |
||
| vector | ori = vector.Zero, |
||
| bool | forceWorldRotation = false, |
||
| Class | owner = null |
||
| ) |
Create function.
| id | int Particle ID registered in ParticleList |
| pos | vector Position of ParticleSource in LS (WS when no parent) |
| playOnCreation | bool Whether to play immediately after creation (Optional) |
| parent | Object Parent Object which will child the ParticleSource (Optional) |
| ori | vector Orientation of ParticleSource in LS (WS when no parent) (Pitch, Yaw, Roll in degrees) (Optional) |
| forceWorldRotation | bool Forces orientation to rotate relative to the world and not with the parent (Optional) |
| owner | Class The owning instance for this particle (Optional) |
ParticleSource Created particle instance when successful References CreateParticleEx().
| ParticleSource CreateParticleById | ( | int | id, |
| ParticleProperties | properties | ||
| ) |
QoL function for when only one particle is needed using script ParticleList, strongly recommend to read comments for CreateParticles as well.
| id | int ID of particle registered in ParticleList |
| properties | ParticleProperties Properties of the particles created |
ParticleSource The resulting particle References CreateParticles(), and ParticleList::GetParticleFullPath().
| ParticleSource CreateParticleByPath | ( | string | path, |
| notnull ParticleProperties | properties | ||
| ) |
Create a particle.
| path | string Path of particle effect |
| properties | ParticleProperties Properties of the particles created |
ParticleSource The resulting particle References CreateParticles(), and path.
Referenced by CreateParticleEx().
| ParticleSource CreateParticleEx | ( | int | id, |
| vector | pos, | ||
| int | flags = ParticlePropertiesFlags.NONE, |
||
| Object | parent = null, |
||
| vector | ori = vector.Zero, |
||
| Class | owner = null |
||
| ) |
Master create function.
| id | int Particle ID registered in ParticleList |
| pos | vector Position of ParticleSource in LS (WS when no parent) |
| flags | int See ParticlePropertiesFlags (Optional) |
| parent | Object Parent Object which will child the ParticleSource (Optional) |
| ori | vector Orientation of ParticleSource in LS (WS when no parent) (Pitch, Yaw, Roll in degrees) (Optional) |
| owner | Class The owning instance for this particle (Optional) |
ParticleSource Created particle instance when successful References CreateParticleByPath(), ErrorEx, and ParticleList::GetParticleFullPath().
Referenced by CreateParticle().
| proto native int CreateParticles | ( | array< ParticleSource > | particles, |
| string | path, | ||
| notnull ParticlePropertiesArray | properties, | ||
| int | count = 1 |
||
| ) |
Creates an amount of particles with the properties given.
| particles | array<ParticleSource> The resulting particles if an array is given |
| path | string Path of particle effect |
| properties | ParticleProperties Properties of the particles created |
| count | int Amount of particles to create with these properties |
int Amount of particles created in this frame, if the ParticleManager is still allocating while this is called and virtual particles are enabled, the overflow particles will be virtual instead and not given in the out array Referenced by CreateParticleById(), CreateParticleByPath(), CreateParticlesById(), and CreateParticlesByIdArr().
QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as well.
| id | int ID of particle registered in ParticleList |
| properties | ParticleProperties Properties of the particles created |
| count | int Amount of particles to create with these properties |
int Amount of particles created in this frame, if the ParticleManager is still allocating while this is called and virtual particles are enabled, the overflow particles will be virtual instead References CreateParticles(), and ParticleList::GetParticleFullPath().
| array< ParticleSource > CreateParticlesByIdArr | ( | int | id, |
| notnull ParticlePropertiesArray | properties, | ||
| int | count | ||
| ) |
QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as well.
| id | int ID of particle registered in ParticleList |
| properties | ParticleProperties Properties of the particles created |
| count | int Amount of particles to create with these properties |
array<ParticleSource> The resulting particles - Read particles param of CreateParticles References CreateParticles(), and ParticleList::GetParticleFullPath().
| proto native int GetAllocatedCount | ( | ) |
Gets the amount of particles currently allocated.
int Amount of particles currently allocated | proto int GetCountID | ( | ) |
Gets the ID for the ParticleManager.
int ID for the ParticleManager (different every restart, as it is the nth instance created since the start of the program) | override string GetDebugName | ( | ) |
Gets the debug name for the ParticleManager.
string "name:id" References GetDebugNameNative().
| proto string GetDebugNameNative | ( | ) |
Gets the debug name for the ParticleManager.
| dbgName | string "name:id" |
Referenced by IEntity::GetDebugName(), and GetDebugName().
| ParticleManagerEvents GetEvents | ( | ) |
Get the events.
ParticleManagerEvents If there is any events set, this will return them so that additional functionality can be bound to them References GetScriptEvents().
|
static |
Access to the static ParticleManager.
References ParticleManagerConstants::FLAGS, g_ParticleManager, GetGame(), ParticleManager(), ParticleManagerSettings(), and ParticleManagerConstants::POOL_SIZE.
| proto native ParticleSource GetParticle | ( | int | index | ) |
Manually get the particle at index.
| index | int Index of particle |
ParticleSource ParticleSource at given index Referenced by BoatScript::ClearWaterEffects().
| proto native int GetParticles | ( | out array< ParticleSource > | outArray, |
| int | startIndex, | ||
| int | count | ||
| ) |
Manually get a portion of the particles in the pool.
| particles | array<ParticleSource> The resulting particles |
| startIndex | int Starting index |
| count | int Amount of particles to get |
int Amount of particles in outArray Referenced by GetParticlesEx().
| array< ParticleSource > GetParticlesEx | ( | int | startIndex, |
| int | count | ||
| ) |
Manually get a portion of the particles in the pool.
| startIndex | int Starting index |
| count | int Amount of particles to get |
array<ParticleSource> The resulting particles References GetParticles().
| proto native int GetPlayingCount | ( | ) |
Gets the amount of playing particles.
int Amount of currently playing particles | proto native int GetPoolSize | ( | ) |
Gets the fixed maximum size of the pool.
int The fixed maximum size of the pool | private proto Managed GetScriptEvents | ( | ) |
Get the events.
Managed If there is any events set, this will return them Referenced by GetEvents().
|
static |
Gets the amount of ParticleManager that are currently existing.
int Amount of ParticleManager that are currently existing
|
static |
Gets the amount of ParticleManager that have been created since the start of the program.
int Amount of ParticleManager that have been created since the start of the program | proto native int GetVirtualCount | ( | ) |
Gets the amount of virtual particles.
int Amount of virtual particles currently waiting to be turned into real particles | proto native bool IsFinishedAllocating | ( | ) |
Checks if the ParticleManager has allocated all slots in the pool.
bool True when the number of allocated particles is the same as the pool size | void OnAllocation | ( | array< ParticleSource > | allocatedParticles | ) |
References GetEvents().
| void OnAllocationEnd | ( | ) |
References GetEvents().
| void ParticleManager | ( | ParticleManagerSettings | settings | ) |
Constructor (ctor)
| settings | ParticleManagerSettings Settings for the ParticleManager |
Referenced by Hit_MeatBones::BloodSplatGround(), PMTPlayback::CheckOnePlaying(), CheckTestEvents(), PMTF::CreatePMFixedBlocking(), ItemBase::DoMeasurement(), DynamicArea_Flare::DynamicArea_Flare(), BuildingSuper::EEInit(), Misc_TirePile_Burning_DE::EEInit(), EffBulletImpactBase::Event_OnStarted(), CGame::ExplosionEffects(), GetInstance(), EntityLightSource::HandleDancingShadows(), HandleVisualEffects(), WeaponParticlesBase::OnActivate(), OnActivatedByItem(), FlareSimulation::OnActivation(), Grenade_ChemGas::OnDamageDestroyed(), CGame::OnEvent(), FireworksLauncherClientEvent::OnExplode(), OnExplode(), FuelStation::OnExplosionEffects(), OnExplosionEffects(), CupidsBoltSimulation::OnFire(), SmokeSimulation::OnFire(), FireworksLauncherClientEvent::OnFired(), FireworksLauncher::OnFuseIgnitedClient(), CGame::OnRPC(), DayZPlayer::OnStepEvent(), Land_WarheadStorage_PowerStation::OnVariablesSynchronized(), Ammo_40mm_Smoke_ColorBase::OnVariablesSynchronized(), ParticleCookingStart(), FryingPan::ParticleCookingStart(), ItemBase::ParticleTest(), AmmoEffects::PlayAmmoParticle(), DestructionEffectBase::PlayParticle(), PlayParticle(), PlaySmokeParticle(), MiscEffects::PlayVegetationCollideParticles(), PlayVFX(), PMTF::PrintActiveStats(), ManBase::SetContaminatedEffectEx(), ItemBase::Spark(), ManBase::SpawnBreathVaporEffect(), ManBase::SpawnDrowningBubbles(), ActionDigInStash::SpawnParticleShovelRaise(), SpawnParticleShovelRaise(), HotSpringTrigger::SpawnVaporEffect(), VolcanicTrigger::SpawnVaporEffect(), EffectParticle::Start(), TestCleanup(), TestCreationSmallBlocking(), TestEvents(), PMTPlayback::TestOnePlaying(), TestOwnership(), Roadflare::UpdateActiveParticles(), GeyserTrigger::UpdateGeyserState(), BroomBase::UpdateParticle(), FlammableBase::UpdateParticle(), Edible_Base::UpdateVaporParticle(), CrashBase::Wreck_Mi8_Crashed(), CrashBase::Wreck_SantasSleigh(), CrashBase::Wreck_UH1Y(), and CGame::~CGame().
| class ParticleManagerConstants ParticleManagerSettings | ( | int | poolSize, |
| int | flags = ParticleManagerSettingsFlags.NONE |
||
| ) |
Settings given to ParticleManager on creation (in ctor)
Constructor (ctor)
| poolSize | int Size of pool (amount of created and reserved particles) |
| flags | int ParticleManagerSettingsFlags |
Referenced by PMTF::CreatePMFixedBlocking(), GetInstance(), and TestEvents().
| ParticleSource 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.
References particle_id, and PlayOnObject().
| ParticleSource Play | ( | int | particle_id, |
| vector | global_pos | ||
| ) |
Legacy function for backwards compatibility with 1.01 and below.
References particle_id, and PlayInWorld().
| ParticleSource PlayInWorld | ( | int | particle_id, |
| vector | global_pos | ||
| ) |
Creates a particle emitter on the given position and activates it.
| particle_id | int Particle ID registered in ParticleList |
| global_pos | Vector Position where the particel will be created |
ParticleSource Created particle instance References particle_id, and PlayInWorldEx().
Referenced by Play().
| ParticleSource PlayInWorldEx | ( | int | particle_id, |
| Object | parent_obj, | ||
| vector | global_pos, | ||
| vector | global_ori = "0 0 0", |
||
| bool | force_world_rotation = false |
||
| ) |
References CreateParticle(), and particle_id.
Referenced by PlayInWorld().
| ParticleSource 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.
| particle_id | int Particle ID registered in ParticleList |
| parent_obj | Object Instance on which this particle will be attached |
| local_pos | vector Attachment position local to the parent (Optional) |
| local_ori | vector Orientation local to the parent (Pitch, Yaw, Roll in degrees) (Optional) |
| force_world_rotation | bool Forces particle's orientation to rotate relative to the world and not with the object (Optional) |
ParticleSource Created particle instance References CreateParticle(), and particle_id.
Referenced by Play().
| ParticleSource PlayParticleById | ( | int | id, |
| array< vector > | position | ||
| ) |
QoL function for when only one particle is needed using script ParticleList, strongly recommend to read comments for PlayParticles as well.
| id | int ID of particle registered in ParticleList |
| positions | array<vector> Positions of particles |
ParticleSource The resulting particle References ParticleList::GetParticleFullPath(), and PlayParticles().
| proto native int PlayParticles | ( | out array< ParticleSource > | particles, |
| string | path, | ||
| notnull array< vector > | positions, | ||
| int | count = 1 |
||
| ) |
QoL function for when wanting to play a particle at a position right away.
| particles | array<ParticleSource> The resulting particles if an array is given |
| path | string Path of particle effect |
| positions | array<vector> Positions of particles |
| count | int Amount of particles to create at this position |
int Amount of particles created in this frame, if the ParticleManager is still allocating while this is called and virtual particles are enabled, the overflow particles will be virtual instead and not given in the out array Referenced by PlayParticleById(), and PlayParticlesById().
QoL function using script ParticleList, strongly recommend to read comments for PlayParticles as well.
| id | int ID of particle registered in ParticleList |
| positions | array<vector> Positions of particles |
| count | int Amount of particles to create at this position |
array<ParticleSource> The resulting particles - Read particles param of PlayParticles References ParticleList::GetParticleFullPath(), and PlayParticles().
| proto native void SetName | ( | string | name | ) |
Set a name for the ParticleManager to identify it more easily.
| name | string Name for ParticleManager |
| private proto void SetScriptEvents | ( | Managed | events | ) |
Set the events.
| events | Managed The events to set |
| void ~ParticleManager | ( | ) |
dtor
| void ~ParticleManagerSettings | ( | ) |
dtor
|
static |
| class ParticleManagerEvents g_ParticleManager |
Has a fixed pool of precreated and reserved particles.
Static ParticleManager
Referenced by CleanupInstance(), and GetInstance().
|
static |