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
Bat Rezzer Bat_Rezzer__rezzes_any_number_of_bats  

Bat_Rezzer__rezzes_any_number_of_bats

My best Bat rezzer script - Fred Frederix.... menu driven system for number, size and

Category: Bat Rezzer
By : Ferd Frederix
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Bat_Rezzer__rezzes_any_number_of_bats
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Bat_Rezzer__rezzes_any_number_of_ba_1.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 // Description: Just add this to a prim and click it to get bats or other textures to appear in a slowly moving cloud
2 // Comment: My best Bat rezzer script - Fred Frederix.... menu driven system for number and size of bats, hearts, ghhosts, any texture loaded will rez
3 //
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // Hint, that means it is open source, and you must leave it full trasfer/copy/mod. Any changes or derivative must include this header, license, and must be full transfer/copy/mod.
11
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 /// Just drag any number of textures in it, and click it.
18 // Author Ferd Frederix..
19
20 float COUNT = 2.0;
21 float scale = 0.5;
22 float speed = 0.0;
23
24 float TheAge = 30.0000; // increase to 1000
25
26 float CURRENT_RADIUS = 3.0;
27
28 string visible = "Hide";
29
30 // Modified values
31 integer IS_ON = FALSE;
32 float RADIUS = 2; // picked randomly, must be less than MA
33 Xstring TEXTURE = NULL_KEY; // a default texture in case none are found in inventory
34 float INTERVAL = 1.0; // timer interval
35 //string boxcolor = "f39ca3bf-0058-9cd6-2a56-dd198a992fc0"; // the color of the box
36 integer BRIGHT = FALSE;
37
38
39 float x; float y; float z;
40
41 garden()
42 {
43 integer flag = 0;
44 integer howmany = llRound( 2 * PI * RADIUS * COUNT/5);
45
46
47
48 if(BRIGHT == TRUE)
50
55 flag,
57
58 // Texture / Size / Alpha / Color
59 PSYS_SRC_TEXTURE, TEXTURE ,
60 PSYS_PART_START_SCALE,<scale, scale, 0.0000>,
61 PSYS_PART_END_SCALE,<scale, scale, 0.0000>,
62 PSYS_PART_START_ALPHA,1.000000,
63 PSYS_PART_END_ALPHA,1.000000,
64 PSYS_PART_START_COLOR, <1.0,1.0,1.0>,
65 PSYS_PART_END_COLOR, <1.0,1.0,1.0>,
66
67 PSYS_SRC_ACCEL,<x,y,z>,
68
69
71
72 // Flow
73 PSYS_PART_MAX_AGE, TheAge,
76 PSYS_SRC_MAX_AGE,0.000000,
77
78 // Rez position
79 PSYS_SRC_BURST_RADIUS,CURRENT_RADIUS,
82 PSYS_SRC_OMEGA,<0.00000, 0.0, 4>,
85 ]);
86 }
87
88 stop()
89 {
91 }
92
93 integer menu_handler;
94 integer menu_channel;
95
96 list order_buttons(list buttons)
97 {
98 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)
99 + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
100 }
101
102
103 key owner;
104 menu(key user)//make dialog easy, pick a channel by itself and destroy it after 5 seconds
105 {
106
107 string title = "Pick one";
108 list buttons = ["On", "Off",visible,"Less","More","Bright","Radius-","Radius+","Dim"];
109 llListenRemove(menu_handler);
110 menu_handler = llListen(menu_channel,"","","");
111
112 llDialog(user,title,order_buttons(buttons),menu_channel);
113 }
114
115
116
117
118 default
119 {
121 {
122
123 //llSetTexture(boxcolor,ALL_SIDES); // visible
124 // Create random channel within range [-1000000000,-2000000000]
125 float achannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
126
127 menu_channel = (integer) achannel;
128
129 owner = llGetOwner();
130
131
132 if(IS_ON)
133 {
134 llSetTimerEvent(INTERVAL);
135 garden();
136 }
137 else
138 {
139
140 stop();
141 }
142 }
143
144 touch_start(integer num_detected)
145 {
146 integer i;
147 for (i=0;i<num_detected;i++)
148 {
149 key target = llDetectedKey(i);
150
151 if(target != owner) // person clicking isn't owner
152 {
153 llInstantMessage(target,"Sorry, only the owner is allowed to get my contents.");
154 return;
155 }
156 menu(llDetectedKey(0));
157 }
158 }
159
160 timer()
161 {
162 TEXTURE = "a6c3d67d-a145-b6f5-80cd-c0c757b4c4d8"; //bat
163 RADIUS = llFrand(CURRENT_RADIUS);
164
165
166
167 x = llFrand(0.01);
168
169 float dir = llFrand(1);
170 if(dir > 0.5)
171 x = -x;
172
173 y = llFrand(0.01);
174
175 dir = llFrand(1);
176 if(dir > 0.5)
177 y = -y;
178
179 z = llFrand(0.01);
180
181 dir = llFrand(1);
182 if(dir > 0.5)
183 z = -z;
184
185
186 scale = llFrand(0.4) + 0.1;
187
188 garden();
189 }
190
191
192 // add all the lines blow inside "default'
193 listen( integer thechannel, string name, key id, string message )
194 {
195 if(thechannel == menu_channel)
196 {
197
198 // On/Off
199 if(message == "On")
200 IS_ON = FALSE;
201
202 if(message == "Off")
203 IS_ON = TRUE;
204
205
206
207 if(message == "Bright")
208 {
209 BRIGHT = TRUE;
210 }
211 else if(message == "Dim")
212 {
213 BRIGHT = FALSE;
214 }
215
216
217
218 // More or less
219 if(message == "Less")
220 {
221 COUNT--;
222 }
223 else if(message == "More")
224 {
225 COUNT++;
226 }
227
228 if(COUNT < 1.0)
229 {
230 COUNT = 1.0;
231 }
232
233 // size
234 if(message == "Radius-")
235 {
236 CURRENT_RADIUS -= 1;
237 }
238 else if(message == "Radius+")
239 {
240 CURRENT_RADIUS += 1;
241 }
242 else if(message == "Show")
243 {
244 //llSetTexture(boxcolor,ALL_SIDES); // visible
245 visible = "Hide";
246 }
247 else if(message == "Hide")
248 {
249 visible = "Show";
250 // llSetTexture("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903",ALL_SIDES); // invisible
251 }
252
253
254 if(CURRENT_RADIUS > 50.0)
255 {
256 CURRENT_RADIUS = 50.0;
257 }
258 else if(CURRENT_RADIUS < 1.0)
259 {
260 CURRENT_RADIUS = 1.0;
261 }
262
263
264
265
266
267 if(IS_ON)
268 {
269
270 llSetTimerEvent(0.0);
271 stop();
272 llOwnerSay("Garden has stopped");
273 } else {
275 if(max_inventory > 0)
276 {
277 TEXTURE = llGetInventoryName(INVENTORY_TEXTURE, (integer)llFrand(max_inventory));
278 }
279 llSetTimerEvent(INTERVAL);
280 garden();
281 float diameter = 2 * CURRENT_RADIUS;
282 llOwnerSay("Garden is growing, diameter is " + (string) diameter + ", Count=" + (string) COUNT);
283
284 menu(llDetectedKey(0));
285
286 }
287 }
288 }
289
290 changed(integer mask)
291 { //Triggered when the object containing this script changes owner.
292 if(mask & CHANGED_OWNER)
293 {
295 }
296 }
297
298
299 on_rez(integer param)
300 { //Triggered when the object is rezed, like after the object had been sold from a vendor
301 llResetScript();//By resetting the script on rez it forces the listen to re-register.
302 }
303
304
305
306 }

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