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 Copter_new_V1  

Copter_new_V1

Copter (new) V1.lsl

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

the Zip file

Download all files for Copter_new_V1
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Copter_new_V1_1.lsl
1
2 // change stitarget hight llSitTarget(<-0.5, 0.0, 0.8>, <0,0,0,1>);
3 //to fit av the Z axis or 0.8 is the hight
4
5 float speed=0;
6 float high=2400;
7 float turn=25;
8 float lift=0;
9 integer sit = FALSE;
10 integer vertoff = FALSE;
11 integer adecayoff = FALSE;
12 integer ldecayoff = FALSE;
13 string Vname;
14 key avatar;
15
16 help()
17 {
18 llWhisper(0,"Key Actions:");
19 llWhisper(0,"Right click and 'Fly' <-- Starts " + Vname);
20 llWhisper(0,"Click STAND UP button <-- Stops " + Vname + " and returns contols");
21 llWhisper(0,"W or Forward <-- Accelerates or goes faster forwards");
22 llWhisper(0,"S or Backwards <-- Accelerates or goes faster backwards");
23 llWhisper(0,"E or Page up <-- Gains Hieght");
24 llWhisper(0,"C or Page down <-- Loses Hieght");
25 llWhisper(0,"A or Left <-- Turns left");
26 llWhisper(0,"D or Right <-- Turns right");
27 }
28
29 stuntparams()
30 {
31 llSitTarget(<-0.5, 0.0, 0.6>, <0,0,0,1>); //change hight of av here to stand on
32 llSetSitText("Fly");
33 llSetCameraEyeOffset(<-10.0, 0.0, 3.0>);
34 llSetCameraAtOffset(<0.0, 0.0, 0.0>);
37 // linear friction
38 llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <1000, .1, 1000> ); // 1000,2,0.5
39
40 // angular friction
42
43 // linear motor
45 llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1.0 );
47
48 // angular motor
51 llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 6 );
52
53 // no hover
58
59 // linear deflection
62
63 // angular deflection
66
67 // vertical attractor
70
71 // banking
75
76 // default rotation of local frame
78
79 // remove these flags
86 }
87
88 default
89 {
91 {
92 stuntparams();
93 Vname=llGetObjectName();
94 llSetTimerEvent(0.0);
98 llWhisper(0,Vname + " is ready for use");
99 llWhisper(0,"change sittarget to stand on for diffrent hight avs");
100 }
101 on_rez(integer start_param)
102 {
104 }
105 touch(integer total_number)
106 {
107 key owner=llGetOwner();
108 if(llDetectedKey(0)==owner)
109 {
110 help();
111 }
112 else
113 {
114 llWhisper(0,llDetectedName(0) + ", Please step away from the " + Vname);
115 }
116 }
117 changed(integer change)
118 {
119 avatar = llAvatarOnSitTarget();
120 string name=llKey2Name(avatar);
121 if(change & CHANGED_LINK)
122 {
123 if(avatar == NULL_KEY)
124 {
125 // You have gotten off
126 llSetTimerEvent(0.0);
129 llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);
131 llStopAnimation("surf");
132 sit = FALSE;
133 llPushObject(llGetOwner(), <0, 2, 7>, <0,0,0>, TRUE);
136 }
137 else if(avatar == llGetOwner())
138 {
139 // You have gotten on
141 llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);
142 sit = TRUE;
144 }
145 else
146 {
147 llWhisper(0,name + ", Please step away from the " + Vname);
148 llUnSit(avatar);
149 }
150 }
151 }
153 {
155 {
156 llStopAnimation("sit");
157 llStartAnimation("surf");
160 llLoopSound("jet0",0.7);
161 llSetTimerEvent(0.2);
162 }
163 else
164 {
165 llUnSit(avatar);
166 }
167 }
168 control(key id, integer level, integer edge)
169 {
170 vertoff = FALSE;
171 adecayoff = FALSE;
172 ldecayoff = FALSE;
173
174 if((level & CONTROL_FWD) && (level & CONTROL_BACK))
175 {
176 ldecayoff = TRUE;
177 speed=0;
179 }
180
181 if(level & CONTROL_FWD)
182 {
183 ldecayoff = TRUE;
184 if(speed > 30) { speed = 30; }
185 else { speed += 1; }
186 lift= speed * 0.25;
188 }
189
190 if(level & CONTROL_BACK)
191 {
192 ldecayoff = TRUE;
193 if(speed < -10) { speed = -10; }
194 else { speed -= 1; }
195 lift= speed * 0.25;
197 }
198
199 if(level & CONTROL_ROT_RIGHT)
200 {
201 adecayoff = TRUE;
203 }
204
205 if(level & CONTROL_ROT_LEFT)
206 {
207 adecayoff = TRUE;
209 }
210
211 if(level & CONTROL_RIGHT)
212 {
213 vertoff = TRUE;
214 adecayoff = TRUE;
216 }
217
218 if(level & CONTROL_LEFT)
219 {
220 vertoff = TRUE;
221 adecayoff = TRUE;
223 }
224
225 if(level & CONTROL_UP)
226 {
227 ldecayoff = TRUE;
229 }
230
231 if(level & CONTROL_DOWN)
232 {
233
234 ldecayoff = TRUE;
236 }
237
238 if(vertoff)
239 {
245 }
246
247 if(!vertoff)
248 {
254 }
255
256 if(adecayoff)
257 {
258 llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 300 );
260 }
261
262 if(!adecayoff)
263 {
264 llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, .2 );
266 }
267
268 if(ldecayoff)
269 {
272 }
273
274 if(!ldecayoff)
275 {
278 }
279
280 }
281 timer()
282 {
284 }
285 }// END //

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