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
Movement Parachute_Platform  

Parachute_Platform

Parachute Platform Script
Mango Wylder

Category: Movement
By : mangowylder
Created: 2012-05-07 Edited: 2012-05-07
Worlds: Second Life

the Zip file

Download all files for Parachute_Platform
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Parachute_Platform_1.lsl
1 // Parachute platform script (updated)
2 //
3 // Max height is 4000 meters.
4 // Uses LLDialog for menu and LLTextBox for user input
5 // Click the home button to return to original rez position
6 // When the last avi leaves the platform it will return to it's
7 // home postion
8
9 // Written by Mango Wylder except where noted
10 //
11 // function AvCount by Donjr Spiegelblatt
12 //
13 // Replaced warpos function with llSetRegionPos as
14 // suggested by Donjr Spiegelblatt
15
16 // changed all "Say/IM's" to llRegionSayTo
17 // Added sanity check so that an avi has to be on the platform
18 // to move it
19
20
21
22 list gLstChoices = ["MoveUp", "Home", "Cancel"];
23 integer gIntChannel_Dialog;
24 integer gIntChannel_Dialog1;
25 integer gIntListen_Id;
26 integer gIntListen_Id_Chat;
27 key gKeyToucherID;
28 vector gCurrentPos;
29 vector gHomePos;
30 vector destPos;
31 float gZv;
32 float X;
33 float Y;
34 float Z;
35
36
37 integer AvCount()
38 {
39 // returns the number of avatars sitting on the object
41 }
42
43 default{
44 on_rez(integer start_param){
46 }
48 gHomePos = llGetPos();
49 gIntChannel_Dialog = ( -1 * (integer)("0x"+llGetSubString((string)llGetKey(),-5,-1)) ); // set a negative integer chat channel for the dialog box
50 gIntChannel_Dialog1 = ( -1 * (integer)("0x"+llGetSubString((string)llGetKey(),-8,-1)) ); //set a negative integer chat channel for the text box
51 }
52 changed(integer change){ // determine when the last avi stands up and send platform home
53 if(change & CHANGED_LINK) {
54 if(AvCount() == 0){
55 destPos = gHomePos;
56 llSetRegionPos(destPos);
57 }
58 }
59 }
60
61 touch_start(integer total_number){
62 gKeyToucherID = llDetectedKey(0);
63 llDialog(gKeyToucherID, "Please make a choice.", gLstChoices, gIntChannel_Dialog);
64 gIntListen_Id = llListen(gIntChannel_Dialog, "", gKeyToucherID, "");
65 llSetTimerEvent(20); // set a time limit to llListen
66 // Adding .x .y or .z after the vector name can be used to get the float value of just that axis.
67 gCurrentPos = llGetPos();
68 X = gCurrentPos.x;
69 Y = gCurrentPos.y;
70 Z = gCurrentPos.z; // <--- Like this
71 }
72
73 listen(integer channel, string name, key id, string choice) {
74 if(channel == gIntChannel_Dialog) {
75 if(~llListFindList(gLstChoices, [choice])) { // verify dialog choice
76 if(choice == "Cancel"){
77 llListenRemove(gIntListen_Id);
78 }
79 else if(choice == "MoveUp"){
80 if(AvCount() == 0){
81 llRegionSayTo(gKeyToucherID, 0,"I'm not going anywhere until someone sits on me!");
82 llRegionSayTo(gKeyToucherID, 0,"MoveUp operation aborted. Please try again");
83 llListenRemove(gIntListen_Id_Chat);
84 return;
85 }
86 gIntListen_Id_Chat = llListen(gIntChannel_Dialog1, "", gKeyToucherID, "");
87 llTextBox(gKeyToucherID,"Please enter a height in meters",gIntChannel_Dialog1 );
88 llListenRemove(gIntListen_Id);
89 }
90 else if(choice == "Home"){
91 llSetRegionPos(gHomePos);
92 }
93 }
94 }
95
96 if(channel == gIntChannel_Dialog1){
97 if(choice == "") { // Check for user input // Alpha character input will be ignored
98 llRegionSayTo(gKeyToucherID, 0,"Please enter a height!");
99 llRegionSayTo(gKeyToucherID, 0,"MoveUp operation aborted. Please try again");
100 llListenRemove(gIntListen_Id_Chat);
101 }
102 else{
103 gZv = (float) (choice); // Typecast string to float
104 Z = Z + gZv;
105 if(Z >= 4000){ // 4000 meters is max height for this script
106 Z = 4000;
107 llRegionSayTo(gKeyToucherID, 0, "That height exceeds the limit of 4000 meters!" + " Setting height to 4000 meters.");
108 destPos = (<X,Y,Z>);
109 llSetRegionPos(destPos);
110 }
111 else{
112 destPos = (<X,Y,Z>);
113 llSetRegionPos (destPos);
114 }
115 }
116 }
117 }
118
119 timer() { //TIME’S UP!
120 llListenRemove(gIntListen_Id);
121 llSetTimerEvent(0); //Stop the timer from being called repeatedly
122 }
123 }

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