Particle Generator

From K.R. Engineering Support Wiki
Jump to: navigation, search

Particle Generator

Introduction

The particle generator is designed for all levels of scripters to learn, experiment or just play with particles.

Features

  • Easy to use chat interface for manipulating particles.
  • Instant results. All commands produce an immediate change on the particles being generated.
  • Outputs complete function call to llParticleSystem based on your desired configuration. Can be dropped into any script.
  • Only responds to owner, no-one else may interrupt your particle experiments.

Permissions

The particle generator is sold with no modfy/copy/no transfer permissions.

How To Use

To use the particle generator, first touch it to activate the control menu. From this menu you can toggle any of the three particle engines on or off. They can run all at the same time or one at a time, or any combination of the three. If you are running more than one particle engine at a time you can use the control menu to select which one you are currently operating, leaving the others running unhindered.

Particles should immediately begin to be generated above the base as soon as you switch one or more of the engines on. At this point, you may type any of the commands listed below into your chat bar to alter the particles.

IMPORTANT NOTE: Some options will have no apparent effect on the particles depending on what 'pattern' of particles you are currently using. The patterns are cone, angle, explode and drop. If the command you are using produces no apparent effect, it's probably not supported by that pattern.

Inserting Into Script

Due to limitations of the scripting language in Second Life, the particle generator is unable to output the llParticleSystem call without prefixing the generator's name. Therefore, when you copy your completed particle function into a script, you must remove the prefix '#: ' from in front of each line.

Basic 'always on' particle script:

default {

   state_entry() {
       //Paste output from particle generator here.
   }

}

Commands

Generator Commands

Command: quiet

Description: The quiet command switches the particle generator in and out of quiet mode. In quiet mode, the particle generator will only output information regarding the particles to it's owner. Out of quite mode, information regarding the particles will be heard by everyone within normal chat radius of the generator (20m). The generator defaults to quiet mode.

Command: done

Description: Use this command when you have the particles the way you want them and the particle generator will output a complete syntactically valid call to llParticleSystem that can be dropped into any script.

Command: respawn

Description: Restart the particle generator, all settings will be retained. Useful if your particle source has reached end of life (discussed later).

Command: reset

Description: Resets the particle generator back to default settings.

Particle Commands

Command: angle

Description: Fire particles in an angle. This will result in particles being emitted in a flat disc. You can adjust the 'cut' of this disc with start angle and end angle below.

Command: cone

Description: Fire particles in a cone. This will result in the particles being emitted in a cone shape. You can adjust the spread of the cone using start angle and end angle below. Note: A cone with a wide enough dispersal will result in a sphere.

Command: explode

Description: Explode particles away from the source. This will result in particles being shot at random angles.

Command: drop

Description: Particles will be dropped straight down in a single line from the emitter, regardless of other forces.

Command: start scale X Y Z

Description: Specify the size of the particles.

Command: end scale X Y Z

Description: ONLY USED IF INTERPOLATE SCALE IS ON: Specify the size of the particles just before they disappear. Particles will trend from start scale to end scale during their life.

Command: start color R G B

Description: Specify the color of the particles. Valid values for R, G and B are 0 to 255.

Command: end color R G B

Description: ONLY USED IF INTERPOLATE COLOR IS ON: Specify the color of the particles just before they disappear. Particles will fade from start color to end color during their life. Valid values for R, G and B are 0 to 255.

Command: start alpha PERCENT

Description: Specify the alpha (transparency) of the particles. 100 is fully opaque (no transparency), 0 is invisible.

Command: end alpha PERCENT

Description: ONLY USED IF INTERPOLATE COLOR IS ON: Specify the alpha (transparency) of the particles just before they disappear. Particles will fade from start alpha to end alpha during their life. 100 is fully opaque (no transparency), 0 is invisible.

Command: min speed RATE

Description: Specify the minimum speed of the particles as they are emitted. Particles will be emitted at a random speed between min speed and max speed, set both to the same value to achieve a steady flow. Valid range is 0.0 to anything. NOTE: Anything over 5.0 is considered 'fast.' Be cautious when adjusting velocities until you are familiar with it.

Command: min speed RATE

Description: Specify the maximum speed of the particles as they are emitted. Particles will be emitted at a random speed between min speed and max speed, set both to the same value to achieve a steady flow. Valid range is 0.0 to anything. NOTE: Anything over 5.0 is considered 'fast.' Be cautious when adjusting velocities until you are familiar with it.

Command: rate RATE

Description: Specify how often particles are emitted in seconds. Valid range is 0.0 to anything, however anything below 0.1 should almost never be used. Too many particles, especially emitted at a high rate with long life, can cause performance problems for many users.

Command: count COUNT

Description: Specify how many particles get emitted with each 'burst.' How often bursts occur is specified with the rate command above. Valid values are 0 to anything, although obviously 0 will result in no particles ever being emitted. Be cautious when specified counts for particles. Always experiment to find the lowest count and highest rate (slowest bursting) you need to produce an acceptable result. This leaves valuable resources available for future projects and other people who may be nearby.

Command: radius RADIUS

Description: Specify the radius at which particles are bursted around the source (center of the prim containing the particle script). RADIUS is specified in meters. In a nutshell, this is how far away from the source the particles will first appear.

Command: particle age AGE

Description: Specify how many seconds each particle should live before disappearing. AGE is specified in seconds. Try not to let particles live any longer than necessary to achieve the effect you want.

Command: source age AGE

Description: Specify how many seconds the source should last. AGE is specified in seconds. After AGE seconds have passed, no more particles will be emitted, EVAR.

Command: accel X Y Z

Description: Specify the acceleration to be applied to each particle after it is emitted. Acceleration is ALWAYS GLOBAL. That means X is always east and west, Y is always north and south, and Z is always up and down, regardless of the rotation of the prim itself. Valid ranges are 0.0 to anything.

Command: omega X Y Z

Description: Specify how fast the source should 'spin' as it emits particles, along all three axis. Valid ranges are 0.0 to anything. IMPORTANT NOTE: This only changes the source of the particles themselves, the prim that the particles are being emitted from IS NOT CHANGED BY THIS.

Command: start degrees DEGREES

Description: Also known as 'start angle.' Specified in degrees. This will have different effects depending on your chosen particle pattern of angle, cone, drop or explode. Experiment and learn!

Command: end degrees DEGREES

Description: Also known as 'end angle.' Specified in degrees. This will have different effects depending on your chosen particle pattern of angle, cone, drop or explode. Experiment and learn!

Command: start radians RADIANS

Description: Also known as 'start angle.' Same as start degrees, except using radians. This will have different effects depending on your chosen particle pattern of angle, cone, drop or explode. Experiment and learn!

Command: end radians RADIANS

Description: Also known as 'end angle.' Same as end degrees, except using radians. This will have different effects depending on your chosen particle pattern of angle, cone, drop or explode. Experiment and learn!

Command: texture KEY

Description: Specify the key (also knwon as UUID) of the texture to be applied to the particles. An easy way to get the key of a texture is to right-click on a texture in your inventory and choose 'Copy Asset UUID', then Edit->Paste that into your chat box.

Command: glow ON | OFF

Description: Turn the 'glow' flag on or off. Also known as the emissive flag. This causes the particles to become light objects and emit light, rather than reflect it. One result of this is that the particles will become brighter and will take on the absolute color that you provide, rather than being influenced by other light sources or day and night time conditions.

Command: wind ON | OFF

Description: Turn the wind flag on or off. When on, particles will float along with the wind currents in the area. Great for smoke effects.

Command: target ON | OFF

Description: Turn the target flag on or off. When on, particles will attempt to fly towards the target specified after being emitted (more about specifying the target below).

Command: target TARGET

Description: ONLY USED WHEN THE TARGET FLAG IS ON: Specify the target of the particles. This must be the EXACT name of an object within 20 meters of the emitter.

Command: target key TARGET

Description: ONLY USED WHEN THE TARGET FLAG IS ON: Using this command, you can instead provide the 'key' of the object you wish the particles to target. The key is also known as the asset ID or UUID.

Command: interpolate color ON | OFF

Description: Turn on or off interpolating color. When on, particles will fade both color and alpha (transparency) from one value to another during the course of each particle's life. The start and end values for both color and alpha are discussed above.

Command: interpolate scale ON | OFF

Description: Turn on or off interpolating scale. When on, particles will trend from one size to another over the course of each particle's life. The start and end values for this are discussed above.

Command: follow source ON | OFF

Description: Turn on or off the follow source flag. When on, particles will move in perfect coordination with their source while still obeying their emitting speeds, acceleration, etc.

Command: follow velocity ON | OFF

Description: Turn on or off the follow velocity flag. When on, particles will attempt to reorient themselves so that their Y axis is oriented towards their direction of travel.

ChangeLog

  • Version 1.1:
    • Fixed bug that caused invalid syntax with no particle flags.
  • Version 1.2:
    • Fixed bug that caused the texture parameter to output wrong.
  • Version 2.0:
    • Run three different particle systems simultaneously!
    • Touch menu control.
    • All new design!
  • Version 2.1:
    • Bug fix with target keys in output script.

External Links

Template:Other