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 Emitter_Particle_controllable  

Emitter_Particle_controllable

EMITTERSCRIPT.lsl

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

the Zip file

Download all files for Emitter_Particle_controllable
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. EMITTERSCRIPT_1.lsl
1
2 //////////////////////////////////////////////////////////////////
3 //// eltee Statosky's Particle Creation Engine 1.5
4 //// 09/09/2004
5 //// *PUBLIC DOMAIN*
6 //// Free to use/copy/poke/ripoff and sell stuff with
7 //////////////////////////////////////////////////////////////////
8
9
10 ///////////////////////////////////////////////////////
11 // Effect Flag Collection variable
12 ///////////////////////////////////////////////////////
13 integer effectFlags;
14
15
16 ///////////////////////////////////////////////////////
17 // Color Variables
18 //
19 // These affect color and transparency
20 ///////////////////////////////////////////////////////
21 // colorInterpolation TRUE gives a smooth start to end change
22 // The colors are presented as <R, G, B> values between 0 and 1
23 // The alphas are transparency. 1.0 is solid, 0.0 is clear
24 // glowEffect TRUE has bright 'light like' particles
25 // glowEffect FALSE has unlit 'smoke like' particles
26 integer colorInterpolation = TRUE;
27 vector startColor = <0.8, 0.85, 1.0>;
28 vector endColor = <0.8, 0.85, 1.0>;
29 float startAlpha = 1.0;
30 float endAlpha = 0.0;
31 integer glowEffect = TRUE;
32
33
34 ///////////////////////////////////////////////////////
35 // Size & Shape Variables
36 //
37 // These affect the particle's physical appearance
38 ///////////////////////////////////////////////////////
39 // sizeInterpolation TRUE gives a smooth start to end change
40 // The sizes are presented as <X, Y, 0.0> (z is meaningless)
41 // followVelocity TRUE is the only way to get particles to
42 // 'tilt' but can be very tricky to implement
43 // texture = "texturename" loads texturename as particle shape
44 integer sizeInterpolation = TRUE;
45 vector startSize = <0.1, 0.1, 0.0>;
46 vector endSize = <0.1, 0.1, 0.0>;
47 integer followVelocity = FALSE;
48 //THIS HERE IS WHERE YOU PUT YOUR TEXTURE. REPLACE THE CODE WITH THE -EXACT- TEXTURE NAME INCLUDING THE SUFFIX IF IT HAS ONE (I.E. .JPG, .BMP, etc.) MAKE SURE TO LEAVE THE QUOTE MARKS BEFORE AND AFTER. SAVE, THEN WHEN YOU PUT THIS SCRIPT INTO THE OBJECT MAKE SURE YOU PUT THE TEXTURE AS WELL.
49 string texture = "shamrock1";
50
51
52 ///////////////////////////////////////////////////////
53 // Timing & Creation Variables Variables
54 //
55 // Affects the number and density of particles
56 ///////////////////////////////////////////////////////
57 // ParticleLife sets the Lifetime of one particle (seconds)
58 // SystemLife sets the lifetime of the emitter (0.0 is infinite)
59 // EmissionRate is how many seconds between particle spawns
60 // PartPerEmission is how many particles spawn at a time
61 float particleLife = 6.0;
62 float SystemLife = 0.0;
63 float emissionRate = 1.0;
64 integer partPerEmission = 1;
65
66
67 ///////////////////////////////////////////////////////
68 // 3D Particle Space Variables
69 //
70 // Affect how the particles spawn into the world
71 ///////////////////////////////////////////////////////
72 // The radius is used to spawn angular particle patterns
73 // The angles are represented on 'both' sides of a prim
74 // The begin angle is the 'upper' starting point (radians)
75 // The end angle is the 'lower' stopping point (radians)
76 // Omega sets the speed of rotation about the <x,y,z> axis
77 float radius = 0.0;
78 float beginAngle = 0.0;
79 float endAngle = 1.5;
80 vector omega = <0.0, 0.0, 0.0>;
81
82
83 ///////////////////////////////////////////////////////
84 // Movement & Speed Variables
85 //
86 // Affects how particles travel in 3D space
87 ///////////////////////////////////////////////////////
88 // The speed values set the minimum and maximum speed
89 // particles have upon spawning.
90 // The acceleration is global to all particles (think gravity)
91 // WindEffect TRUE applies the current sim wind to particles
92 // BounceEffect TRUE means particles bounce on the 'floor'
93 // aka the z height of their emitter
94 // FollowSource TRUE means particles start on their emitter
95 // and move as it moves.
96 // FollowTarget means particles travel in linear path from
97 // emitter to their target object
98 // Target is declared here but used in the setParticles function
99 float minSpeed = 0.1;
100 float maxSpeed = 0.15;
101 vector acceleration = <0.0, 0.0, -0.1>;
102 integer windEffect = FALSE;
103 integer bounceEffect = FALSE;
104 integer followSource = FALSE;
105 integer followTarget = FALSE;
106 key target;
107
108
109 ///////////////////////////////////////////////////////
110 // Pattern Selection
111 //
112 // (Uncomment one of the following)
113 ///////////////////////////////////////////////////////
114 // DROP simply drops the particles at the emitters center
115 // EXPLODE has all particles moving outward from the center
116 // ANGLE has particles at radius distance and between angle
117 // values in a 2D plane shape
118 // ANGLE_CONE has particles at radius distance and between
119 // angle values in a 3D cone shape
120
121 //integer pattern = PSYS_SRC_PATTERN_DROP;
122 //integer pattern = PSYS_SRC_PATTERN_EXPLODE;
123 integer pattern = PSYS_SRC_PATTERN_ANGLE;
124 //integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
125
126
127
128 ///////////////////////////////////////////////////////
129 // Particle System Call Function
130 //
131 // Calling this function applies the particle
132 // parameters to the current prim the script is in.
133 ///////////////////////////////////////////////////////
134 setParticles()
135 {
136 // Here is where to set the current target to any valid key
137 // target=llGetKey(); //Targets the emitter
138 // target=llGetOwner(); //Targets the owner
139
140 // The following if statements are used to construct the mask
141 if(colorInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_COLOR_MASK;
142 if(sizeInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_SCALE_MASK;
143 if(windEffect) effectFlags = effectFlags|PSYS_PART_WIND_MASK;
144 if(bounceEffect) effectFlags = effectFlags|PSYS_PART_BOUNCE_MASK;
145 if(followSource) effectFlags = effectFlags|PSYS_PART_FOLLOW_SRC_MASK;
146 if(followVelocity) effectFlags = effectFlags|PSYS_PART_FOLLOW_VELOCITY_MASK;
147 if(target!="") effectFlags = effectFlags|PSYS_PART_TARGET_POS_MASK;
148 if(glowEffect) effectFlags = effectFlags|PSYS_PART_EMISSIVE_MASK;
150 PSYS_PART_FLAGS, effectFlags,
151 PSYS_SRC_PATTERN, pattern,
152 PSYS_PART_START_COLOR, startColor,
153 PSYS_PART_END_COLOR, endColor,
154 PSYS_PART_START_ALPHA, startAlpha,
155 PSYS_PART_END_ALPHA, endAlpha,
156 PSYS_PART_START_SCALE, startSize,
157 PSYS_PART_END_SCALE, endSize,
158 PSYS_PART_MAX_AGE, particleLife,
159 PSYS_SRC_ACCEL, acceleration,
160 PSYS_SRC_TEXTURE, texture,
161 PSYS_SRC_BURST_RATE, emissionRate,
162 PSYS_SRC_ANGLE_BEGIN, beginAngle,
163 PSYS_SRC_ANGLE_END, endAngle,
164 PSYS_SRC_BURST_PART_COUNT, partPerEmission,
167 PSYS_SRC_BURST_SPEED_MAX, maxSpeed,
168 PSYS_SRC_MAX_AGE, SystemLife,
169 PSYS_SRC_TARGET_KEY, target,
170 PSYS_SRC_OMEGA, omega ]);
171 }
172
173 integer l1;
174 default
175 {
176 on_rez(integer start_param)
177 {
178 if(l1!=0)
180 l1=llListen(1,"",llGetOwner(),"");
181 }
183 {
184 if(l1!=0)
186 l1=llListen(1,"",llGetOwner(),"");
187 }
188 listen(integer channel, string name, key id, string msg)
189 {
190 if(msg=="sparkles on")
191 {
192 setParticles();
193 }
194 else if(msg=="sparkles off")
195 {
197 }
198 else if(msg=="hornglow on")
199 {
200 llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <0.94, 0.96, 0.98>, 1.0, 1.5, 1.0]);
201 }
202 else if(msg=="hornglow off")
203 {
204 llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <0.94, 0.96, 0.98>, 1.0, 1.5, 1.0]);
205 }
206 }
207 }
208 // END //

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