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
Weapons Explode_and_particle_storm  

Explode_and_particle_storm

Explode

Category: Weapons
By : Encog Dod
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Explode_and_particle_storm
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Explode_and_particle_storm_1.lsl
1
2 fakeMakeExplosion(integer particle_count, float particle_scale, float particle_speed,
3 float particle_lifetime, float source_cone, string source_texture_id,
4 vector local_offset)
5 {
6 //local_offset is ignored
10 PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>,
11 PSYS_PART_END_COLOR, <1.0, 1.0, 1.0>,
14 PSYS_PART_START_SCALE, <particle_scale, particle_scale, 0.0>,
15 PSYS_PART_END_SCALE, <particle_scale * 2 + particle_lifetime, particle_scale * 2 + particle_lifetime, 0.0>,
16 PSYS_PART_MAX_AGE, particle_lifetime,
17 PSYS_SRC_ACCEL, <0.0, 0.0, 0.0>,
18 PSYS_SRC_TEXTURE, source_texture_id,
21 PSYS_SRC_ANGLE_END, source_cone * PI,
22 PSYS_SRC_BURST_PART_COUNT, particle_count / 2,
24 PSYS_SRC_BURST_SPEED_MIN, particle_speed / 3,
25 PSYS_SRC_BURST_SPEED_MAX, particle_speed * 2/3,
26 PSYS_SRC_MAX_AGE, particle_lifetime / 2,
27 PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>
28 ]);
29 }
30
31
32
33
34 generalParticleEmitterOn(float rate)
35 {
38 //| PSYS_PART_BOUNCE_MASK //Bounce on object's z-axis
39 //| PSYS_PART_WIND_MASK //Particles are moved by wind
40 | PSYS_PART_INTERP_COLOR_MASK //Colors fade from start to end
41 | PSYS_PART_INTERP_SCALE_MASK //Scale fades from beginning to end
42 | PSYS_PART_FOLLOW_SRC_MASK //Particles follow the emitter
43 | PSYS_PART_FOLLOW_VELOCITY_MASK//Particles are created at the velocity of the emitter
44 //| PSYS_PART_TARGET_POS_MASK //Particles follow the target
45 | PSYS_PART_EMISSIVE_MASK //Particles will glow
46 //| PSYS_PART_TARGET_LINEAR_MASK//Undocumented--Sends particles in straight line?
47 ,
48
49 //PSYS_SRC_TARGET_KEY , NULL_KEY,//The particles will head towards the specified key
50 //Select one of the following for a pattern:
51 //PSYS_SRC_PATTERN_DROP Particles start at emitter with no velocity
52 //PSYS_SRC_PATTERN_EXPLODE Particles explode from the emitter
53 //PSYS_SRC_PATTERN_ANGLE Particles are emitted in a 2-D angle
54 //PSYS_SRC_PATTERN_ANGLE_CONE Particles are emitted in a 3-D cone
55 //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY Particles are emitted everywhere except for a 3-D cone
56
58
59 ,PSYS_SRC_TEXTURE, "" //UUID of the desired particle texture, or inventory name
60 ,PSYS_SRC_MAX_AGE, 0.0 //Time, in seconds, for particles to be emitted. 0 = forever
61 ,PSYS_PART_MAX_AGE, 0.2 //Lifetime, in seconds, that a particle lasts
62 ,PSYS_SRC_BURST_RATE, rate //How long, in seconds, between each emission
63 ,PSYS_SRC_BURST_PART_COUNT, 6 //Number of particles per emission
64 ,PSYS_SRC_BURST_RADIUS, 10.0 //Radius of emission
65 ,PSYS_SRC_BURST_SPEED_MIN, .1 //Minimum speed of an emitted particle
66 ,PSYS_SRC_BURST_SPEED_MAX, .1 //Maximum speed of an emitted particle
67 ,PSYS_SRC_ACCEL, <0,0,0> //Acceleration of particles each second
68 ,PSYS_PART_START_COLOR, <1,1,1> //Starting RGB color
69 ,PSYS_PART_END_COLOR, <1,1,1> //Ending RGB color, if INTERP_COLOR_MASK is on
70 ,PSYS_PART_START_ALPHA, 1.0 //Starting transparency, 1 is opaque, 0 is transparent.
71 ,PSYS_PART_END_ALPHA, 1.0 //Ending transparency
72 ,PSYS_PART_START_SCALE, <.04,.25,.01> //Starting particle size
73 ,PSYS_PART_END_SCALE, <.03,.25,.01> //Ending particle size, if INTERP_SCALE_MASK is on
74 ,PSYS_SRC_ANGLE_BEGIN, 1.54 //Inner angle for ANGLE patterns
75 ,PSYS_SRC_ANGLE_END, 1.55 //Outer angle for ANGLE patterns
76 ,PSYS_SRC_OMEGA, <0.0,0.0,0.0> //Rotation of ANGLE patterns, similar to llTargetOmega()
77 ]);
78 }
79
80 generalParticleEmitterOff()
81 {
83 }
84
85 float rate = 0.5;
86
87 integer bling_state = TRUE;
88
89 list MENU1 = ["(Bling)","(Effects)"];
90 list MENU2 = ["(Effects)","Bling Stop","Bling On","Slower","Faster"];
91 list MENU3 = ["(Bling)","Big Bang","Hearts","Butterflies"];
92
93 integer listener;
94 integer MENU_CHANNEL = 1023;
95
96
97 Dialog(key id, list menu)
98 {
99 llListenRemove(listener);
100 listener = llListen(MENU_CHANNEL, "", NULL_KEY, "");
101 llDialog(id, "Select one object below: ", menu, MENU_CHANNEL);
102 }
103
104 default
105 {
106 on_rez(integer num)
107 {
109 }
110
111
113 {
114 generalParticleEmitterOn(rate);
115 //llPreloadSound("explosion");
116 }
117
118 touch_start(integer total_number)
119 {
120 integer i = 0;
121 Dialog(llDetectedKey(0), MENU1);
122 }
123
124 listen(integer channel, string name, key id, string message)
125 {
126 if(channel == MENU_CHANNEL)
127 {
128 llListenRemove(listener);
129 if(message == "(Bling)")
130 {
131 Dialog(id, MENU2);
132 }
133 else if(message == "(Effects)")
134 {
135 Dialog(id, MENU3);
136 }
137
138
139 // Effects
140 else if(message == "Big Bang")
141 {
142 fakeMakeExplosion(80, 1.0, 13.0, 2.2, 1.0, "fire", <0.0, 0.0, 0.0>);
143 //llTriggerSound("explosion", 10.0);
144 llSleep(.5);
145 fakeMakeExplosion(80, 1.0, 13.0, 2.2, 1.0, "smoke", <0.0, 0.0, 0.0>);
146 llSleep(1);
147 if(bling_state = TRUE)
148 generalParticleEmitterOn(rate);
149 else
151
152
153 Dialog(id, MENU3);
154 }
155 else if(message == "Hearts")
156 {
157 llWhisper(0,"Hearts");
158 Dialog(id, MENU3);
159 }
160 else if(message == "Butterflies")
161 {
162 llWhisper(0,"Butterflies");
163 Dialog(id, MENU3);
164 }
165
166 //bling
167 else if(message == "Bling Stop")
168 {
169 generalParticleEmitterOff();
170 bling_state = FALSE;
171 Dialog(id, MENU2);
172 }
173 else if(message == "Bling On")
174 {
175 generalParticleEmitterOn(rate);
176 bling_state = TRUE;
177 Dialog(id, MENU2);
178 }
179 else if(message == "Faster")
180 {
181 rate /=2;
182 generalParticleEmitterOn(rate);
183 bling_state = TRUE;
184 Dialog(id, MENU2);
185 }
186 else if(message == "Slower")
187 {
188 rate *=2;
189 generalParticleEmitterOn(rate);
190 bling_state = TRUE;
191 Dialog(id, MENU2);
192 }
193 else
194 {
195 // todo add offsets so box sites perfect on rezzer
196 //llRezAtRoot(message, llGetPos(), ZERO_VECTOR, llGetRot(), 0);
197 }
198 }
199 }
200 }

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