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
Train Train_Station_Engine_Rezzer  

Train_Station_Engine_Rezzer

Train_Station_Engine_Rezzer

Category: Train
By : Barney Boomslang
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Train_Station_Engine_Rezzer
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Train_Station_Engine_Rezzer_1.lsl
1 // copyright 2007 Barney Boomslang
2 //
3 // this is under the CC GNU GPL
4 // http://creativecommons.org/licenses/GPL/2.0/
5 //
6 // prim-based builds that just use this code are not seen as derivative
7 // work and so are free to be under whatever license pleases the builder.
8 //
9 // Still this script will be under GPL, so if you build commercial works
10 // based on this script, keep this script open!
11 //
12 // This is the rezzing script that rezzes a car behind the engine or
13 // another car. It needs adaption for offset, so the height is corrected,
14 // and for the distance it should have to the part that rezzes it.
15
16 // direct offset for rezzing
17 vector offset = <0,0,0.531>;
18
19 // distance in meter from the rezzing part
20 float distance = 2.0;
21
22 // current engine to rez
23 integer current = 0;
24
25 rezit()
26 {
27 vector dir = llRot2Fwd(llGetRot());
28 vector pos = llGetPos()+offset+dir*distance;
30 {
31 current = 0;
32 }
34 current++;
35 }
36
37 default
38 {
40 {
41 llListen(474747, "", NULL_KEY, "");
42 }
43
44 listen(integer channel, string name, key id, string str)
45 {
47 {
48 if(str == "start train")
49 {
50 rezit();
51 }
52 }
53 }
54
55 touch_start(integer num_detected)
56 {
58 {
59 rezit();
60 }
61 }
62
63 object_rez(key id)
64 {
66 }
67 }

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