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
Flying NPC's Opensim Waypoint Recorder and Display  

Opensim Waypoint Recorder and Display

Waypoints

Category: Flying NPC's
By : De Asanta
Created: 2015-03-17 Edited: 2015-03-17
Worlds: OpenSim

the Zip file

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

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