Game Development Reference
In-Depth Information
TABLEĀ 7.2 (Continued)
Basic Particle Script from Jopsy Pendragon/The Particle Lab
Line#
LSL Code or Comments
42
touch_start(integer n) {state particles_off;}
43
}
44
45
state particles_off {
46
state_entry() {llParticleSystem([]);}
47
48
touch_start(integer n) {llResetScript();}
49
}
50
d.
Acceleration on a vector xyz. Line 24: Accelerate in a direction; adding a minus value for z will
create gravitational effect on the particle.
e.
Wind response . Line 32: Allows the particle direction to be affected by inworld winds. This is
lagged on and off by removing the // at the front of the line.
f.
Follow the emitter . Line 34: Flag on/off to have particles follow a moving emitter.
g.
Target a position . Line 35: Enables the particles to ind a target, which is deined in Line 25.
h.
Target linear . Line 36: Sends particles in a straight line toward the target, ignoring wind and the like.
Once you have an understanding of these modiiers, you can affect the look of your particle systems easily.
If you have an interest in targeting prims in various ways or simply want a ine collection of basic scripts
for ire, snow, and so on, then you should head over to the Particle Lab in Second Life. Founded by Jopsy
Pendragon, this entertaining and educational region has much more information about particles available at
the interactive displays (http://maps.secondlife.com/secondlife/Teal/191/56/21).
7.6.4 B asiC r ules for u sing p arTiCles and i nsTanTiaTion
In the virtual worlds of Second Life and OpenSim, particles are rendered by your client viewer. The
Firestorm/Preferences/Graphics menu has a slider setting that allows you to see up to 8192 particles in a
scene. That may sound like a lot, but get a snowstorm particle system going and add in a few avatars shoot-
ing off ireworks and soon you will see a diminished effect. Particles do not cause lag in a virtual world, but
their scripting can. Care should be taken to make the scripts as eficient as possible, and if you do not code
yourself, you should make sure your code writer has knowledge of how much server lag each script the writer
makes adds to your region. There is a limit on visibility for particles, dependent draw distance, and size of the
emitter. If you need to see a particle from across the sim, then your draw distance will have to be turned up,
and the emitting prim may need to be scaled up. By varying the size of your emitters across the landscape,
you can keep the particle load on the observer's viewer at a manageable level. When you are making particle
systems for a Unity-based game, beware of too many particle instantiations happening in a short time. This
additional amount of work for the game engine may slow the game play, and it is better to recycle a group of
objects with particle systems in them than to constantly create new ones during game play.
 
Search WWH ::




Custom Search