DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ParticleManager.c

См. исходные тексты.

Структуры данных

class  ParticleManagerConstants
 Class simply to have easily modded constants. Подробнее...
 
class  ParticleManagerEvents
 Invokers for ParticleManager events. Подробнее...
 

Перечисления

enum  ParticleManagerSettingsFlags {
  NONE , FIXED_INDEX , BLOCKING , DISABLE_VIRTUAL ,
  REUSE_OWNED
}
 Flags for ParticleManagerSettings. Подробнее...
 

Функции

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< ParticleSourceCreateParticlesByIdArr (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< ParticleSourcePlayParticlesById (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< ParticleSourceGetParticlesEx (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

proto void SetScriptEvents (Managed events)
 Set the events.
 
proto Managed GetScriptEvents ()
 Get the events.
 
ParticleManagerEvents GetEvents ()
 Get the events.
 
Events

Events called from C++

void OnAllocation (array< ParticleSource > allocatedParticles)
 
void OnAllocationEnd ()
 

Переменные

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
 

Перечисления

◆ ParticleManagerSettingsFlags

Flags for ParticleManagerSettings.

Элементы перечислений
NONE 
FIXED_INDEX 

Particles will be locked to the index and not reused.

BLOCKING 

Allocation blocks the game until it is done.

DISABLE_VIRTUAL 

Disable the creation of virtual particles when the pool is still allocating.

REUSE_OWNED 

Reuse stopped particles even if they are owned by something.

3{
4 NONE,
13};
@ REUSE_OWNED
Reuse stopped particles even if they are owned by something.
Definition ParticleManager.c:12
@ DISABLE_VIRTUAL
Disable the creation of virtual particles when the pool is still allocating.
Definition ParticleManager.c:10
@ BLOCKING
Allocation blocks the game until it is done.
Definition ParticleManager.c:8
@ FIXED_INDEX
Particles will be locked to the index and not reused.
Definition ParticleManager.c:6
@ NONE
Definition ParticleManager.c:4

Функции

◆ CleanupInstance()

static void CleanupInstance ( )
static

To clean it up properly before game closes.

75 {
77 delete g_ParticleManager;
78 }
class ParticleManagerEvents g_ParticleManager
Has a fixed pool of precreated and reserved particles.

Перекрестные ссылки g_ParticleManager.

◆ Create() [1/2]

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.

175 {
177 }
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.
Definition ParticleManager.c:161
int particle_id
Definition SmokeSimulation.c:28
Definition EntityAI.c:95

Перекрестные ссылки CreateOnObject() и particle_id.

◆ Create() [2/2]

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

Legacy function for backwards compatibility with 1.01 and below.

196 {
198 }
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.
Definition ParticleManager.c:187

Перекрестные ссылки CreateInWorld() и particle_id.

◆ CreateInWorld()

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_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
Возвращает
ParticleSource Created particle instance
188 {
190 }
void CreateParticle()
Definition BleedingSource.c:83

Перекрестные ссылки CreateParticle() и particle_id.

Используется в Create().

◆ CreateOnObject()

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_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)
Возвращает
ParticleSource Created particle instance

Перекрестные ссылки CreateParticle() и particle_id.

Используется в Create().

◆ CreateParticle()

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

Create function.

Аргументы
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)
Возвращает
ParticleSource Created particle instance when successful
112 {
113 int flags = ParticlePropertiesFlags.NONE;
114
115 if (playOnCreation)
116 {
117 flags = flags | ParticlePropertiesFlags.PLAY_ON_CREATION;
118 }
119
121 {
122 flags = flags | ParticlePropertiesFlags.FORCE_WORLD_ROT;
123 }
124
125 return CreateParticleEx(id, pos, flags, parent, ori, owner);
126 }
ParticleSource CreateParticleEx(int id, vector pos, int flags=ParticlePropertiesFlags.NONE, Object parent=null, vector ori=vector.Zero, Class owner=null)
Master create function.
Definition ParticleManager.c:138

Перекрестные ссылки CreateParticleEx().

◆ CreateParticleById()

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.

Аргументы
idint ID of particle registered in ParticleList
propertiesParticleProperties Properties of the particles created
Возвращает
ParticleSource The resulting particle
325 {
328
329 if (tempArr.Count() > 0)
330 return tempArr[0];
331 else
332 return null;
333 }
proto native int CreateParticles(array< ParticleSource > particles, string path, notnull ParticlePropertiesArray properties, int count=1)
Creates an amount of particles with the properties given.
Definition ParticleList.c:12
static string GetParticleFullPath(int particle_id)
Returns particle's full path (with .ptc suffix) based on its ID.
Definition ParticleList.c:468

Перекрестные ссылки CreateParticles() и ParticleList::GetParticleFullPath().

◆ CreateParticleByPath()

ParticleSource CreateParticleByPath ( string path,
notnull ParticleProperties properties )

Create a particle.

Аргументы
pathstring Path of particle effect
propertiesParticleProperties Properties of the particles created
Возвращает
ParticleSource The resulting particle
282 {
285
286 if (tempArr.Count() > 0)
287 return tempArr[0];
288 else
289 return null;
290 }
string path
Definition OptionSelectorMultistate.c:142

Перекрестные ссылки CreateParticles() и path.

Используется в CreateParticleEx().

◆ CreateParticleEx()

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

Master create function.

Аргументы
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)
Возвращает
ParticleSource Created particle instance when successful
139 {
141 if (particlePath == "") // There is already an error inside of ParticleList signaling this
142 {
143 ErrorEx(string.Format("Could not create ParticleSource as particle id %1 is invalid.", id));
144 return null;
145 }
146
147 ParticleProperties props = new ParticleProperties(pos, flags, parent, ori, owner);
149 return p;
150 }
ParticleSource CreateParticleByPath(string path, notnull ParticleProperties properties)
Create a particle.
Definition ParticleManager.c:281
Entity which has the particle instance as an ObjectComponent.
Definition ParticleSource.c:124
enum ShapeType ErrorEx

Перекрестные ссылки CreateParticleByPath(), ErrorEx и ParticleList::GetParticleFullPath().

Используется в CreateParticle().

◆ CreateParticles()

proto native int CreateParticles ( array< ParticleSource > particles,
string path,
notnull ParticlePropertiesArray properties,
int count = 1 )

Creates an amount of particles with the properties given.

Аргументы
particlesarray<ParticleSource> The resulting particles if an array is given
pathstring Path of particle effect
propertiesParticleProperties Properties of the particles created
countint 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

Используется в CreateParticleById(), CreateParticleByPath(), CreateParticlesById() и CreateParticlesByIdArr().

◆ CreateParticlesById()

int CreateParticlesById ( int id,
notnull ParticlePropertiesArray properties,
int count )

QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as well.

Аргументы
idint ID of particle registered in ParticleList
propertiesParticleProperties Properties of the particles created
countint 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

Перекрестные ссылки CreateParticles() и ParticleList::GetParticleFullPath().

◆ CreateParticlesByIdArr()

array< ParticleSource > CreateParticlesByIdArr ( int id,
notnull ParticlePropertiesArray properties,
int count )

QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as well.

Аргументы
idint ID of particle registered in ParticleList
propertiesParticleProperties Properties of the particles created
countint Amount of particles to create with these properties
Возвращает
array<ParticleSource> The resulting particles - Read particles param of CreateParticles

Перекрестные ссылки CreateParticles() и ParticleList::GetParticleFullPath().

◆ GetAllocatedCount()

proto native int GetAllocatedCount ( )

Gets the amount of particles currently allocated.

Возвращает
int Amount of particles currently allocated

◆ GetCountID()

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)

◆ GetDebugName()

override string GetDebugName ( )

Gets the debug name for the ParticleManager.

Возвращает
string "name:id"
437 {
438 return GetDebugNameNative();
439 }
proto string GetDebugNameNative()
Gets the debug name for the ParticleManager.

Перекрестные ссылки GetDebugNameNative().

◆ GetDebugNameNative()

proto string GetDebugNameNative ( )

Gets the debug name for the ParticleManager.

Аргументы
dbgNamestring "name:id"

Используется в IEntity::GetDebugName() и GetDebugName().

◆ GetEvents()

ParticleManagerEvents GetEvents ( )
private

Get the events.

Возвращает
ParticleManagerEvents If there is any events set, this will return them so that additional functionality can be bound to them
524 {
526 }
proto Managed GetScriptEvents()
Get the events.
Invokers for ParticleManager events.
Definition ParticleManager.c:47

Перекрестные ссылки GetScriptEvents().

◆ GetInstance()

static ParticleManager GetInstance ( )
static

Access to the static ParticleManager.

60 {
61 if (!g_ParticleManager && !GetGame().IsDedicatedServer())
62 {
67 g_ParticleManager.SetName("GlobalParticleManager");
68 }
69
70 return g_ParticleManager;
71 }
class ParticleManagerConstants ParticleManagerSettings(int poolSize, int flags=ParticleManagerSettingsFlags.NONE)
Settings given to ParticleManager on creation (in ctor)
Definition ParticleManager.c:35
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition ParticleManager.c:84
Class simply to have easily modded constants.
Definition ParticleManager.c:17
static const int POOL_SIZE
Definition ParticleManager.c:22
static const int FLAGS
Definition ParticleManager.c:23
proto native CGame GetGame()

Перекрестные ссылки ParticleManagerConstants::FLAGS, g_ParticleManager, GetGame(), ParticleManager(), ParticleManagerSettings() и ParticleManagerConstants::POOL_SIZE.

◆ GetParticle()

proto native ParticleSource GetParticle ( int index)

Manually get the particle at index.

Аргументы
indexint Index of particle
Возвращает
ParticleSource ParticleSource at given index

Используется в BoatScript::ClearWaterEffects().

◆ GetParticles()

proto native int GetParticles ( out array< ParticleSource > outArray,
int startIndex,
int count )

Manually get a portion of the particles in the pool.

Аргументы
particlesarray<ParticleSource> The resulting particles
startIndexint Starting index
countint Amount of particles to get
Возвращает
int Amount of particles in outArray

Используется в GetParticlesEx().

◆ GetParticlesEx()

array< ParticleSource > GetParticlesEx ( int startIndex,
int count )

Manually get a portion of the particles in the pool.

Аргументы
startIndexint Starting index
countint Amount of particles to get
Возвращает
array<ParticleSource> The resulting particles
399 {
402 return outArr;
403 }
proto native int GetParticles(out array< ParticleSource > outArray, int startIndex, int count)
Manually get a portion of the particles in the pool.

Перекрестные ссылки GetParticles().

◆ GetPlayingCount()

proto native int GetPlayingCount ( )

Gets the amount of playing particles.

Возвращает
int Amount of currently playing particles

◆ GetPoolSize()

proto native int GetPoolSize ( )

Gets the fixed maximum size of the pool.

Возвращает
int The fixed maximum size of the pool

◆ GetScriptEvents()

proto Managed GetScriptEvents ( )
private

Get the events.

Возвращает
Managed If there is any events set, this will return them

Используется в GetEvents().

◆ GetStaticActiveCount()

proto static native int GetStaticActiveCount ( )
static

Gets the amount of ParticleManager that are currently existing.

Возвращает
int Amount of ParticleManager that are currently existing

◆ GetStaticCount()

proto static native int GetStaticCount ( )
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

◆ GetVirtualCount()

proto native int GetVirtualCount ( )

Gets the amount of virtual particles.

Возвращает
int Amount of virtual particles currently waiting to be turned into real particles

◆ IsFinishedAllocating()

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

◆ OnAllocation()

void OnAllocation ( array< ParticleSource > allocatedParticles)
private
538 {
540 }
ParticleManagerEvents GetEvents()
Get the events.
Definition ParticleManager.c:523
ref ScriptInvoker Event_OnAllocation
Definition ParticleManager.c:48

Перекрестные ссылки GetEvents().

◆ OnAllocationEnd()

void OnAllocationEnd ( )
private
543 {
544 GetEvents().Event_OnAllocationEnd.Invoke(this);
545 }
ref ScriptInvoker Event_OnAllocationEnd
Definition ParticleManager.c:49

Перекрестные ссылки GetEvents().

◆ ParticleManager()

void ParticleManager ( ParticleManagerSettings settings)

Constructor (ctor)

Аргументы
settingsParticleManagerSettings Settings for the ParticleManager
85 {
86 }

Используется в Hit_MeatBones::BloodSplatGround(), PMTPlayback::CheckOnePlaying(), CheckTestEvents(), PMTF::CreatePMFixedBlocking(), ItemBase::DoMeasurement(), DynamicArea_Flare::DynamicArea_Flare(), BuildingSuper::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(), 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() и CGame::~CGame().

◆ ParticleManagerSettings()

class ParticleManagerConstants ParticleManagerSettings ( int poolSize,
int flags = ParticleManagerSettingsFlags.NONE )

Settings given to ParticleManager on creation (in ctor)

Constructor (ctor)

Аргументы
poolSizeint Size of pool (amount of created and reserved particles)
flagsint ParticleManagerSettingsFlags
36 {
37 }

Используется в PMTF::CreatePMFixedBlocking(), GetInstance() и TestEvents().

◆ Play() [1/2]

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.

227 {
229 }
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.
Definition ParticleManager.c:218

Перекрестные ссылки particle_id и PlayOnObject().

◆ Play() [2/2]

ParticleSource Play ( int particle_id,
vector global_pos )

Legacy function for backwards compatibility with 1.01 and below.

252 {
254 }
ParticleSource PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
Definition ParticleManager.c:237

Перекрестные ссылки particle_id и PlayInWorld().

◆ PlayInWorld()

ParticleSource PlayInWorld ( int particle_id,
vector global_pos )

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

Аргументы
particle_idint Particle ID registered in ParticleList
global_posVector Position where the particel will be created
Возвращает
ParticleSource Created particle instance
238 {
240 }
ParticleSource PlayInWorldEx(int particle_id, Object parent_obj, vector global_pos, vector global_ori="0 0 0", bool force_world_rotation=false)
Definition ParticleManager.c:242

Перекрестные ссылки particle_id и PlayInWorldEx().

Используется в Play().

◆ PlayInWorldEx()

ParticleSource PlayInWorldEx ( int particle_id,
Object parent_obj,
vector global_pos,
vector global_ori = "0 0 0",
bool force_world_rotation = false )

Перекрестные ссылки CreateParticle() и particle_id.

Используется в PlayInWorld().

◆ PlayOnObject()

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_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)
Возвращает
ParticleSource Created particle instance

Перекрестные ссылки CreateParticle() и particle_id.

Используется в Play().

◆ PlayParticleById()

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.

Аргументы
idint ID of particle registered in ParticleList
positionsarray<vector> Positions of particles
Возвращает
ParticleSource The resulting particle
366 {
369
370 if (tempArr.Count() > 0)
371 return tempArr[0];
372 else
373 return null;
374 }
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.

Перекрестные ссылки ParticleList::GetParticleFullPath() и PlayParticles().

◆ 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.

Аргументы
particlesarray<ParticleSource> The resulting particles if an array is given
pathstring Path of particle effect
positionsarray<vector> Positions of particles
countint 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

Используется в PlayParticleById() и PlayParticlesById().

◆ PlayParticlesById()

array< ParticleSource > PlayParticlesById ( int id,
array< vector > positions,
int count )

QoL function using script ParticleList, strongly recommend to read comments for PlayParticles as well.

Аргументы
idint ID of particle registered in ParticleList
positionsarray<vector> Positions of particles
countint Amount of particles to create at this position
Возвращает
array<ParticleSource> The resulting particles - Read particles param of PlayParticles

Перекрестные ссылки ParticleList::GetParticleFullPath() и PlayParticles().

◆ SetName()

proto native void SetName ( string name)

Set a name for the ParticleManager to identify it more easily.

Аргументы
namestring Name for ParticleManager

◆ SetScriptEvents()

proto void SetScriptEvents ( Managed events)
private

Set the events.

Аргументы
eventsManaged The events to set

◆ ~ParticleManager()

dtor

90 {
91 }

◆ ~ParticleManagerSettings()

dtor

41 {
42 }

Переменные

◆ FLAGS

◆ g_ParticleManager

class ParticleManagerEvents g_ParticleManager

Has a fixed pool of precreated and reserved particles.

Static ParticleManager

Используется в CleanupInstance() и GetInstance().

◆ POOL_SIZE

const int POOL_SIZE = 10000
static