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
Recorder Waypoint Recorder and Display  

Waypoint Recorder and Display

Records, Store, Draw, and Return Waypoints that can be used for moving objects or NPCs.

Category: Recorder
By : De Asanta
Created: 2016-01-23 Edited: 2016-01-23
Worlds: OpenSim

the Zip file

Download all files for Waypoint Recorder and Display
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Waypoint Script.lsl
1 // A basic waypoint recorder for scripters to assist them in recording in game waypoints that can can be used in other scripts. Feel free to use / modify to suit your needs.
2 //From https://sites.google.com/site/dsopensim/inworldtoolkit/waypoint-recorder
3
4
5
6 list wp;
7 integer screen;
8
9 AddWaypoint(vector a)
10 {
11 wp=wp+a;
12 }
13
14 ClearWaypoints()
15 {
16 wp=[];
17 }
18
19 DrawWaypoints()
20 {
21 string CommandList = "";
22 integer a;
23 vector b;
24
25 CommandList = osSetPenColor(CommandList, "White");
26 CommandList = osSetPenSize(CommandList, 2);
27
28 for(a=0;a<llGetListLength(wp);a++)
29 {
30 b=llList2Vector(wp,a);
31 CommandList = osMovePen( CommandList, (integer)b.x, (integer)b.y );
32 CommandList = osDrawText( CommandList, (string)a );
33 if(a>0) { b=llList2Vector(wp,a-1); }
34 CommandList = osDrawLine(CommandList,(integer)b.x, (integer)b.y);
35
36 }
37
38 osSetDynamicTextureDataBlendFace( "", "vector", CommandList, "bgcolour:Black,width:256,height:256", 0, 2 , 0, 0, 0);
39 }
40
41 SayWaypoints()
42 {
43 string text="";
44 string CommandList = "";
45 integer a;
46 vector b;
47
48 for(a=0;a<llGetListLength(wp);a++)
49 {
50 b=llList2Vector(wp,a);
51 text=text+(string)b;
52 if(a<llGetListLength(wp)-1) { text=text+","; }
53 }
54 llSay(0,"list wp=["+text+"];");
55 }
56
57 RemoveWaypoint()
58 {
59 integer a;
60 list b;
61
62 for(a=0;a<llGetListLength(wp);a++)
63 {
64 b=b+llList2Vector(wp,a);
65 }
66 wp=b;
67 }
68
69 UpdateScreen()
70 {
71 string CommandList = "";
72 CommandList = osSetPenColor(CommandList, "Black");
73 CommandList = osMovePen( CommandList, 3,3 );
74 CommandList = osDrawRectangle( CommandList, 249, 249 );
75 CommandList = osSetFontSize(CommandList, 8);
76 CommandList = osMovePen( CommandList, 8,8 );
77
78 if(screen==0)
79 {
80 string text = "say any of the following:\n/99 help - to show this screen\n/99 1 - to clear all waypoints\n/99 2 - to add a waypoint\n/99 3 - to remove last waypoint\n/99 4 - Draw Waypoints\n/99 5 - Say Waypoints";
81 CommandList = osDrawText( CommandList, text );
82 }
83
84 osSetDynamicTextureDataBlendFace( "", "vector", CommandList, "bgcolour:White,width:256,height:256", 0, 2 , 0, 0, 0);
85 }
86
87
88 default
89 {
91 {
92 screen=0;
93 UpdateScreen();
94 ClearWaypoints();
96 llListen(99,"","","");
97 }
98
99 listen(integer ch, string name, key id, string message)
100 {
101 if(message=="1")
102 {
103 ClearWaypoints();
104 }
105 if(message=="2")
106 {
107 AddWaypoint(llGetPos());
108 }
109 if(message=="3")
110 {
111 ClearWaypoints();
112 }
113 if(message=="4")
114 {
115 DrawWaypoints();
116 }
117 if(message=="5")
118 {
119 SayWaypoints();
120 }
121 if(message=="help")
122 {
123 screen=0;
124 UpdateScreen();
125 }
126 }
127
129 {
130 if(perm)
131 {
132 llStartAnimation("hold");
133 }
134 }
135
136 dataserver(key id, string message)
137 {
138 //processReceived( id, message);
139 }
140
141 on_rez(integer start_param)
142 {
144 }
145
146 changed(integer change)
147 {
148 if(change & CHANGED_OWNER)
149 {
151 }
152 if(change & CHANGED_REGION)
153 {
155 }
156 if(change & CHANGED_REGION_START)
157 {
159 }
160 }
161
162 attach(key id)
163 {
164 if(id) // is a valid key and not NULL_KEY
165 {
167 }
168 }
169 }

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