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 Glowstick  

Glowstick

Glowstick.lsl

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

the Zip file

Download all files for Glowstick
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Glowstick_1.lsl
1
2 //// eltee Statosky's Particle Creation Engine 1.0
3
4 integer effectFlags=0;
5 integer running=TRUE;
6 float red=1.0;
7 float green=0.0;
8 float blue=0.0;
9
10 // Color Secelection Variables
11 integer colorInterpolation = TRUE;
12 vector startColor = <red, green, blue>;
13 vector endColor = <red, green, blue>;
14 float startAlpha = 1.0;
15 float endAlpha = 0.2;
16 integer glowEffect = TRUE;
17
18
19 // Size & Shape Selection Variables
20 integer sizeInterpolation = TRUE;
21 vector startSize = <0.1, 0.5, 0.0>;
22 vector endSize = <0.1, 0.5, 0.0>;
23 integer followVelocity = TRUE;
24 string texture = "";
25
26
27 // Timing & Creation Variables Variables
28 float particleLife = 2.0;
29 float SystemLife = 0.0;
30 float emissionRate = 0.06;
31 integer partPerEmission = 1;
32
33
34 // Angular Variables
35 float radius = 0.0;
36 float innerAngle = 0;
37 float outerAngle = 0;
38 vector omega = <0.0, 0.0, 0.0>;
39
40
41 // Movement & Speed Variables
42 float minSpeed = 0.0;
43 float maxSpeed = 0.01;
44 vector acceleration = <0.0, 0.0, 0.0>;
45 integer windEffect = FALSE;
46 integer bounceEffect = FALSE;
47 integer followSource = FALSE;
48 //integer followTarget = TRUE;
49 key target = "";
50
51
52 //As yet unimplemented particle system flags
53 integer randomAcceleration = FALSE;
54 integer randomVelocity = FALSE;
55 integer particleTrails = FALSE;
56
57 // Pattern Selection
58 //integer pattern = PSYS_SRC_PATTERN_DROP;
59 //integer pattern = PSYS_SRC_PATTERN_EXPLODE;
60 integer pattern = PSYS_SRC_PATTERN_ANGLE;
61 //integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
62 //integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY;
63
64
65
66 setParticles()
67 {
68 // Here is where to set the current target
69 // llGetKey() targets this script's container object
70 // llGetOwner() targets the owner of this script
71 // Feel free to insert any other valid key
72 target="";
73 // The following block of if statements is used to construct the mask
74 if(colorInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_COLOR_MASK;
75 if(sizeInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_SCALE_MASK;
76 if(windEffect) effectFlags = effectFlags|PSYS_PART_WIND_MASK;
77 if(bounceEffect) effectFlags = effectFlags|PSYS_PART_BOUNCE_MASK;
78 if(followSource) effectFlags = effectFlags|PSYS_PART_FOLLOW_SRC_MASK;
79 if(followVelocity) effectFlags = effectFlags|PSYS_PART_FOLLOW_VELOCITY_MASK;
80 if(target!="") effectFlags = effectFlags|PSYS_PART_TARGET_POS_MASK;
81 if(glowEffect) effectFlags = effectFlags|PSYS_PART_EMISSIVE_MASK;
82 //Uncomment the following selections once they've been implemented
83 // if(randomAcceleration) effectFlags = effectFlags|PSYS_PART_RANDOM_ACCEL_MASK;
84 // if(randomVelocity) effectFlags = effectFlags|PSYS_PART_RANDOM_VEL_MASK;
85 // if(particleTrails) effectFlags = effectFlags|PSYS_PART_TRAIL_MASK;
87 PSYS_PART_FLAGS, effectFlags,
88 PSYS_SRC_PATTERN, pattern,
89 PSYS_PART_START_COLOR, startColor,
90 PSYS_PART_END_COLOR, endColor,
91 PSYS_PART_START_ALPHA, startAlpha,
92 PSYS_PART_END_ALPHA, endAlpha,
93 PSYS_PART_START_SCALE, startSize,
94 PSYS_PART_END_SCALE, endSize,
95 PSYS_PART_MAX_AGE, particleLife,
96 PSYS_SRC_ACCEL, acceleration,
97 PSYS_SRC_TEXTURE, texture,
98 PSYS_SRC_BURST_RATE, emissionRate,
99 PSYS_SRC_INNERANGLE, innerAngle,
100 PSYS_SRC_OUTERANGLE, outerAngle,
101 PSYS_SRC_BURST_PART_COUNT, partPerEmission,
104 PSYS_SRC_BURST_SPEED_MAX, maxSpeed,
105 PSYS_SRC_MAX_AGE, SystemLife,
106 PSYS_SRC_TARGET_KEY, target,
107 PSYS_SRC_OMEGA, omega ]);
108 }
109
110 default
111 {
113 {
114 llSetText("", <0.0, 1.0, 0.0>, 0.5);
115 running=TRUE;
116 setParticles();
117 llSetTimerEvent(0.2);
118 }
119
120 timer()
121 {
122 //Red event
123 if(red >= 1.0)
124 {
125 if(blue > 0.1)
126 {blue = blue - 0.1;}
127 else
128 {green = green + 0.1;}
129 }
130
131 if(green >= 1.0)
132 {
133 if(red > 0.1)
134 {red = red - 0.1;}
135 else
136 {blue = blue + 0.1;}
137 }
138
139 if(blue >= 1.0)
140 {
141 if(green > 0.1)
142 {green = green - 0.1;}
143 else
144 {red = red + 0.1;}
145 }
146
147 //Colors
148 startColor = <red, green, blue>;
149 endColor = <red, green, blue>;
150
151 //Set color
152 setParticles();
153 llSetColor(<red, green, blue>,ALL_SIDES);
154
155 //loop
156 llSetTimerEvent(0.2);
157
158 }
159 }
160 // END //

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