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 No Physics Vehicle  

No Physics Vehicle

NPV.lsl

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

the Zip file

Download all files for No Physics Vehicle
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. NPV_1.lsl
1
2 float speed = 0.5;
3 vector velocity = <0,0,0>;
4 default
5 {
7 {
8 llSitTarget(<0,0,-0.5>,<0,0,0,0>);
9 llSetCameraEyeOffset(<-6.0, 0.0, 2.00>);
10 llSetCameraAtOffset(<0.0, 0.0, 1.0>);
11 llListen(4,"",llGetOwner(),"");
12 }
13
15 {
17 {
19 }
20 }
21
22 listen(integer c, string n, key id, string msg)
23 {
24 speed = (float)msg;
25 }
26
28 {
30 {
31 llStopAnimation("Sit");
32 llStartAnimation("!WAway");
33 }
35 {
37 }
39 {
40
41 }
42 }
43
45 {
47 }
48
49 control(key id, integer held, integer change)
50 {
51 rotation rot;
52 if(held & CONTROL_FWD)
53 velocity.x = velocity.x + speed;
54 else
55 velocity.x *= 0.75;
56 if(held & CONTROL_BACK)
57 velocity.x = velocity.x - speed;
58 else
59 velocity.x *= 0.75;
60
61 if(held & CONTROL_LEFT)
62 velocity.y = velocity.y - speed;
63 else
64 velocity.y *= 0.75;
65 if(held & CONTROL_RIGHT)
66 velocity.y = velocity.y + speed;
67 else
68 velocity.y *= 0.75;
69 if(held & CONTROL_UP)
70 llSetPos(llGetPos() + <0,0,speed>);
71 if(held & CONTROL_DOWN)
72 llSetPos(llGetPos() + <0,0,-speed>);
73 if(held & CONTROL_ROT_LEFT)
74 {
75 //llSetRot(llEuler2Rot(llRot2Euler(llGetRot())*RAD_TO_DEG - (<0,0,0.001>*DEG_TO_RAD)));
76 rot = llGetRot() * llEuler2Rot(<0,0,0.12>);
77 llSetRot(rot);
78 }
79 if(held & CONTROL_ROT_RIGHT)
80 {
81 //llSetRot(llEuler2Rot(llRot2Euler(llGetRot())*RAD_TO_DEG - (<0,0,0.001>*DEG_TO_RAD)));
82 rot = llGetRot() * llEuler2Rot(<0,0,-0.12>);
83 llSetRot(rot);
84 }
85 //if(velocity.x > 0.5) velocity.x = 0.5;
86 //if(velocity.x < -0.5) velocity.x = -0.5;
87 //if(velocity.y > 0.5) velocity.y = 0.5;
88 //if(velocity.y < -0.5) velocity.y = -0.5;
89
90 llSetPos(velocity * llGetRot() + llGetPos());
91 }
92 }
93 // END //

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