Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Particles Make_it_Rain  

Make_it_Rain

First the actual rain script:

Category: Particles
By : Oddball Otoole
Created: 2010-11-18 Edited: 2010-11-18
Worlds: Second Life

the Zip file

Download all files for Make_it_Rain
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Make_it_Rain_1.lsl
Get file # 2. Make_it_Rain_2.lsl
1 //// "Rain" PARTICLE TEMPLATE v1 - by Jopsy Pendragon - 4/8/2008
2 //// You are free to use this script as you please, so long as you include this line:
3 //** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//
4
5 // SETUP: Drop one optional particle texture and this script into a prim.
6 // Particles should start automatically. (Reset) the script if you insert a
7 // particle texture later on. Add one or more CONTROLLER TEMPLATES to any
8 // prims in the linked object to control when particles turn ON and OFF.
9
10 // Customize the particle_parameter values below to create your unique
11 // particle effect and click SAVE. Values are explained along with their
12 // min/max and default values further down in this script.
13
14
15 string CONTROLLER_ID = "A"; // See comments at end regarding CONTROLLERS.
16 integer AUTO_START = TRUE; // Optionally FALSE only if using CONTROLLERS.
17
18 list particle_parameters=[]; // stores your custom particle effect, defined below.
19 list target_parameters=[]; // remembers targets found using TARGET TEMPLATE scripts.
20
21 default {
22 state_entry() {
23 particle_parameters = [ // start of particle settings
24 // Texture Parameters:
27 PSYS_PART_START_COLOR, <.3,.4,.5>, PSYS_PART_END_COLOR, <.5,.6,.7>,
29
30 // Production Parameters:
35
36 // Placement Parameters:
37 PSYS_SRC_PATTERN, (integer)8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
38
39 // Placement Parameters (for any non-DROP pattern):
42
43 // Placement Parameters (only for ANGLE & CONE patterns):
45 // PSYS_SRC_OMEGA, <0,0,0>,
46
47 // After-Effect & Influence Parameters:
48 PSYS_SRC_ACCEL, <0.0,0.0,-10.5>,
49 // PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNum() + 1),
50
51 PSYS_PART_FLAGS, (integer)( 0 // Texture Options:
56 // After-effect & Influence Options:
62 )
63 //end of particle settings
64 ];
65
66 if( AUTO_START ) llParticleSystem( particle_parameters );
67
68 }
69
70 link_message( integer sibling, integer num, string mesg, key target_key ) {
71 if( mesg != CONTROLLER_ID ) { // this message isn't for me. Bail out.
72 return;
73 } else if( num == 0 ) { // Message says to turn particles OFF:
74 llParticleSystem( [ ] );
75 } else if( num == 1 ) { // Message says to turn particles ON:
76 llParticleSystem( particle_parameters + target_parameters );
77 } else if( num == 2 ) { // Turn on, and remember and use the key sent us as a target:
78 target_parameters = [ PSYS_SRC_TARGET_KEY, target_key ];
79 llParticleSystem( particle_parameters + target_parameters );
80 } else { // bad instruction number
81 // do nothing.
82 }
83 }
84
85 }
86
87
88 //============================= About Parameters =============================
89 // There are 22-ish NAMED attributes that affect a particle display.
90 // To customize a display you give each a VALUE.
91 // For example: PSYS_PART_START_COLOR is a named attribute,
92 // and <1.0, 0.5, 0.0> is a color VALUE (orange, in this case).
93 //
94 // As long as your 'names' and 'values' are paired up properly, they can
95 // be in any order! Any you omit a pair, it reverts to a default value.
96
97 //============================= Texture Parameters =============================
98 //
99 // TEXTURE, can be an "Asset UUID" key copied from a texture
100 // that you have full permissions to, or the name of
101 // a texture in the prim's inventory.
102 //
103 // SCALE, (size) 0.0 to 4.0 meters wide, by 0.0 to 4.0 meters tall. (default 1x1)
104 // Textures are FLAT, so the 'z' part of the vector is ignored.
105 // Values smaller than 0.04x0.04 may not get rendered at all.
106 // Tiny particles vanish if the viewer is not near them.
107 //
108 // BEGIN_SCALE sets particle start size.
109 // END_SCALE (end size) is ignored, if the INTERP_SCALE_MASK option is disabled.
110 //
111 // COLOR, < RED, GREEN, BLUE > from <0.00,0.00,0.00> (black) to <1.00,1.00,1.00> (white/default)
112 // ALPHA, 1.0 = 100% visible(default), 0.0 = invisible. Less than 0.1 might not get seen.
113 // START_COLOR and START_ALPHA set the color and transparency of newly created particles.
114 // END_COLOR and END_ALPHA are ignored, if the INTERP_COLOR_MASK option is disabled.
115
116
117 //============================= Production Parameters =============================
118 //
119 // BURST_PART_COUNT: quantity of particles per burst, 1 to 4096 (default 1),
120 //
121 // BURST_RATE: seconds to delay between particle bursts. 0.0 to 30.0 (default 0.1)
122 //
123 // PART_MAX_AGE: particle lifespan in seconds, 0.00 to 30.0 (default=10.0)
124 // PART_MAX_AGE less than 0.5 might not be visible.
125 //
126 // The default total number of particles that can be seen is 4096, if one or more
127 // emitters try to create more than that, many will not be seen, and it may cause
128 // viewer lag. Use as few particles as you can for your effect:
129 // AGE/RATE * COUNT will tell you approximately how many particles your emitter creates.
130 //
131 // SRC_MAX_AGE: emitter auto shut-off timer. 1.0 to 60.0 seconds. 0.0 = never stop. (default)
132
133
134 //============================= Placement Parameters =============================
135 //
136 // PATTERN:
137 // DROP, ignores all other placement settings.
138 // EXPLODE, spray particles in all directions
139 // ANGLE, sprays a flat "fan" shape defined by ANGLE_BEGIN and END values
140 // CONE, sprays "ring" or "cone" shapes defined by ANGLE_BEGIN and END values
141 //
142 // RADIUS: 0.0 to 50.0? distance from emitter to create new particles
143 // (RADIUS is disabled with DROP pattern and the FOLLOW_SRC & TARGET_LINEAR options)
144 //
145 // SPEED: 0.00 to 50.0? Sets min/max starting velocities for non-drop patterns. (default: 1.0)
146 //
147 // ANGLE_BEGIN & END: 0.00*PI (up) to 1.00*PI (down), (Only for ANGLE & CONE patterns)
148 // (Values work much like the Sphere-prim's DIMPLE attributes.) (defaults: 0.0)
149 //
150 // OMEGA: <x,y,z> Sets how much to rotate angle/cone spray direction after
151 // every burst. 0.0 to PI? (default: <0,0,0>)
152
153 //======================== After-Effects & Influence Parameters ================
154 //
155 // ACCEL, x,y,z 0.0 to 50.0? sets a constant force, (affects all patterns)
156 // Causes particles to drift up/down or in a compass direction.
157 // Use ACCEL to create the illusion of (anti-)gravity or a directional wind.
158 // (ineffective with TARGET_LINEAR option)
159 //
160 // TARGET_KEY, "key", (requires the TARGET option be enabled).
161 // "key" can be a variety of many different things:
162 // llGetOwner()
163 // llGetKey() target self
164 // llGetLinkKey(1) target parent prim
165 // llGetLinkKey(llGetLinkNum() + 1) target next prim in link set
166 //
167 // WARNING: New copies of objects get new keys, you can't simply paste
168 // a prim's key into your script and expect it to always work. Visit
169 // the Particle Laboratory's section on TARGETS for a variety of ways
170 // to dynamically find your target's key. There are different 'best ways'
171 // depending on if your target is linked to your emitter or not.
172
173
174 //============================= About Options =============================
175 //
176 // Each option may be ON/ENABLED (no leading // )
177 // or OFF/DISABLED (by putting a // in front of it.)
178 // Options are combined together in a special way, (using the | symbol).
179 // This creates one single Parameter for PSYS_PART_FLAGS.
180
181
182 //============================= Texture Options =============================
183 //
184 // EMISSIVE: identical to "full bright" setting on prims
185 //
186 // FOLLOW_VELOCITY: particle texture 'tilts' towards the direction it's moving
187 //
188 // INTERP_COLOR: causes particle COLOR and ALPHA(transparency) to change over it's lifespan
189 //
190 // INTERP_SCALE: causes particle SCALE(size) to change over it's lifespan
191
192
193 //======================== After-Effects & Influences Options ================
194 //
195 // BOUNCE: particles bounce up from the z-altitude of emitter, and cannot fall below it.
196 //
197 // WIND: the sim's wind will push particles around
198 //
199 // FOLLOW_SRC: makes particles move (but not rotate) if their emitter moves, (disables RADIUS)
200 //
201 // TARGET_POS: causes particles to arrive at a some target at end of of their lifespan.
202 //
203 // TARGET_LINEAR: forces particles to form into an even line from emitter to target
204 // and forces a DROP-like pattern and disables effects of WIND and ACCEL
205
206
207
208 //========================================================================
209 //======================== USING CONTROL TEMPLATES =======================
210 //
211 // Want to control when your particles turn ON and OFF? You can!
212 //
213 // Drop one (or more) of the CONTROL TEMPLATES from the particle laboratory
214 // into your object containing this script. That's it!
215
216 // Your controls should be effective immediately. (Some controllers can be
217 // adjusted and tuned, open them and read the USAGE notes to see.)
218 //
219 // One control template can control several particle templates in the
220 // same object. (keep in mind that each prim can only have ONE
221 // particle effect active at a time).
222 //
223 // The 'particle_effect_name' value must be the same in both the control
224 // and particle template to work. You can change that value and have
225 // a controller for one effect, and a different controller for a different
226 // effect in the same object.
227 //

Make_it_Rain

And a script to toggle rain on/off on touch.

Category: Particles
By : Oddball Otoole
Created: 2010-11-18 Edited: 2010-11-18
Worlds: Second Life

1 //// "Touch Toggle" CONTROLLER TEMPLATE v1 - by Jopsy Pendragon - 4/8/2008
2 //// You are free to use this script as you please, so long as you include this line:
3 //** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//
4
5 // EFFECT: 'Touching' this prim will ACTIVATE or DEACTIVE particles.
6
7 // SETUP: Drop this CONTROLLER TEMPLATE script into any prim of the same
8 // linked object as your PARTICLE TEMPLATE. It should be responsive immediately.
9
10 integer PLAY_SOUND = TRUE; // TRUE for a click-sound, FALSE for silent.
11 string SOUND = "64319812-dab1-4e89-b1ca-5fc937b8d94a"; // a click sound
12
13 string CONTROLLER_ID = "A"; // see more about CONTROL TEMPLATES at end.
14
15 integer mode = 0; // keep track of whether particles are ON(1) or OFF(0).
16
17 default {
18
19 touch_start(integer total_number) {
20
21 if( PLAY_SOUND ) llPlaySound( SOUND, 1.0 );
22
23 mode = ! mode; // flip on to off, (or off to on).
24
25 llMessageLinked( LINK_SET, mode, CONTROLLER_ID, NULL_KEY ); // send command
26 }
27
28 // Listen for other controllers sending ON/OFF commands and remember changes:
29 link_message( integer sibling, integer num, string controller_id, key ignore ) {
30
31 if( controller_id != CONTROLLER_ID ) return; // this message is not for us.
32
33 mode = num;
34 }
35 }
36
37
38 //========================================================================
39 //======================== USING CONTROL TEMPLATES =======================
40 //
41 // By default one CONTROLLER TEMPLATE will activate and deactivate all the
42 // PARTICLE TEMPLATES that are in the same linked object.
43 //
44 // However, the templates will only obey or affect each other if they share
45 // identical CONTROLLER_ID's.
46 //
47 // If you want templates to operate independently, change the value for
48 // CONTROLLER_ID so that it is the same for all templates that work together.
49 // (and different from all the templates that it should ignore or be ignored by)

Back to the Best Free Tools in Second Life and OpenSim.