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 Bling with Menu  

Bling with Menu

Bling

Category: Particles
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-07
Worlds: Second Life

the Zip file

Download all files for Bling with Menu
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Script.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

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

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