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
Tour swan tour guide  

swan tour guide

Tour

Category: Tour
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life

the Zip file

Download all files for swan tour guide
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. sample route.txt
Get file # 2. tour guide 2.2.lsl
Get file # 3. tour recorder script 1.1.lsl
Get file # 4. 10.lsl
Get file # 5. poseballs.lsl
Get file # 6. recorder.lsl
Get file # 7. rezzert.lsl
Get file # 8. Route.txt
Get file # 9. tour guide.lsl
Get file # 10. Wing 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 // Poseball script for both pose balls
3 // Author: Ferd Frederix
4
5
6 vector TARGET = <-.5,0,-0.1>; // 1/2 meter up, back a tenth.
7 vector ROT = <0, -90, 0>; //rotated 90 degrees
8
9 default
10 {
12 {
14 llSetCameraEyeOffset(<-3, 0, -5> ); // move camera back
15 llSetCameraAtOffset(<-2, 0, 1>);
16
17 rotation rot = llEuler2Rot(ROT * DEG_TO_RAD); // convert the degrees to radians, then convert that vector into a rotation, rot30x
18 llSitTarget(TARGET, rot); // where they sit
19 }
20
21 changed(integer change)
22 {
23 if(change & CHANGED_LINK)
24 {
26 if(av) //evaluated as true if not NULL_KEY or invalid
27 {
29 }
30 else
31 {
32 llSetAlpha(1.0,ALL_SIDES); // make visible when they stand
33 }
34 }
35 }
36
38 {
40 {
41 llStopAnimation("sit");
42 llStartAnimation("sit"); // you can choose a different animation for sitting
44 llMessageLinked(LINK_SET,0,"sit",""); // tell the main script we are ready.
45 }
46 }
48 {
50 }
51 }

swan tour guide

Tour

Category: Tour
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life


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 integer wanted = 0;
3 integer debugger =0;
4 list prims;
5
6
7 debug(string message)
8 {
9 if(debugger)
10 llOwnerSay(message);
11 }
12
13
14
15 string left(string src, string divider) {
16 integer index = llSubStringIndex( src, divider );
17 if(~index)
18 return llDeleteSubString( src, index , -1);
19 return src;
20 }
21
22 string right(string src, string divider) {
23 integer index = llSubStringIndex( src, divider );
24 if(~index)
25 return llDeleteSubString( src, 0, index + llStringLength(divider) - 1);
26 return src;
27 }
28
29
30
31 default
32 {
34 {
35 llSetText("Click after setting up all tour prims.", <1.0, 1.0, 1.0>, 2.0);
36 llListen(300,"","","");
37 }
38
40 {
41 llOwnerSay("Please wait");
42 prims = [];
43 wanted ++;
44 llRegionSay(300,"where");
45 }
46
47 listen(integer channel,string name, key id, string message)
48 {
49 //debug(llGetObjectName() + " heard " + message);
50 if(wanted)
51 {
52 string l = left(message,"|");
53 string r = right(message,"|");
54 string text = right(r,"|");
55
56 integer isthere = llListFindList(prims,[(integer) l]);
57
58
59 if(isthere > -1)
60 {
61 llOwnerSay("Error, there are two prims named " + l + ". Please make sure each prim is uniquely numbered from - to N in sequence from the start prim to the finish prim. Gaps in the sequence are allowed.");
62 }
63
64 if(wanted)
65 {
66 prims += (integer) l;
67 prims += (vector) r;
68 prims += text;
69
70 }
71 llSetTimerEvent(5.0);
72 }
73 }
74
75 timer()
76 {
77 wanted = 0;
79 integer i = 0;
80
81 prims = llListSort(prims,3,1);
82
83 for (i = 0; i < llGetListLength(prims); i+=3)
84 {
85 integer primnum = llList2Integer(prims,i);
86 vector loc = llList2Vector(prims,i+1);
87 string text = llList2String(prims,i+2);
88 llOwnerSay((string) primnum + "|" + (string) loc.x + "|" + (string) loc.y + "|" + (string) loc.z + "|" + text);
89
90 }
91 llOwnerSay("Copy the above lines to the notecard in the tour guide and reset it");
92
93
94 }
95
97 {
99 }
100 }

swan tour guide

Tour

Category: Tour
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life


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 integer counter = 0;
4 string aname;
5 default
6 {
8 {
10 llListen(3454,"","","");
11 }
12
13
14 listen(integer channel, string name,key id, string msg)
15 {
16 //llOwnerSay("Heard Egret");
17 llSleep(10);
18 llSensor(aname,"",PASSIVE|SCRIPTED,5,PI);
19 }
20
22 {
24 llOwnerSay((string) counter + " tours given");
25
26 llSleep(10);
27 llSensor(aname,"",PASSIVE|SCRIPTED,5,PI);
28 }
29
30 sensor(integer num)
31 {
32
34 }
35
36 no_sensor()
37 {
38 llOwnerSay("Rezzing " + aname);
39 counter++;
40
41 rotation rezrot = llEuler2Rot(<0.0,0.0,0.0>) * llGetRot();
42 llRezObject(aname, llGetPos() + <0.0,0.0,0.5>, <0.0,0.0,0.0>, rezrot, 0);
43 }
44 }

swan tour guide

Tour

Category: Tour
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life


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 // Poseball script for both pose balls
3 // Author: Ferd Frederix
4 integer _debug = 0;
5 integer REZ = 3454;
6 list Line = [];
7 list lCoordinate = [];
8 list lDescriptions = [];
9 list lSounds = [];
10 list lCommands = [];
11 list lLinks = [];
12
13
14 // notecard reading
15 integer iIndexLines;
16 string NOTECARD = "Route"; // the notecard for configuring
17
18 key kNoteCardLines; // the key of the notecard
19 key kGetIndexLines; // the key of the current line
20 integer i = 0;
21 integer count = 0;
22 integer timeout = 0;
23
24
25 float DAMPING = .2; // .3
26
27 vector TargetLocation;
28
29
30 float INTERVAL = .050; // seconds to move
31
32 string SpeakThis; // what is to be said
33 string PlayThis; // what is to be Played
34
35 string strip( string str)
36 {
37 string out;
38 integer i;
39
40 for ( ; i < llStringLength(str); i++)
41 {
42 out += llGetSubString(str,i,i);
43 out = llStringTrim(out, STRING_TRIM);
44 }
45 return out;
46
47 }
48
49 string Getline(list Input, integer line)
50 {
51 return strip(llList2String(Input, line));
52 }
53
54
55 default
56 {
57 on_rez(integer param)
58 {
60 }
61
62
64 {
67 kNoteCardLines = llGetNumberOfNotecardLines(NOTECARD);
68 kGetIndexLines = llGetNotecardLine(NOTECARD,0);
69
70 llSay(0, "Tour guide initialising. Please wait.");
71 }
72
73 // read notecard on bootup
74 dataserver(key queryid, string data)
75 {
76
77 vector TempLocation;
78 if(queryid == kNoteCardLines)
79 {
80 iIndexLines = (integer) data;
81 }
82
83 if(queryid == kGetIndexLines)
84 {
85 if(data != EOF)
86 {
87 queryid = llGetNotecardLine(NOTECARD, i);
88 list lLine = (llParseString2List(data, ["|"], []));
89
90 float X = (float) Getline(lLine,1);
91 if(X > 0)
92 {
93 float Y = (float)Getline(lLine,2);
94 float Z = (float)Getline(lLine,3);
95 string Msg = llList2String(lLine,4);
96 string sUUID = Getline(lLine,5);
97 string sCommand = Getline(lLine,6);
98 string sLink = Getline(lLine,7);
99
100 TempLocation.x = X;
101 TempLocation.y = Y;
102 TempLocation.z = Z;
103
104 if(_debug) llOwnerSay((string)TempLocation);
105
106 lCoordinate = lCoordinate + [TempLocation];
107 lDescriptions = lDescriptions + [Msg];
108 lSounds += [sUUID];
109 lCommands += [sCommand];
110 lLinks += [sLink];
111
112 integer locationLength = (llGetListLength(lCoordinate));
113 integer InitPerCent = (integer) llRound(((float) locationLength / (float) iIndexLines) * 100);
114 llSetText("Initialising... \n" + (string) InitPerCent + "%" , <1,1,1>, 1.0);
115 if(InitPerCent == 100)
116 {
117 state Paused;
118 }
119
120 }
121 else
122 {
123 state Paused;
124 }
125 i++;
126 }
127 kGetIndexLines = llGetNotecardLine(NOTECARD,i);
128
129 }
130 }
131
132
133 touch_start(integer total_number)
134 {
135 integer check = llGetListLength(lCoordinate);
136
137 if(_debug)
138 llOwnerSay("List is " + (string) check + " destinations long");
139
140 if(check >= iIndexLines)
141 {
142 state Paused;
143 }
144
145 if(check < iIndexLines)
146 {
147 llSay(0, "Hang on a sec, still initialising...");
148 }
149 }
150
152 {
153 llSetText("", <1,1,1>, 1.0);
154 TargetLocation = (vector) llList2String(lCoordinate, 0); // Look at 0th
155
156 if(_debug)
157 llOwnerSay("Looking at Target Location = " + (string) TargetLocation);
158
159 }
160 }
161
162
163 state Paused
164 {
166 {
167 llSay(0,"Ready");
168 }
169
170 link_message(integer sender,integer num,string msg, key id)
171 {
172 if(msg =="sit")
173 {
174 llWhisper(0,"Please stay seated. Waiting 10 seconds for a passenger");
175 llSleep(10.0);
176 state moving;
177 }
178 }
179
180 changed(integer change)
181 {
182 if(change & CHANGED_INVENTORY)
183 {
185 }
186 }
187
188
189
190
191 }
192
193 state moving
194 {
195
197 {
199
200
201 llLookAt(TargetLocation, 2, 1);
202
203 SpeakThis = llList2String(lDescriptions, count);
204 if(_debug) llOwnerSay("Speaking:" + SpeakThis);
205
206 if(llStringLength(SpeakThis) > 1)
207 llSay(0,SpeakThis);
208
209 PlayThis = llList2String(lSounds, count);
210 if(_debug) llOwnerSay("Playing:" + PlayThis);
211 if(llStringLength(PlayThis) > 1)
212 llPlaySound(PlayThis,1.0);
213
214 llSetTimerEvent(INTERVAL);
215 }
216
217 changed(integer change)
218 {
219 if(change & CHANGED_LINK)
220 {
222 if(av) //evaluated as true if not NULL_KEY or invalid
223 {
224 state moving;
225 }
226 else
227 {
228
229 state end;
230 }
231 }
232
233 }
234
235
236 on_rez(integer param)
237 {
239 }
240
241
242 timer()
243 {
244 timeout ++;
245
246 if(llVecMag(llGetPos() - TargetLocation) > .49999)
247 {
248 if(timeout > 30/INTERVAL) // Time Out to contingency
249 {
250 if(_debug) llOwnerSay("Timeout!");
251 state setposition;
252 }
253 llMoveToTarget((llVecNorm(TargetLocation - llGetPos()) * 1) + llGetPos(), DAMPING);
254 }
255
256 if(llVecMag(llGetPos() - TargetLocation) < .49999)
257 {
258 if(_debug) llOwnerSay("At location: " + (string) llGetPos());
259 state speaking;
260 }
261
262
263 }
264
266 {
268 timeout = 0;
269 i = 0;
270 }
271
272 }
273
274 state setposition //contingency
275 {
277 {
279
280 llSetTimerEvent(INTERVAL);
281 }
282
283 changed(integer change)
284 {
285 if(change & CHANGED_LINK)
286 {
288 //llWhisper(0,"Sit by " + (string) av);
289 if(av) //evaluated as true if not NULL_KEY or invalid
290 {
291 llWhisper(0,"Please stay seated");
292 }
293 else
294 {
295 state end;
296 }
297 }
298 if(change & CHANGED_INVENTORY)
299 {
300 // llResetScript();
301 }
302 }
303
304
305 timer()
306 {
307 if(llVecMag(llGetPos() - TargetLocation) > .49999)
308 {
309 llSetPos((llVecNorm(TargetLocation - llGetPos()) * 0.5) + llGetPos());
310 llLookAt(TargetLocation, 10, 10);
311 }
312
313 if(llVecMag(llGetPos() - TargetLocation) < .49999)
314 {
315 if(_debug)
316 llOwnerSay("At location: " + (string) llGetPos());
317 state speaking;
318 }
319
320 }
322 {
324 }
325
326 }
327
328 state speaking
329 {
330
332 {
333 count ++;
334
335 if(count > (iIndexLines - 1))
336 state end;
337
338 if(count <= (iIndexLines - 1))
339 {
340 TargetLocation = (vector) llList2String(lCoordinate, count);
341 if(_debug) llOwnerSay("New Target: " + (string) TargetLocation);
342 state moving;
343 }
344 }
345
346
348 {
350 }
351
352 }
353
354 state end
355 {
357 {
358 llMessageLinked(LINK_SET,0,"SIT","");
363 if(av) {//evaluated as true if not NULL_KEY or invalid
364 llWhisper(0, llKey2Name(av) +" thank you for taking the tour");
365 llStopAnimation("sit knees up2");
366 llUnSit(av);
367 }
368
369
370 llSay(0, "Tour stopped. It will disappear in one minute");
372
373 }
374
375 changed(integer change)
376 {
377 if(change & CHANGED_LINK)
378 {
380 //llWhisper(0,"Sit by " + (string) av);
381 if(av) //evaluated as true if not NULL_KEY or invalid
382 {
383 llWhisper(0,"Please stay seated");
384 state moving;
385 }
386
387 }
388 if(change & CHANGED_INVENTORY)
389 {
390 // llResetScript();
391 }
392
393 }
394 on_rez(integer param)
395 {
397 }
398
399
400 timer()
401 {
402 llDie();
403 }
404
405 }

swan tour guide

Tour

Category: Tour
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life


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 float on = 0.0;
3 float off = 1.0;
4 list params_on ;
5 list params_off ;
6 list params_up ;
7 list params_out ;
8
9 float ona = 0.0;
10 float offa = 1.0;
11
12 integer softness = 2;
13 float gravity = 2;
14 float friction =3.0;
15 float wind = 0.0;
16 float tension = 1.5;
17 vector force =<0,0,0>;
18 default
19 {
21 {
22 params_on = [ PRIM_FLEXIBLE, TRUE, softness, -2, friction, wind, tension, force];
23 params_off = [ PRIM_FLEXIBLE, TRUE, softness, -gravity, friction, wind, tension, force];
24 params_up = [ PRIM_FLEXIBLE, TRUE, softness, 3, friction, wind, tension, force];
25 params_out = [ PRIM_FLEXIBLE, TRUE, softness, 0, friction, wind, tension, force];
26
27 llSetPrimitiveParams(params_out);
29 }
30
31
32 link_message(integer sender_num, integer num, string msg , key id)
33 {
34 if(num == 0 && msg == "FLY")
35 {
36 llSetPrimitiveParams(params_off);
37 }
38 else if(num == 0 && msg == "SIT")
39 {
40 llSetPrimitiveParams(params_on);
41 }
42 else if(num == 0 && msg == "FLAP")
43 {
44 llSetPrimitiveParams(params_up);
45 llSleep(1.0);
46 llSetPrimitiveParams(params_on);
47 }
48 }
49
50 on_rez(integer param)
51 {
53 }
54 }

swan tour guide

License

Category: Tour
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life


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 [19:28] Tour recorder: 380|24.088040|48.962760|54.082320|
2 [19:28] Tour recorder: 390|18.274350|53.096180|56.138620|
3 [19:28] Tour recorder: 400|19.203230|77.231740|38.415370|
4 [19:28] Tour recorder: 410|18.877440|77.295090|39.746290|
5 [19:28] Tour recorder: 420|37.810330|78.505890|40.247760|
6 [19:28] Tour recorder: 460|49.180880|156.787400|20.250000|There be dragons! (free dragons)
7 [19:28] Tour recorder: Copy the above lines to the notecard in the tour guide and reset it

swan tour guide

Tour Guide setup prim.
Rez this from inventory to m,ake a route. Use the recorder to gather the route

Category: Tour
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life


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
4 integer wanted = 0;
5 integer debugger = 1;
6
7 list prims;
8
9
10 debug(string message)
11 {
12 if(debugger)
13 llOwnerSay(message);
14 }
15
16 default
17 {
19 {
20 llListen(300,"","","");
21 wanted++;
22 llRegionSay(300,"number");
23 llSetTimerEvent(5.0); // 5 seconds to hear from all prims
24 llOwnerSay("Setting coordinates");
25 }
26
27 listen(integer channel,string name, key id, string message)
28 {
29 if(message == "die")
30 llDie();
31
32 else if(message =="where")
33 llRegionSay(300,llGetObjectName() + "|" + (string) llGetPos() + "|" + llGetObjectDesc());
34
35 else if(message =="number")
37
38 else if(wanted)
39 {
40 prims += (integer) message; // add to memory list
41 }
42
43
44 }
45
46 timer()
47 {
48 wanted = 0;
49 prims = llListSort(prims,1,0); // sort descending
50 integer num = (integer) llList2Integer(prims,0); // get highest number
51 llSetObjectName((string) (num + 10)); // leave room for more prims to be added
52 llOwnerSay("Name set to " + llGetObjectName() + ". You can add text to be spoken when the tour reaches this location by adding some text to the description of this object.");
53
55 }
56
58 {
60 }
61 }

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