Dynamite, Intrusion detection  
   
Dynamite Detects intrusion, responds with explosive sound and matching fiery smoke. Particle system
default {
   state_entry()
See: Welcome watcher
Image floater, random
{ llVolumeDetect(TRUE); }
 
collision_start(integer num_detected)
 
{ llSay(0, llDetectedName(0) + " is blowing up");
 
list ParParams = [
PSYS_PART_FLAGS,( //Mask on:1. Off:0
( 1 * PSYS_PART_EMISSIVE_MASK ) |
( 1 * PSYS_PART_BOUNCE_MASK ) |
( 1 * PSYS_PART_INTERP_COLOR_MASK ) |
( 1 * PSYS_PART_INTERP_SCALE_MASK ) |
( 0 * PSYS_PART_WIND_MASK ) |
( 0 * PSYS_PART_FOLLOW_SRC_MASK ) |
( 0 * PSYS_PART_FOLLOW_VELOCITY_MASK ) |
( 0 * PSYS_PART_TARGET_POS_MASK ) ),

PSYS_PART_START_COLOR, <.8,.3, 0.>,
PSYS_PART_END_COLOR, <1.,1.,1.>,
PSYS_PART_START_ALPHA, 0.9,
PSYS_PART_END_ALPHA, 0.2,
PSYS_PART_START_SCALE, < 0.4, 0.4, 0.0 >,
PSYS_PART_END_SCALE, < 0.9, 0.9, 0.0 >,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_SRC_BURST_PART_COUNT, 200, //Number of particles per burst, 1 to 4096
PSYS_SRC_BURST_RATE, 1., //Seconds between particle bursts, 0.0 to 60
PSYS_PART_MAX_AGE, 10., // How many seconds particle lives, 0.1 to 60
PSYS_SRC_MAX_AGE , 3., //Number of seconds this particle call continues
PSYS_SRC_ACCEL, < 0.00, 0.00, 0.01 > ,
PSYS_SRC_BURST_RADIUS, .6,
PSYS_SRC_BURST_SPEED_MIN, .02,
PSYS_SRC_BURST_SPEED_MAX, .06 ];
llParticleSystem(ParParams );

string soundname = "Exploding" ;
vector pos = llGetPos() ;
llTriggerSoundLimited(soundname, 1.0, pos + <9,9,9>, pos - <9,9,9>);
 

This is conceptually a single line setting parameters to control the particle system.  Note that the line is forming a list in [brackets].   

Note about the timing numbers you enter:  Your wish is not always the system's command. If you don't get the timing you asked for, the problem may not be in your script.  It may be in system lag.

For more action, use more particles, faster speeds and a larger burst radius. 

  }
}
Close collision block
Close default
The Thinkerer 05/09/2008
Copyright (c) D. F. Dansereau & S. H. Evans

Site Map

Where start?

LODScr
Famous fables