Skip to content

Particle functions

advance_screen_particles

source

function advance_screen_particles(particle_emitter?: ParticleEmitterInfo)
particle_emitter?: ParticleEmitterInfooptional

Advances the state of the screen particle emitter (simulates the next positions, ... of all the particles in the emitter). Only used with screen particle emitters. See the particles.lua example script for more details.

extinguish_particles

source

function extinguish_particles(particle_emitter?: ParticleEmitterInfo)
particle_emitter?: ParticleEmitterInfooptional

Extinguish a particle emitter (use the return value of generate_world_particles or generate_screen_particles as the parameter in this function)

generate_screen_particles

source

function generate_screen_particles(particle_emitter_id: PARTICLEEMITTER, x: number, y: number): ParticleEmitterInfo?
particle_emitter_id: PARTICLEEMITTER
x: number
y: number

Returns ParticleEmitterInfo? (may be nil)

Generate particles of the specified type at a certain screen coordinate (use e.g. local emitter = generate_screen_particles(PARTICLEEMITTER.CHARSELECTOR_TORCHFLAME_FLAMES, 0.0, 0.0)). See the particles.lua example script for more details.

generate_world_particles

source

function generate_world_particles(particle_emitter_id: PARTICLEEMITTER, uid: integer): ParticleEmitterInfo?
particle_emitter_id: PARTICLEEMITTER
uid: integer

Returns ParticleEmitterInfo? (may be nil)

Generate particles of the specified type around the specified entity uid (use e.g. local emitter = generate_world_particles(PARTICLEEMITTER.PETTING_PET, players[1].uid)). You can then decouple the emitter from the entity with emitter.entity_uid = -1 and freely move it around. See the particles.lua example script for more details.

get_particle_type

source

function get_particle_type(id: PARTICLEEMITTER): ParticleDB?
id: PARTICLEEMITTER

Returns ParticleDB? (may be nil)

Get the ParticleDB details of the specified ID

render_screen_particles

source

function render_screen_particles(particle_emitter?: ParticleEmitterInfo)
particle_emitter?: ParticleEmitterInfooptional

Renders the particles to the screen. Only used with screen particle emitters. See the particles.lua example script for more details.