A particle function is used to simulate smoke, fire, rain, fireworks, jet exhaust, explosion, blood, dazzle, ...etc. A particle in Second Life is created by the function llParticleSystem.
A particle is simply floating images (textures), that always face the screen. LSL creates particles by the function llParticleSystem(), which takes a bunch of parameters. These parameters controls how many of of the particle images to float, the rate they are created, their duration, their color, in what direction they move, their speed, in what orientation, what size. Remember, particles are simply a bunch of floating images and nothing more. By changing the image, their number, direction of floating, size, color, orientation, over time, they appear as smokes, lasers, rain, cloud, blood, explosion, etc.
The image used for particle is sometimes called a sprite.
llParticleSystem() takes single list as argument. Thi list has the form [p1,v1, p2,v2, p3,v3...]. The p are the parameter names and v their values. Not all parameters must be supplied, but they must be supplied in p and v pairs.
Here's a simple example:
// a script that simulates a single firework burst, every 5 seconds. default { state_entry() { llParticleSystem([ PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE, PSYS_SRC_MAX_AGE, 0., PSYS_PART_MAX_AGE, 9., PSYS_SRC_BURST_RATE, 5., PSYS_SRC_BURST_PART_COUNT, 500, PSYS_SRC_BURST_RADIUS, .1, PSYS_SRC_BURST_SPEED_MIN, 3., PSYS_SRC_BURST_SPEED_MAX, 3., PSYS_SRC_ACCEL, <0.0,0.0,-0.8>, PSYS_PART_START_COLOR, <246,38,9>/255., PSYS_PART_END_COLOR, <246,38,9>/255, PSYS_PART_START_ALPHA, 0.9, PSYS_PART_END_ALPHA, 0.0, PSYS_PART_START_SCALE, <.3,.3,0>, PSYS_PART_END_SCALE, <.1,.1,0>, PSYS_PART_FLAGS , 0 | PSYS_PART_EMISSIVE_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK | PSYS_PART_WIND_MASK ]); } }
Here's a brief explanation: There are 2 types of parameters. Those having prefix “PSYS_SRC_” are about the particle emitter. Those having prefix “PSYS_PART_” are about the particle sprites themselves.
The following are specific examples. It really takes playing with them inworld to understand them.
Experiment with this generic template: Generic Particle Template.
If you like to experiment with particles, try Xah Particle Maker. If lets you set particle parameters by touch-panels or typed commands, and see the particles update in real time. This saves you a lot edit-compile loop time.
Reference: