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
Vehicles Hover_Disk_Script  

Hover_Disk_Script

Hover Disk Script.lsl

Category: Vehicles
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Hover_Disk_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Hover_Disk_Script_1.lsl
1
2 float speed=0;
3 float high=2400;
4 float turn=25;
5 float lift=0;
6 integer sit = FALSE;
7 integer vertoff = FALSE;
8 integer adecayoff = FALSE;
9 integer ldecayoff = FALSE;
10 string Vname;
11 key avatar;
12
13 help()
14 {
15 //llWhisper(0,"Key Actions:");
16 //llWhisper(0,"Right click and 'Fly' <-- Starts " + Vname);
17 //llWhisper(0,"Click STAND UP button <-- Stops " + Vname + " and returns contols");
18 //llWhisper(0,"W or Forward <-- Accelerates or goes faster forwards");
19 //llWhisper(0,"S or Backwards <-- Accelerates or goes faster backwards");
20 //llWhisper(0,"E or Page up <-- Gains Hieght");
21 //llWhisper(0,"C or Page down <-- Loses Hieght");
22 //llWhisper(0,"A or Left <-- Turns left");
23 //llWhisper(0,"D or Right <-- Turns right");
24 }
25
26 stuntparams()
27 {
28 llSitTarget(<-0.5, 0.0, 0.3>, <0,0,0,1>);
29 llSetSitText("Get On");
30 llSetCameraEyeOffset(<-10.0, 0.0, 3.0>);
31 llSetCameraAtOffset(<0.0, 0.0, 0.0>);
34 // linear friction
35 llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <1000, .1, 1000> ); //1000,2,0.5
36
37 // angular friction
39
40 // linear motor
42 llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 0.1 );
44
45 // angular motor
48 llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 6 );
49
50 // no hover
55
56 // linear deflection
59
60 // angular deflection
63
64 // vertical attractor
67
68 // banking
72
73 // default rotation of local frame
75
76 // remove these flags
83 }
84
85 default
86 {
88 {
89 stuntparams();
90 Vname=llGetObjectName();
91 llSetTimerEvent(0.0);
95 //llWhisper(0,Vname + " is ready for use");
96 }
97 on_rez(integer start_param)
98 {
100 }
101 touch(integer total_number)
102 {
103 key owner=llGetOwner();
104 if(llDetectedKey(0)==owner)
105 {
106 help();
107 }
108 else
109 {
110 //llWhisper(0,llDetectedName(0) + ", Please step away from the " + Vname);
111 }
112 }
113 changed(integer change)
114 {
115 avatar = llAvatarOnSitTarget();
116 string name=llKey2Name(avatar);
117 if(change & CHANGED_LINK)
118 {
119 if(avatar == NULL_KEY)
120 {
121 // You have gotten off
122 llSetTimerEvent(0.0);
125 llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);
127 llStopAnimation("sit");
128 sit = FALSE;
129 //llPushObject(llGetOwner(), <0, 2, 7>, <0,0,0>, TRUE);
132 }
133 else if(avatar == llGetOwner())
134 {
135 // You have gotten on
137 llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);
138 sit = TRUE;
140 }
141 else
142 {
143 //llWhisper(0,name + ", Please step away from the " + Vname);
144 llUnSit(avatar);
145 }
146 }
147 }
149 {
151 {
152 llStopAnimation("sit");
153 llStartAnimation("stand");
156 //llLoopSound("jet0",0.7);
157 llSetTimerEvent(0.2);
158 }
159 else
160 {
161 llUnSit(avatar);
162 }
163 }
164 control(key id, integer level, integer edge)
165 {
166 vertoff = FALSE;
167 adecayoff = FALSE;
168 ldecayoff = FALSE;
169
170 if((level & CONTROL_FWD) && (level & CONTROL_BACK))
171 {
172 ldecayoff = TRUE;
173 speed=0;
175 }
176
177 if(level & CONTROL_FWD)
178 {
179 ldecayoff = TRUE;
180 if(speed > 30) { speed = 30; }
181 else { speed += 1; }
182 lift= speed * 0.25;
184 }
185
186 if(level & CONTROL_BACK)
187 {
188 ldecayoff = TRUE;
189 if(speed < -10) { speed = -10; }
190 else { speed -= 1; }
191 lift= speed * 0.25;
193 }
194
195 if(level & CONTROL_ROT_RIGHT)
196 {
197 adecayoff = TRUE;
199 }
200
201 if(level & CONTROL_ROT_LEFT)
202 {
203 adecayoff = TRUE;
205 }
206
207 if(level & CONTROL_RIGHT)
208 {
209 vertoff = TRUE;
210 adecayoff = TRUE;
212 }
213
214 if(level & CONTROL_LEFT)
215 {
216 vertoff = TRUE;
217 adecayoff = TRUE;
219 }
220
221 if(level & CONTROL_UP)
222 {
223 ldecayoff = TRUE;
225 }
226
227 if(level & CONTROL_DOWN)
228 {
229
230 ldecayoff = TRUE;
232 }
233
234 if(vertoff)
235 {
241 }
242
243 if(!vertoff)
244 {
250 }
251
252 if(adecayoff)
253 {
254 llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 300 );
256 }
257
258 if(!adecayoff)
259 {
260 llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, .2 );
262 }
263
264 if(ldecayoff)
265 {
268 }
269
270 if(!ldecayoff)
271 {
274 }
275
276 }
277 timer()
278 {
280 }
281 }// END //

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