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 RedWand  

RedWand

RedWand.lsl

Category: Particles
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for RedWand
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. RedWand_1.lsl
1
2 //////////////////////////////////////////////////////////////////
3 //////////////////////////////////////////////////////////////////
4 //// eltee Statosky's Particle Creation Engine 1.0
5 //// 01/09/2004
6 //// *PUBLIC DOMAIN*
7 //// Free to use
8 //// Free to copy
9 //// Free to poke at
10 //// Free to hide in stuff you sell
11 //// Just please leave this header intact
12 //////////////////////////////////////////////////////////////////
13 //////////////////////////////////////////////////////////////////
14
15 integer effectFlags=0;
16 integer running=TRUE;
17
18
19 ///////////////////////////////////////////////////////
20 // Color Secelection Variables
21 ///////////////////////////////////////////////////////
22 // Interpolate between startColor and endColor
23 integer colorInterpolation = TRUE;
24 // Starting color for each particle
25 vector startColor = <1, .7, 0.>;
26 // Ending color for each particle
27 vector endColor = <1, .7, 0>;
28 // Starting Transparency for each particle (1.0 is solid)
29 float startAlpha = 1.0;
30 // Ending Transparency for each particle (0.0 is invisible)
31 float endAlpha = 0.0;
32 // Enables Absolute color (true) ambient lighting (false)
33 integer glowEffect = TRUE;
34
35
36 ///////////////////////////////////////////////////////
37 // Size & Shape Selection Variables
38 ///////////////////////////////////////////////////////
39 // Interpolate between startSize and endSize
40 integer sizeInterpolation = TRUE;
41 // Starting size of each particle
42 vector startSize = <0.1, 0.1, 0.0>;
43 // Ending size of each particle
44 vector endSize = <0.1, 0.1, 0.0>;
45 // Turns particles to face their movement direction
46 integer followVelocity = TRUE;
47 // Texture the particles will use ("" for default)
48 string texture = "";
49
50
51 ///////////////////////////////////////////////////////
52 // Timing & Creation Variables Variables
53 ///////////////////////////////////////////////////////
54 // Lifetime of one particle (seconds)
55 float particleLife = 3.0;
56 // Lifetime of the system 0.0 for no time out (seconds)
57 float SystemLife = 0.0;
58 // Number of seconds between particle emissions
59 float emissionRate = 0.001;
60 // Number of particles to releast on each emission
61 integer partPerEmission = 5;
62
63
64 ///////////////////////////////////////////////////////
65 // Angular Variables
66 ///////////////////////////////////////////////////////
67 // The radius used to spawn angular particle patterns
68 float radius = .5;
69 // Inside angle for angular particle patterns
70 float innerAngle = 1;
71 // Outside angle for angular particle patterns
72 float outerAngle = 90;
73 // Rotational potential of the inner/outer angle
74 vector omega = <1.0, 1.0, 0.0>;
75
76
77 ///////////////////////////////////////////////////////
78 // Movement & Speed Variables
79 ///////////////////////////////////////////////////////
80 // The minimum speed a particle will be moving on creation
81 float minSpeed = 0.0;
82 // The maximum speed a particle will be moving on creation
83 float maxSpeed = 0.1;
84 // Global acceleration applied to all particles
85 vector acceleration = <0.0, 0.0, 0.0>;
86 // If true, particles will be blown by the current wind
87 integer windEffect = FALSE;
88 // if true, particles 'bounce' off of the object's Z height
89 integer bounceEffect = FALSE;
90 // If true, particles spawn at the container object center
91 integer followSource = FALSE;
92 // If true, particles will move to expire at the target
93 //integer followTarget = TRUE;
94 // Desired target for the particles (any valid object/av key)
95 // target Needs to be set at runtime
96 key target = "";
97
98
99 ///////////////////////////////////////////////////////
100 //As yet unimplemented particle system flags
101 ///////////////////////////////////////////////////////
102 integer randomAcceleration = FALSE;
103 integer randomVelocity = FALSE;
104 integer particleTrails = FALSE;
105
106 ///////////////////////////////////////////////////////
107 // Pattern Selection
108 ///////////////////////////////////////////////////////
109 // Uncomment the pattern call you would like to use
110 // Drop parcles at the container objects' center
111 //integer pattern = PSYS_SRC_PATTERN_DROP;
112 // Burst pattern originating at objects' center
113 integer pattern = PSYS_SRC_PATTERN_EXPLODE;
114 // Uses 2D angle between innerAngle and outerAngle
115 //integer pattern = PSYS_SRC_PATTERN_ANGLE;
116 // Uses 3D cone spread between innerAngle and outerAngle
117 //integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
118 //
119 //integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY;
120
121
122
123 setParticles()
124 {
125 // Here is where to set the current target
126 // llGetKey() targets this script's container object
127 // llGetOwner() targets the owner of this script
128 // Feel free to insert any other valid key
129 target="";
130 // The following block of if statements is used to construct the mask
131 if(colorInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_COLOR_MASK;
132 if(sizeInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_SCALE_MASK;
133 if(windEffect) effectFlags = effectFlags|PSYS_PART_WIND_MASK;
134 if(bounceEffect) effectFlags = effectFlags|PSYS_PART_BOUNCE_MASK;
135 if(followSource) effectFlags = effectFlags|PSYS_PART_FOLLOW_SRC_MASK;
136 if(followVelocity) effectFlags = effectFlags|PSYS_PART_FOLLOW_VELOCITY_MASK;
137 if(target!="") effectFlags = effectFlags|PSYS_PART_TARGET_POS_MASK;
138 if(glowEffect) effectFlags = effectFlags|PSYS_PART_EMISSIVE_MASK;
139 //Uncomment the following selections once they've been implemented
140 // if(randomAcceleration) effectFlags = effectFlags|PSYS_PART_RANDOM_ACCEL_MASK;
141 // if(randomVelocity) effectFlags = effectFlags|PSYS_PART_RANDOM_VEL_MASK;
142 // if(particleTrails) effectFlags = effectFlags|PSYS_PART_TRAIL_MASK;
144 PSYS_PART_FLAGS, effectFlags,
145 PSYS_SRC_PATTERN, pattern,
146 PSYS_PART_START_COLOR, startColor,
147 PSYS_PART_END_COLOR, endColor,
148 PSYS_PART_START_ALPHA, startAlpha,
149 PSYS_PART_END_ALPHA, endAlpha,
150 PSYS_PART_START_SCALE, startSize,
151 PSYS_PART_END_SCALE, endSize,
152 PSYS_PART_MAX_AGE, particleLife,
153 PSYS_SRC_ACCEL, acceleration,
154 PSYS_SRC_TEXTURE, texture,
155 PSYS_SRC_BURST_RATE, emissionRate,
156 PSYS_SRC_INNERANGLE, innerAngle,
157 PSYS_SRC_OUTERANGLE, outerAngle,
158 PSYS_SRC_BURST_PART_COUNT, partPerEmission,
161 PSYS_SRC_BURST_SPEED_MAX, maxSpeed,
162 PSYS_SRC_MAX_AGE, SystemLife,
163 PSYS_SRC_TARGET_KEY, target,
164 PSYS_SRC_OMEGA, omega ]);
165 }
166
167 default
168 {
170 {
171 running=TRUE;
172 llSetText("Running", <1.0, 1.0, 1.0>, 0.5);
173 setParticles();
174 }
175
176 touch_start(integer num_detected)
177 {
178 if(running==TRUE)
179 {
180 running=FALSE;
181 llSetText("Stopped", <1.0, 1.0, 1.0>, 0.5);
183 }
184 else
185 {
186 running=TRUE;
187 llSetText("Running", <1.0, 1.0, 1.0>, 0.5);
188 setParticles();
189 }
190 }
191 }
192 // END //

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