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
Vehicle LandRover  

LandRover

Opensim Vehicle

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

the Zip file

Download all files for LandRover
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. driver.lsl
Get file # 2. l door.lsl
Get file # 3. l door.lsl
Get file # 4. passsenger.lsl
Get file # 5. vehicle.lsl
Get file # 6. rotate.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 // Author: Davy Maltz
3 // Clean and user-friendly Poseball script.
4
5 // Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=1350
6
7 // This program is free software; you can redistribute it and/or modify it.
8 // Additional Licenes may apply that prevent you from selling this code
9 // and these licenses may require you to publish any changes you make on request.
10 //
11 // There are literally thousands of hours of work in these scripts. Please respect
12 // the creators wishes and Copyright law and follow their license requirements.
13 //
14 // License information included herein must be included in any script you give out or use.
15 // Licenses may also be included in the script or comments by the original author, in which case
16 // the authors license must be followed, and their licenses override any licenses outlined in this header.
17 //
18 // You cannot attach a license to any of these scripts to make any license more or less restrictive.
19 //
20 // All scripts by avatar Ferd Frederix, unless stated otherwise in the script, are licensed as Creative Commons By Attribution and Non-Commercial.
21 // Commercial use is NOT allowed - no resale of my scripts in any form.
22 // This means you cannot sell my scripts but you can give them away if they are FREE.
23 // Scripts by Ferd Frederix may be sold when included in a new object that actually uses these scripts. Putting my script in a prim and selling it on marketplace does not constitute a build.
24 // For any reuse or distribution, you must make clear to others the license terms of my works. This is done by leaving headers intact.
25 // See http://creativecommons.org/licenses/by-nc/3.0/ for more details and the actual license agreement.
26 // You must leave any author credits and any headers intact in any script you use or publish.
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 // If you don't like these restrictions and licenses, then don't use these scripts.
29 //////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////
30 // The Script
31 // The Script
32 //Feel Free To Mod The Following Values. ~Davy
33 // Rev 2 - fixed the rotations to be expressed in degrees - Ferd Frederix
34
35 //Animation Options
36 string animation_name = "avatar_sit_generic"; //The name of the animation to use (In Object Inv.)
37
38 //User/Owner Options
39 integer owner_only = FALSE; //TRUE or FALSE to only let the owner use the ball.
40
41 //Floating Text Options
42 string floating_text = ""; //What the floating text says in a string.
43 vector text_colour = <1,1,1>; //The color of the floating text in a vector.
44 float text_transparency = 1.0; //Transparency of the floating text. 0.0 to 1.0.
45
46 //Set Target/Sit Position Options
47 //vector sit_offset = <0,1.35,-.1>; //The offset from the ball while sitting.
48
49 vector sit_offset = <0,0.35,-.1>; //The offset from the ball while sitting.
50
51 vector sit_rotation = <90,180,90>; //The avatar rotation while sitting.
52
53 rotation rot;
54 default
55 {
56 on_rez(integer start_param)
57 {
59 }
61 {
62 rot = llEuler2Rot(sit_rotation * DEG_TO_RAD);
63 llSitTarget(sit_offset,rot);
64 llSetText(floating_text,text_colour,text_transparency);
65 }
66 changed(integer change)
67 {
69 {
70 if(owner_only == FALSE)
71 {
73 }
74 else if(owner_only == TRUE && llAvatarOnSitTarget() != llGetOwner())
75 {
77 llSay(0,"Vehicle Currently Set To Owner Only.");
78 }
79 }
81 {
82 llMessageLinked(LINK_ROOT,0,"unsit","");
84 }
85 }
87 {
89 {
91 {
92 //llStopAnimation("sit");
93 //llStartAnimation(animation_name);
95 }
96 else if(!perm)
97 {
99 }
100 else
101 {
102 //llStopAnimation(animation_name);
103 llMessageLinked(LINK_ROOT,0,"unsit","");
105 }
106 }
107 }
108 }

LandRover

Opensim Door script

Category: Vehicle
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 flag = FALSE;
3
4 default
5 {
7 {
8 flag = ~ flag;
9 if(flag)
10 llMessageLinked( LINK_ROOT,1,"LO","");
11 else
12 llMessageLinked( LINK_ROOT,1,"LC","");
13
14 }
15 }

LandRover

Opensim Door control

Category: Vehicle
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 flag = FALSE;
3
4 default
5 {
7 {
8 flag = ~ flag;
9 if(flag)
10 llMessageLinked( LINK_ROOT,1,"LO","");
11 else
12 llMessageLinked( LINK_ROOT,1,"LC","");
13
14 }
15 }

LandRover

Opensim Passnger seat

Category: Vehicle
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 // Author: Davy Maltz
3 // Clean and user-friendly Poseball script.
4
5 // Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=1350
6
7 // This program is free software; you can redistribute it and/or modify it.
8 // Additional Licenes may apply that prevent you from selling this code
9 // and these licenses may require you to publish any changes you make on request.
10 //
11 // There are literally thousands of hours of work in these scripts. Please respect
12 // the creators wishes and Copyright law and follow their license requirements.
13 //
14 // License information included herein must be included in any script you give out or use.
15 // Licenses may also be included in the script or comments by the original author, in which case
16 // the authors license must be followed, and their licenses override any licenses outlined in this header.
17 //
18 // You cannot attach a license to any of these scripts to make any license more or less restrictive.
19 //
20 // All scripts by avatar Ferd Frederix, unless stated otherwise in the script, are licensed as Creative Commons By Attribution and Non-Commercial.
21 // Commercial use is NOT allowed - no resale of my scripts in any form.
22 // This means you cannot sell my scripts but you can give them away if they are FREE.
23 // Scripts by Ferd Frederix may be sold when included in a new object that actually uses these scripts. Putting my script in a prim and selling it on marketplace does not constitute a build.
24 // For any reuse or distribution, you must make clear to others the license terms of my works. This is done by leaving headers intact.
25 // See http://creativecommons.org/licenses/by-nc/3.0/ for more details and the actual license agreement.
26 // You must leave any author credits and any headers intact in any script you use or publish.
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 // If you don't like these restrictions and licenses, then don't use these scripts.
29 //////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////
30 // The Script
31 // The Script
32 //Feel Free To Mod The Following Values. ~Davy
33 // Rev 2 - fixed the rotations to be expressed in degrees - Ferd Frederix
34
35 //Animation Options
36 string animation_name = "avatar_sit_generic"; //The name of the animation to use (In Object Inv.)
37
38 //User/Owner Options
39 integer owner_only = FALSE; //TRUE or FALSE to only let the owner use the ball.
40
41 //Floating Text Options
42 string floating_text = ""; //What the floating text says in a string.
43 vector text_colour = <1,1,1>; //The color of the floating text in a vector.
44 float text_transparency = 1.0; //Transparency of the floating text. 0.0 to 1.0.
45
46 //Set Target/Sit Position Options
47 vector sit_offset = <0,0.35,-.1>; //The offset from the ball while sitting.
48 vector sit_rotation = <90,180,90>; //The avatar rotation while sitting.
49
50 rotation rot;
51 default
52 {
53 on_rez(integer start_param)
54 {
56 }
58 {
59 rot = llEuler2Rot(sit_rotation * DEG_TO_RAD);
60 llSitTarget(sit_offset,rot);
61 llSetText(floating_text,text_colour,text_transparency);
62 }
63 changed(integer change)
64 {
66 {
67 if(owner_only == FALSE)
68 {
70 }
71 else if(owner_only == TRUE && llAvatarOnSitTarget() != llGetOwner())
72 {
74 llSay(0,"Vehicle Currently Set To Owner Only.");
75 }
76 }
78 {
80 }
81 }
83 {
85 {
86 if(perm)
87 {
88 //llStopAnimation("sit");
89 //llStartAnimation(animation_name);
90 llMessageLinked(LINK_ROOT,0,"passenger","");
91 }
92 else if(!perm)
93 {
95 }
96 else
97 {
98 //llStopAnimation(animation_name);
99
101 }
102 }
103 }
104 }

LandRover

Opensim vehicle control

Category: Vehicle
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 // http://opensimulator.org/wiki/Vehicles
3
4 // Very simple vehicle script, mod for OpenSimulator & ODE & VEHICLE code
5 // By Kitto Flora September 2009
6
7
8 // SOUND
9 string RUNNING = "run";
10 string IDLE = "idle";
11 string START = "start";
12 // link messages
13
14 // S = Stop wheels
15 // WC wheels centered
16 // F = Rotate forward
17 // R = Rotate backwards
18 // WR = Wheels right
19 // WL = Wheels left
20 // LO = Left door open
21 // LC = Left Door closed
22 // RO = Right door open
23 // RC = Right door closed
24 // RESET = all prims standard, doors clozed
25
26
27 integer Private = 1; // Change to 1 to prevent others riding.
28
29 integer tt;
30 key oldagent;
31 key agent;
32
33
34 float forward_power = 5; //Power used to go forward (1 to 30)
35 float reverse_power = -2; //Power ued to go reverse (-1 to -30)
36 float turning_ratio = 0.5; //How sharply the vehicle turns. Less is more sharply. (.1 to 10)
37
38
39
40 integer turncount;
41 string Wheeldir = "WC";
42 string NewWheeldir = "WC";
43 string Wheelrot = "S";
44 string NewWheelrot = "S";
45
46
47 integer scount;
48 integer Speed;
49 integer Run;
50
51
52
53
54 setVehicle()
55 {
56 //car
62 llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 1.0);
65 llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.1);
70
71 }
72 Init()
73 {
74 Sound(0);
76 vector here = llGetPos();
77
78
79 vector height = llGetScale();
80 float h = height.z;
81
82 float h1 = llGround(<0,0,0>) + h;
83
84
85 vector rotv = llRot2Euler(llGetRot());
86 rotation rot = llEuler2Rot(<0,0,rotv.z>);
87
88 llSetPos(<here.x, here.y,h1>);
89 llSetRot(rot);
90
92 llMessageLinked(LINK_ALL_OTHERS, 0, "S", NULL_KEY); // wheels stop
93 llMessageLinked(LINK_ALL_OTHERS, 0, "WC", NULL_KEY); // wheels straight
94 Run = 0;
95 }
96
97 SetMaterial()
98 {
100
101 }
102
103 Sound(integer n)
104 {
105 integer oldn;
106 if(n != oldn)
107 {
108 oldn = n;
109
110 //llOwnerSay("Sound:" + (string) n);
111
112 if(n == 3)
113 {
114 llPlaySound(START,1);
115 }
116 else if(n == 2)
117 {
118 llLoopSound(RUNNING,1);
119 }
120 else if(n == 1)
121 {
122 llLoopSound(IDLE,1);
123 }
124 else
125 {
127 }
128 }
129 }
130
131 default
132 {
134 {
135 Init();
137 }
138
139 on_rez(integer rn){
141 }
142
143
144
145 link_message(integer n, integer channel, string msg, key id)
146 {
147
148 // llOwnerSay(msg);
149 if(msg == "sit")
150 {
151 agent = id;
152 setVehicle();
153 SetMaterial();
154 llSleep(.4);
156 llSleep(.1);
157 Run = 1;
158 //Sensor is to make a crude Timer as TimerEvent fails on vehicles
159 llSensor("Non-Entity",NULL_KEY,PASSIVE,1.0, PI_BY_TWO);
160
162 Sound(3); // start
163 llSleep(2);
164 Sound(1); // idle
165 }
166 else if(msg == "unsit")
167 {
168 Init();
169 llSleep(.4);
172 Run = 0;
174 }
175
176 }
177
179 }
180
182 {
183 if(perm)
184 {
187 }
188 }
189
190 control(key id, integer level, integer edge)
191 {
192 integer reverse=1;
193 vector angular_motor;
194
195 //get current speed
196 vector vel = llGetVel();
197 float speed = llVecMag(vel);
198
199 //car controls
200 if(level & CONTROL_FWD)
201 {
204 reverse=1;
205 NewWheelrot = "F";
206 Speed = 20;
207 }
208 if(level & CONTROL_BACK)
209 {
212 reverse = -1;
213 NewWheelrot = "R";
214 Speed = 10;
215 }
216
218 {
219 angular_motor.z -= speed / turning_ratio * reverse;
220 NewWheeldir = "WR";
221 turncount = 10;
222 }
223
225 {
226 angular_motor.z += speed / turning_ratio * reverse;
227 NewWheeldir = "WL";
228 turncount = 10;
229 }
230
232 if(turncount > 0)
233 {
234 turncount--;
235 }
236 if(turncount == 1)
237 {
238 NewWheeldir = "WC";
239 }
240 if(Wheeldir != NewWheeldir){
241 Wheeldir = NewWheeldir;
243 }
244 if(Wheelrot != NewWheelrot){
245 Wheelrot = NewWheelrot;
247 }
248 } //end control
249
250 //Sensor is to make a crude Timer as TimerEvent fails on vehicles
251 no_sensor()
252 {
253 if(scount < 1000)
254 {
255 scount++;
256 }
257 else
258 {
259 scount = 0;
260 // This happens about once per second
261 if(Speed > 0) Speed--;
262
263 if(Speed > 2) Sound(2);
264
265 if(Speed == 1) {
269 Sound(1);
270 Wheelrot = "S";
271 }
272
273 }
274
275 if(Run == 1)
276 llSensor("Non-Entity",NULL_KEY,PASSIVE,1.0, PI_BY_TWO);
277 }
278
279 } //end default

LandRover

opensim wheel script

Category: Vehicle
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 default
3 {
5 {
7 llTargetOmega(<0,0,0>,0.0,1);
8 }
9
11 {
13 }
14
15 link_message(integer n, integer channel, string msg, key id)
16 {
17 //llOwnerSay(msg);
18 if(msg == "F")
19 {
20 llTargetOmega(<0,1,0>,2.0,1);
21 }
22 else if(msg == "R")
23 {
24 llTargetOmega(<0,-1,0>,2.0,1);
25 }
26 else if(msg == "S")
27 {
28 llTargetOmega(<0,0,0>,0.0,1);
29 }
30 }
31 }

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