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
Building Tape_measure  

Tape_measure

Tape measure.lsl

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

the Zip file

Download all files for Tape_measure
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Tape_measure_1.lsl
1
2 integer count = 0;
3
4 vector MEASURING_TAPE= <1,.5,1>;
5 vector AVATAR_HEIGHT = <1.45, .05, 2.1>;
6 vector DOOR_SIZE_HEIGHT = <1.45, .05, 2.8>;
7 vector CEILING_HEIGHT = <1.45, .05, 3.8>;
8 vector HALLWAY_WIDTH = < 3.0, 0.5,1>;
9 vector ROOM_SIZE = < 10.0, 10.0, 0.5>;
10 vector SECOND_FLOOR_HEIGHT = <1.45, .05, 7.6>;
11
12 float groundpos;
13
14 list scalelist = [MEASURING_TAPE,AVATAR_HEIGHT,DOOR_SIZE_HEIGHT, CEILING_HEIGHT, HALLWAY_WIDTH, ROOM_SIZE, SECOND_FLOOR_HEIGHT];
15 list stringlist = ["Measuring Tape, click me","Average Avatar height, click again for door height", "Door height and width, click again for first floor height", "First floor ceiling height, click again for hallway width", "Hallway width, click again for room size","Room size, click again for second floor ceiling height","Second floor ceiling height, click again to reset"];
16 list soundlist =[ "tape out", "tape in"];
17 change(integer which)
18 {
19 // Update scale
20 vector newscale = llList2Vector(scalelist, which);
21 llSetScale(newscale);
22
23 // Update our position according to the scale so
24 // that we are just touching the ground.
25 vector newpos = llGetPos();
26 //float groundpos = llGround(<0.0,0.0,0.0>);
27 newpos.z = groundpos + .5 * newscale.z;
28 llSetPos(newpos);
29
30 // Update the texture and tell the user
31 string size_name = llList2String(stringlist, which);
32 llPlaySound("tape out", 0.5);
33 llWhisper(0, size_name );
34 llSetTexture(size_name , 1);
35 llSetTexture(size_name , 3);
36 llSetTexture(size_name , 0);
37
38 }
39
40 init()
41 {
42 count = 0;
43 vector pos = llGetPos();
44 vector scale = llGetScale();
45 groundpos = pos.z - scale.z/2.0;
46 change( count );
47 }
48
49 default
50 {
52 {
53 init();
54 }
55
56 on_rez( integer start_param )
57 {
58 init();
59 }
60
61 touch_start(integer total_number)
62 {
63 count++;
64 if( count >= llGetListLength( scalelist ) )
65 {
66 count = 0;
67 }
68 change(count);
69 }
70 }
71 // END //

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