1 /***********************************************
3 * FrikBot Waypoint Editor *
4 * "The 'wtf is this doing in my mod' code" *
6 ***********************************************/
10 This program is in the Public Domain. My crack legal
11 team would like to add:
13 RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS"
14 AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE
15 ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR
16 FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN
17 NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY
18 GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL,
19 EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC"
20 SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
21 DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES.
23 You accept this software on the condition that you
24 indemnify and hold harmless Ryan "FrikaC" Smith from
25 any and all liability or damages to third parties,
26 including attorney fees, court costs, and other
27 related costs and expenses, arising out of your use
28 of this software irrespective of the cause of said
31 The export from the United States or the subsequent
32 reexport of this software is subject to compliance
33 with United States export control and munitions
34 control restrictions. You agree that in the event you
35 seek to export this software, you assume full
36 responsibility for obtaining all necessary export
37 licenses and approvals and for assuring compliance
38 with applicable reexport restrictions.
40 Any reproduction of this software must contain
41 this notice in its entirety.
45 float saved1, saved2, saved3, scratch1, scratch2, scratch3, scratch4;
46 float bytecounter, filecount;
49 float MENU_WAYPOINTS = 2;
52 float MENU_FLAGS2 = 5;
54 float MENU_WAYLIST = 7;
58 // 11 = create link X2
59 // 12 = delete link x2
60 // 13 = confirmation of delete all
61 // 14 = Teleport to way
62 // 15 = confirmation of delete point
64 void() BSPDumpWaypoints;
65 void() QCDumpWaypoints;
68 // source for the menu strings...
71 [1] >>Waypoint Management\n
72 [2] >>Link Management \n
73 [3] >>AI Flag Management \n
74 [4] >>Bot Management \n
75 [5] >>Waylist Management \n
78 [8] [#] Hold Select \n
79 [9] Teleport to Way # \n
82 // missing from main is show way info
83 // iffy on the teleport to way thing being on main...seems like either a bot or way list thing
85 -- Waypoint Management --\n
87 [2] Delete Waypoint \n
89 [4] Make Way + Link \n
90 [5] Make Way + Link X2 \n
91 [6] Make Way + Telelink \n
92 [7] Show waypoint info \n
93 [8] >>Link Management \n
94 [9] >>AI Flag Management \n
97 -- Link Management --\n
98 [1] Unlink Waypoint \n
100 [3] Create Telelink \n
102 [5] Create Link X2 \n
103 [6] Delete Link X2 \n
104 [7] >Make Waypoint \n
105 [8] >>Waypoint Management\n
106 [9] >>AI Flag Management \n
111 -- AI Flag Management --\n
114 [3] [#] Surface for air \n
115 [4] [#] Blind mode \n
118 [7] [#] Super Jump \n
120 [9] >>AI Flags page 2 \n
123 -- AI Flags pg. 2--\n
125 [2] [#] Wait for plat \n
126 [3] [#] Ride train \n
127 [4] [#] Door flag no open\n
130 [7] [#] Trace Test \n
132 [9] >>AI Flag Management \n
135 -- Bot Management --\n
136 [1] Add a Test Bot \n
137 [2] Order Test Bot here \n
138 [3] Remove Test Bot \n
140 [5] Teleport Bot here \n
141 [6] Teleport to Way # \n
147 -- Waylist Management --\n
148 [1] Delete ALL Waypoints \n
149 [2] Dump Waypoints \n
150 [3] Check For Errors \n
151 [4] Save Waypoints \n
152 [5] [#] Dynamic Mode \n
153 [6] [#] Dynamic Link \n
154 [7] [#] WAY output \n
156 [9] [#] BSP ents output \n
161 void() bot_menu_display =
164 local string s1, s2, s3, s4, s5, s6, s7, h;
168 if (self.impulse > 0 && self.impulse < 11 && self.b_menu)
170 if (self.b_menu == MENU_MAIN)
172 if (self.impulse == 1)
174 self.b_menu = MENU_WAYPOINTS;
175 self.b_menu_time = time;
177 else if (self.impulse == 2)
179 self.b_menu = MENU_LINKS;
180 self.b_menu_time = time;
182 else if (self.impulse == 3)
184 self.b_menu = MENU_FLAGS;
185 self.b_menu_time = time;
187 else if (self.impulse == 4)
189 self.b_menu = MENU_BOTS;
190 self.b_menu_time = time;
192 else if (self.impulse == 5)
194 self.b_menu = MENU_WAYLIST;
195 self.b_menu_time = time;
197 else if (self.impulse == 6)
199 if (self.movetype == MOVETYPE_NOCLIP)
200 self.movetype = MOVETYPE_WALK;
202 self.movetype = MOVETYPE_NOCLIP;
203 self.b_menu_time = time;
206 else if (self.impulse == 7)
208 if (self.flags & FL_GODMODE)
209 self.flags = self.flags - FL_GODMODE;
211 self.flags = self.flags | FL_GODMODE;
212 self.b_menu_time = time;
215 else if (self.impulse == 8)
217 if (self.b_aiflags & AI_HOLD_SELECT)
218 self.b_aiflags = self.b_aiflags - AI_HOLD_SELECT;
220 self.b_aiflags = self.b_aiflags | AI_HOLD_SELECT;
221 self.b_menu_time = time;
223 else if (self.impulse == 9)
226 self.b_menu_time = time;
228 else if (self.impulse == 10)
231 else if (self.b_menu == MENU_WAYPOINTS)
233 if (self.impulse == 1)
235 if (self.current_way)
236 setorigin(self.current_way, self.origin + self.view_ofs);
238 else if (self.impulse == 2)
240 if (self.current_way)
243 self.b_menu_time = time;
244 self.last_way = self.current_way;
247 else if (self.impulse == 3)
249 make_waypoint(self.origin + self.view_ofs);
251 else if (self.impulse == 4)
253 t = make_waypoint(self.origin + self.view_ofs);
254 if (!LinkWays(self.current_way, t))
255 sprint(self, "Unable to link them\n");
257 else if (self.impulse == 5)
259 t = make_waypoint(self.origin + self.view_ofs);
260 if (!LinkWays(self.current_way, t))
261 sprint(self, "Unable to link old to new\n");
262 LinkWays(t, self.current_way);
264 else if (self.impulse == 6)
266 t = make_waypoint(self.origin + self.view_ofs);
267 if (!TeleLinkWays(self.current_way, t))
268 sprint(self, "Unable to link them\n");
270 else if (self.impulse == 7)
272 if (self.current_way)
274 sprint(self, "\nwaypoint info for waypoint #");
275 h = ftos(self.current_way.count);
277 sprint(self, "\nAI Flag value: ");
278 h = ftos(self.current_way.b_aiflags);
281 if (self.current_way.target1)
283 h = ftos(self.current_way.target1.count);
284 if (self.current_way.b_aiflags & AI_TELELINK_1)
285 sprint(self, "\nTelelink1 to:");
287 sprint(self, "\nLink1 to:");
290 if (self.current_way.target2)
292 h = ftos(self.current_way.target2.count);
293 if (self.current_way.b_aiflags & AI_TELELINK_2)
294 sprint(self, "\nTelelink2 to:");
296 sprint(self, "\nLink2 to:");
299 if (self.current_way.target3)
301 h = ftos(self.current_way.target3.count);
302 if (self.current_way.b_aiflags & AI_TELELINK_3)
303 sprint(self, "\nTelelink3 to:");
305 sprint(self, "\nLink3 to:");
308 if (self.current_way.target4)
310 h = ftos(self.current_way.target4.count);
311 if (self.current_way.b_aiflags & AI_TELELINK_4)
312 sprint(self, "\nTelelink4 to:");
314 sprint(self, "\nLink4 to:");
317 sprint(self, "\n\n");
321 if (self.impulse == 8)
323 self.b_menu = MENU_LINKS;
324 self.b_menu_time = time;
326 else if (self.impulse == 9)
328 self.b_menu = MENU_FLAGS;
329 self.b_menu_time = time;
331 else if (self.impulse == 10)
333 self.b_menu = MENU_MAIN;
334 self.b_menu_time = time;
337 else if (self.b_menu == MENU_LINKS)
339 if (self.impulse == 1)
341 if (self.current_way)
342 self.current_way.target1 = self.current_way.target2 = self.current_way.target3 = self.current_way.target4 = world;
344 else if (self.impulse == 2)
347 self.b_menu_time = time;
348 self.last_way = self.current_way;
350 else if (self.impulse == 3)
353 self.b_menu_time = time;
354 self.last_way = self.current_way;
356 else if (self.impulse == 4)
359 self.b_menu_time = time;
360 self.last_way = self.current_way;
362 else if (self.impulse == 5)
365 self.b_menu_time = time;
366 self.last_way = self.current_way;
368 else if (self.impulse == 6)
371 self.b_menu_time = time;
372 self.last_way = self.current_way;
374 else if (self.impulse == 7)
375 make_waypoint(self.origin + self.view_ofs);
376 else if (self.impulse == 8)
378 self.b_menu = MENU_WAYPOINTS;
379 self.b_menu_time = time;
381 else if (self.impulse == 9)
383 self.b_menu = MENU_FLAGS;
384 self.b_menu_time = time;
386 else if (self.impulse == 10)
388 self.b_menu = MENU_MAIN;
389 self.b_menu_time = time;
392 else if (self.b_menu == MENU_FLAGS)
395 if (self.current_way)
397 if (self.impulse == 1)
399 if (self.current_way.b_aiflags & AI_DOORFLAG)
400 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOORFLAG);
402 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOORFLAG;
404 self.b_menu_time = time;
406 else if (self.impulse == 2)
408 if (self.current_way.b_aiflags & AI_PRECISION)
409 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PRECISION);
411 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION;
412 self.b_menu_time = time;
414 else if (self.impulse == 3)
416 if (self.current_way.b_aiflags & AI_SURFACE)
417 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SURFACE);
419 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SURFACE;
420 self.b_menu_time = time;
422 else if (self.impulse == 4)
424 if (self.current_way.b_aiflags & AI_BLIND)
425 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_BLIND);
427 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND;
428 self.b_menu_time = time;
430 else if (self.impulse == 5)
432 if (self.current_way.b_aiflags & AI_JUMP)
433 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_JUMP);
435 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_JUMP;
436 self.b_menu_time = time;
438 else if (self.impulse == 6)
440 if (self.current_way.b_aiflags & AI_DIRECTIONAL)
441 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIRECTIONAL);
443 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIRECTIONAL;
444 self.b_menu_time = time;
446 else if (self.impulse == 7)
448 if (self.current_way.b_aiflags & AI_SUPER_JUMP)
449 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SUPER_JUMP);
451 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SUPER_JUMP;
452 self.b_menu_time = time;
455 if (self.impulse == 9)
457 self.b_menu = MENU_FLAGS2;
458 self.b_menu_time = time;
460 else if (self.impulse == 10)
462 self.b_menu = MENU_MAIN;
463 self.b_menu_time = time;
466 else if (self.b_menu == MENU_FLAGS2)
469 if (self.current_way)
471 if (self.impulse == 1)
473 if (self.current_way.b_aiflags & AI_DIFFICULT)
474 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIFFICULT);
476 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIFFICULT; self.b_menu_time = time;
478 else if (self.impulse == 2)
480 if (self.current_way.b_aiflags & AI_PLAT_BOTTOM)
481 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PLAT_BOTTOM);
483 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PLAT_BOTTOM;
484 self.b_menu_time = time;
486 else if (self.impulse == 3)
488 if (self.current_way.b_aiflags & AI_RIDE_TRAIN)
489 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_RIDE_TRAIN);
491 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_RIDE_TRAIN;
492 self.b_menu_time = time;
494 else if (self.impulse == 4)
496 if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN)
497 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOOR_NO_OPEN);
499 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOOR_NO_OPEN;
500 self.b_menu_time = time;
502 else if (self.impulse == 5)
504 if (self.current_way.b_aiflags & AI_AMBUSH)
505 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_AMBUSH);
507 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_AMBUSH;
508 self.b_menu_time = time;
510 else if (self.impulse == 6)
512 if (self.current_way.b_aiflags & AI_SNIPER)
513 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SNIPER);
515 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SNIPER;
516 self.b_menu_time = time;
518 else if (self.impulse == 7)
520 if (self.current_way.b_aiflags & AI_TRACE_TEST)
521 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_TRACE_TEST);
523 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_TRACE_TEST;
524 self.b_menu_time = time;
528 if (self.impulse == 9)
530 self.b_menu = MENU_FLAGS;
531 self.b_menu_time = time;
533 else if (self.impulse == 10)
535 self.b_menu = MENU_MAIN;
536 self.b_menu_time = time;
540 else if (self.b_menu == MENU_BOTS)
542 if (self.impulse == 1)
547 else if (self.impulse == 2)
556 bot_get_path(b_temp3, TRUE);
564 else if (self.impulse == 3)
569 else if (self.impulse == 4)
577 self.target1 = self.target2 = self.target3 = self.target4 = world;
584 else if (self.impulse == 5)
586 if (self.current_way)
594 setorigin(self, b_temp1.current_way.origin);
601 sprint(self, "select a waypoint first\n");
603 else if (self.impulse == 6)
606 self.b_menu_time = time;
608 else if (self.impulse == 10)
610 self.b_menu = MENU_MAIN;
611 self.b_menu_time = time;
614 else if (self.b_menu == MENU_WAYLIST)
616 if (self.impulse == 1)
619 self.b_menu_time = time;
621 else if (self.impulse == 2)
625 else if (dump_mode == 1)
627 else if (dump_mode == 2)
630 else if (self.impulse == 3)
635 if ((t.target1 == world) && (t.target2 == world) && (t.target3 == world) && (t.target4 == world))
637 sprint(self, "Waypoint #");
640 sprint(self, " has no outbound links\n");
642 if ((t.target1 == t) || (t.target2 == t) || (t.target3 == t) || (t.target4 == t))
644 sprint(self, "Waypoint #");
647 sprint(self, " links to itself (??)\n");
651 sprint(self, "Error check complete\n");
653 else if (self.impulse == 4)
655 sprint(self, "not in this version (FBX 0.10.0)\n");
657 else if (self.impulse == 5)
659 if (waypoint_mode == WM_EDITOR_DYNAMIC)
660 waypoint_mode = WM_EDITOR;
662 waypoint_mode = WM_EDITOR_DYNAMIC;
663 self.b_menu_time = time;
666 else if (self.impulse == 6)
668 if (waypoint_mode == WM_EDITOR_DYNLINK)
669 waypoint_mode = WM_EDITOR;
671 waypoint_mode = WM_EDITOR_DYNLINK;
672 self.b_menu_time = time;
674 else if (self.impulse == 7)
677 self.b_menu_time = time;
679 else if (self.impulse == 8)
682 self.b_menu_time = time;
684 else if (self.impulse == 9)
687 self.b_menu_time = time;
689 else if (self.impulse == 10)
691 self.b_menu = MENU_MAIN;
692 self.b_menu_time = time;
695 else if (self.b_menu == 8)
697 if (self.impulse == 1)
699 if (self.current_way)
701 if (!LinkWays(self.last_way, self.current_way))
702 sprint(self, "Unable to link them\n");
703 self.b_menu = MENU_LINKS;
704 self.b_menu_time = time;
707 else if (self.impulse == 2)
709 self.b_menu = MENU_LINKS;
710 self.b_menu_time = time;
713 else if (self.b_menu == 9)
715 if (self.impulse == 1)
717 if (self.current_way)
719 if (!TeleLinkWays(self.last_way, self.current_way))
720 sprint(self, "Unable to link them\n");
721 self.b_menu = MENU_LINKS;
722 self.b_menu_time = time;
725 else if (self.impulse == 2)
727 self.b_menu = MENU_LINKS;
728 self.b_menu_time = time;
731 else if (self.b_menu == 10)
733 if (self.impulse == 1)
735 if (self.current_way)
737 UnlinkWays(self.last_way, self.current_way);
738 self.b_menu = MENU_LINKS;
739 self.b_menu_time = time;
742 else if (self.impulse == 2)
744 self.b_menu = MENU_LINKS;
745 self.b_menu_time = time;
748 else if (self.b_menu == 11)
750 if (self.impulse == 1)
752 if (self.current_way)
754 if (!LinkWays(self.last_way, self.current_way))
755 sprint(self, "Unable to link 1 to 2\n");
756 if (!LinkWays(self.current_way, self.last_way))
757 sprint(self, "Unable to link 2 to 1\n");
758 self.b_menu = MENU_LINKS;
759 self.b_menu_time = time;
762 else if (self.impulse == 2)
764 self.b_menu = MENU_LINKS;
765 self.b_menu_time = time;
768 else if (self.b_menu == 12)
770 if (self.impulse == 1)
772 if (self.current_way)
774 UnlinkWays(self.last_way, self.current_way);
775 UnlinkWays(self.current_way, self.last_way);
776 self.b_menu = MENU_LINKS;
777 self.b_menu_time = time;
780 else if (self.impulse == 2)
782 self.b_menu = MENU_LINKS;
783 self.b_menu_time = time;
786 else if (self.b_menu == 13)
788 if (self.impulse == 1)
791 self.b_menu = MENU_WAYLIST;
792 self.b_menu_time = time;
794 else if (self.impulse == 2)
796 self.b_menu = MENU_WAYLIST;
797 self.b_menu_time = time;
800 else if (self.b_menu == 14)
802 if (self.impulse == 10)
804 self.b_menu_value = self.b_menu_value * 10 + self.impulse;
805 self.b_menu_time = 0;
807 else if (self.b_menu == 15)
809 if (self.impulse == 1)
811 delete_waypoint(self.last_way);
812 self.b_menu = MENU_WAYPOINTS;
813 self.b_menu_time = time;
815 else if (self.impulse == 2)
817 self.b_menu = MENU_WAYPOINTS;
818 self.b_menu_time = time;
824 if (self.b_menu_time < time)
826 if (self.b_menu == MENU_MAIN)
828 s1 = "-- Main Menu --\n[1] >>Waypoint Management\n[2] >>Link Management \n[3] >>AI Flag Management \n[4] >>Bot Management \n[5] >>Waylist Management \n";
829 if (self.movetype == MOVETYPE_NOCLIP)
830 s2 = "[6] [#] Noclip \n";
832 s2 = "[6] [ ] Noclip \n";
834 if (self.flags & FL_GODMODE)
835 s3 = "[7] [#] Godmode \n";
837 s3 = "[7] [ ] Godmode \n";
838 if (self.b_aiflags & AI_HOLD_SELECT)
839 s4 = "[8] [#] Hold Select \n";
841 s4 = "[8] [ ] Hold Select \n";
842 s5 = "[9] Teleport to Way # \n[0] Close Menu \n";
844 else if (self.b_menu == MENU_WAYPOINTS)
846 s1 = "-- Waypoint Management --\n[1] Move Waypoint \n[2] Delete Waypoint \n[3] Make Waypoint \n[4] Make Way + Link \n[5] Make Way + Link X2 \n[6] Make Way + Telelink \n[7] Show waypoint info \n[8] >>Link Management \n[9] >>AI Flag Management \n[0] >>Main Menu \n";
848 else if (self.b_menu == MENU_LINKS)
850 s1 = "-- Link Management --\n[1] Unlink Waypoint \n[2] Create Link \n[3] Create Telelink \n[4] Delete Link \n[5] Create Link X2 \n[6] Delete Link X2 \n[7] >Make Waypoint \n[8] >>Waypoint Management\n[9] >>AI Flag Management \n[0] >>Main Menu \n";
852 else if (self.b_menu == MENU_FLAGS)
854 if (self.current_way.b_aiflags & AI_DOORFLAG)
855 s1 = "-- AI Flag Management --\n[1] [#] Door Flag \n";
857 s1 = "-- AI Flag Management --\n[1] [ ] Door Flag \n";
859 if (self.current_way.b_aiflags & AI_PRECISION)
860 s2 = "[2] [#] Precision \n";
862 s2 = "[2] [ ] Precision \n";
864 if (self.current_way.b_aiflags & AI_SURFACE)
865 s3 = "[3] [#] Surface for air \n";
867 s3 = "[3] [ ] Surface for air \n";
869 if (self.current_way.b_aiflags & AI_BLIND)
870 s4 = "[4] [#] Blind mode \n";
872 s4 = "[4] [ ] Blind mode \n";
874 if (self.current_way.b_aiflags & AI_JUMP)
875 s5 = "[5] [#] Jump \n";
877 s5 = "[5] [ ] Jump \n";
879 if (self.current_way.b_aiflags & AI_DIRECTIONAL)
880 s6 = "[6] [#] Directional \n";
882 s6 = "[6] [ ] Directional \n";
884 if (self.current_way.b_aiflags & AI_SUPER_JUMP)
885 s7 = "[7] [#] Super Jump \n\n[9] >>AI Flags page 2 \n[0] >>Main Menu \n";
887 s7 = "[7] [ ] Super Jump \n\n[9] >>AI Flags page 2 \n[0] >>Main Menu \n";
889 else if (self.b_menu == MENU_FLAGS2)
891 if (self.current_way.b_aiflags & AI_DIFFICULT)
892 s1 = "-- AI Flags pg. 2--\n[1] [#] Difficult \n";
894 s1 = "-- AI Flags pg. 2--\n[1] [ ] Difficult \n";
896 if (self.current_way.b_aiflags & AI_PLAT_BOTTOM)
897 s2 = "[2] [#] Wait for plat \n";
899 s2 = "[2] [ ] Wait for plat \n";
901 if (self.current_way.b_aiflags & AI_RIDE_TRAIN)
902 s3 = "[3] [#] Ride train \n";
904 s3 = "[3] [ ] Ride train \n";
906 if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN)
907 s4 = "[4] [#] Door flag no open\n";
909 s4 = "[4] [ ] Door flag no open\n";
911 if (self.current_way.b_aiflags & AI_AMBUSH)
912 s5 = "[5] [#] Ambush \n";
914 s5 = "[5] [ ] Ambush \n";
916 if (self.current_way.b_aiflags & AI_SNIPER)
917 s6 = "[6] [#] Snipe \n";
919 s6 = "[6] [ ] Snipe \n";
921 if (self.current_way.b_aiflags & AI_TRACE_TEST)
922 s7 = "[7] [#] Trace Test \n\n[9] >>AI Flag Management \n[0] >>Main Menu \n";
924 s7 = "[7] [ ] Trace Test \n\n[9] >>AI Flag Management \n[0] >>Main Menu \n";
927 else if (self.b_menu == MENU_BOTS)
929 s1 = "-- Bot Management --\n[1] Add a Test Bot \n[2] Order Test Bot here \n[3] Remove Test Bot \n[4] Stop Test Bot \n[5] Teleport Bot here \n[6] Teleport to Way # \n\n\n\n[0] >>Main Menu \n";
931 else if (self.b_menu == MENU_WAYLIST)
933 s1 = "-- Waylist Management --\n[1] Delete ALL Waypoints \n[2] Dump Waypoints \n[3] Check For Errors \n[4] Save Waypoints \n";
935 if (waypoint_mode == WM_EDITOR_DYNAMIC)
936 s2 = "[5] [#] Dynamic Mode \n[6] [#] Dynamic Link \n";
937 else if (waypoint_mode == WM_EDITOR_DYNLINK)
938 s2 = "[5] [ ] Dynamic Mode \n[6] [#] Dynamic Link \n";
940 s2 = "[5] [ ] Dynamic Mode \n[6] [ ] Dynamic Link \n";
942 s3 = "[7] [#] WAY output \n[8] [ ] QC output \n[9] [ ] BSP ents output \n[0] Main Menu \n";
943 else if (dump_mode == 1)
944 s3 = "[7] [ ] WAY output \n[8] [#] QC output \n[9] [ ] BSP ents output \n[0] Main Menu \n";
945 else if (dump_mode == 2)
946 s3 = "[7] [ ] WAY output \n[8] [ ] QC output \n[9] [#] BSP ents output \n[0] Main Menu \n";
949 else if (self.b_menu == 8)
950 s1 = "-- Link Ways --\n\nSelect another way and push 1\nor press 2 to cancel";
951 else if (self.b_menu == 9)
952 s1 = "-- Telelink Ways --\n\nSelect another way and push 1\nor press 2 to cancel";
953 else if (self.b_menu == 10)
954 s1 = "-- Delete Link --\n\nSelect another way and push 1\nor press 2 to cancel";
955 else if (self.b_menu == 11)
956 s1 = "-- Create Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel";
957 else if (self.b_menu == 12)
958 s1 = "-- Delete Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel";
959 else if (self.b_menu == 13)
960 s1 = "-- Delete ALL Ways --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel";
961 else if (self.b_menu == 14)
963 s1 = "-- Teleport to Way # --\n\nEnter way number and press\nimpulse 104 to warp\n\nWaypoint #";
964 s2 = ftos(self.b_menu_value);
967 else if (self.b_menu == 15)
968 s1 = "-- Delete Waypoint --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel";
969 frik_big_centerprint(self, s1, s2, s3, s4, s5, s6, s7);
970 self.b_menu_time = time + 1.25;
976 void() bot_way_edit =
980 if (self.b_menu_value)
982 if (self.b_menu == 14)
984 t = WaypointForNum(self.b_menu_value);
986 setorigin(self, t.origin - self.view_ofs);
988 sprint(self, "No waypoint with that number\n");
990 self.b_menu = MENU_MAIN;
991 self.b_menu_time = time;
993 self.b_menu_value = 0;
996 if (waypoint_mode < WM_EDITOR)
998 self.b_menu = MENU_MAIN;
999 waypoint_mode = WM_EDITOR;
1000 self.b_menu_time = 0;
1001 cvar_set("saved2", "0");
1002 WriteByte(MSG_ALL, 8);
1003 WriteByte(MSG_ALL, 1);
1004 WriteString(MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS -CONDEBUG BEFORE PROCEEDING\n");
1005 localcmd("cmdline\n");
1009 //setmodel(t, "progs/s_bubble.spr"); // show the waypoints
1012 //if (self.current_way)
1013 // setmodel(self.current_way, "progs/s_light.spr");
1017 saved2 = cvar("saved2");
1021 self.b_menu = floor(saved2/16);
1022 self.impulse = saved2 & 15;
1025 cvar_set("saved2", "0");
1029 waypoint_mode = WM_LOADED;
1033 setmodel(t, string_null); // hide the waypoints
1041 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1043 Waypoint Saving to file.
1045 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1049 // bytecount is really iffy
1050 // since there is no true way to determine the length of an ftos
1051 // it uses an approximate of 5
1052 // various other things are guesses, but I don't cut it at the absolute
1053 // max so it should be okay
1055 void() PrintWaypoint =
1058 local float needcolon;
1061 if (self.enemy == world)
1064 t = self.enemy._next;
1065 if (bytecounter >= 8000)
1067 bprint("exec maps/");
1070 h = ftos(filecount);
1072 filecount = filecount + 1;
1073 bprint("\n// **** break here **** \n");
1080 bprint("saved4 3\n// end waypoint dump\n");
1081 bytecounter = bytecounter + 27;
1084 if ((t.origin_x != saved1) || (t.count == 1))
1087 h = ftos(t.origin_x);
1089 saved1 = t.origin_x;
1090 bytecounter = bytecounter + 12;
1093 if ((t.origin_y != saved2) || (t.count == 1))
1098 bytecounter = bytecounter + 2;
1103 h = ftos(t.origin_y);
1105 bytecounter = bytecounter + 12;
1106 saved2 = t.origin_y;
1108 if ((t.origin_z != saved3) || (t.count == 1))
1113 bytecounter = bytecounter + 2;
1118 h = ftos(t.origin_z);
1120 bytecounter = bytecounter + 12;
1121 saved3 = t.origin_z;
1123 bytecounter = bytecounter + 1;
1126 if ((scratch1 != t.target1.count) || t.count == 1)
1129 bprint("scratch1 ");
1130 bytecounter = bytecounter + 14;
1131 h = ftos(t.target1.count);
1133 scratch1 = t.target1.count;
1135 if ((scratch2 != t.target2.count) || t.count == 1)
1140 bytecounter = bytecounter + 2;
1144 bprint("scratch2 ");
1145 bytecounter = bytecounter + 14;
1146 h = ftos(t.target2.count);
1148 scratch2 = t.target2.count;
1150 if ((scratch3 != t.target3.count) || t.count == 1)
1155 bytecounter = bytecounter + 2;
1159 bprint("scratch3 ");
1160 bytecounter = bytecounter + 14;
1161 h = ftos(t.target3.count);
1163 scratch3 = t.target3.count;
1165 if ((scratch4 != t.target4.count) || t.count == 1)
1170 bytecounter = bytecounter + 2;
1174 bprint("scratch4 ");
1175 bytecounter = bytecounter + 14;
1176 h = ftos(t.target4.count);
1178 scratch4 = t.target4.count;
1180 bprint("\nsaved4 ");
1181 bytecounter = bytecounter + 19;
1183 h = ftos(t.b_aiflags * 4 + 2);
1185 h = ftos(t.b_aiflags * 4 + 1);
1187 bprint ("; wait\n");
1188 self.nextthink = time + 0.01;
1192 // to allow for 100+ waypoints, we need to trick the runaway loop counter
1193 void() DumpWaypoints =
1199 bprint(world.message);
1203 bprint("// Ways by ");
1204 bprint(self.netname);
1209 fixer.nextthink = time + 0.01;
1210 fixer.think = PrintWaypoint;
1211 fixer.enemy = world;
1215 void() PrintQCWaypoint =
1220 if (self.enemy == world)
1223 t = self.enemy._next;
1229 bprint("};\n\n// End dump\n");
1232 bprint(" make_way(");
1236 h = ftos(t.target1.count);
1239 h = ftos(t.target2.count);
1242 h = ftos(t.target3.count);
1245 h = ftos(t.target4.count);
1248 h = ftos(t.b_aiflags);
1251 self.nextthink = time + 0.01;
1255 void() QCDumpWaypoints =
1257 bprint("/* QC Waypoint Dump - src/frikbot/map_");
1260 bprint(".qc\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\nvoid(vector org, vector bit1, float bit4, float flargs) make_way;\n");
1261 bprint("// Ways by ");
1262 bprint(self.netname);
1265 bprint("void() map_");
1273 fixer.nextthink = time + 0.01;
1274 fixer.think = PrintQCWaypoint;
1275 fixer.enemy = world;
1279 void() PrintBSPWaypoint =
1284 if (self.enemy == world)
1287 t = self.enemy._next;
1291 bprint("\n\n// End dump\n");
1296 bprint("{\n\"classname\" \"waypoint\"\n\"origin\" \"");
1297 h = ftos(t.origin_x);
1300 h = ftos(t.origin_y);
1303 h = ftos(t.origin_z);
1305 if (t.target1.count)
1307 bprint("\"\n\"b_pants\" \"");
1308 h = ftos(t.target1.count);
1311 if (t.target2.count)
1313 bprint("\"\n\"b_skill\" \"");
1314 h = ftos(t.target2.count);
1317 if (t.target3.count)
1319 bprint("\"\n\"b_shirt\" \"");
1320 h = ftos(t.target3.count);
1323 if (t.target4.count)
1325 bprint("\"\n\"b_frags\" \"");
1326 h = ftos(t.target4.count);
1331 bprint("\"\n\"b_aiflags\" \"");
1332 h = ftos(t.b_aiflags);
1336 self.nextthink = time + 0.01;
1340 void() BSPDumpWaypoints =
1342 bprint("/* BSP entities Dump - maps/");
1345 bprint(".ent\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\n\n");
1350 fixer.nextthink = time + 0.01;
1351 fixer.think = PrintBSPWaypoint;
1352 fixer.enemy = world;