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;
454 else if (self.impulse == 8)
456 if (self.current_way.b_aiflags & AI_CARELESS)
457 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_CARELESS);
459 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_CARELESS;
460 self.b_menu_time = time;
463 if (self.impulse == 9)
465 self.b_menu = MENU_FLAGS2;
466 self.b_menu_time = time;
468 else if (self.impulse == 10)
470 self.b_menu = MENU_MAIN;
471 self.b_menu_time = time;
474 else if (self.b_menu == MENU_FLAGS2)
477 if (self.current_way)
479 if (self.impulse == 1)
481 if (self.current_way.b_aiflags & AI_DIFFICULT)
482 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIFFICULT);
484 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIFFICULT; self.b_menu_time = time;
486 else if (self.impulse == 2)
488 if (self.current_way.b_aiflags & AI_PLAT_BOTTOM)
489 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PLAT_BOTTOM);
491 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PLAT_BOTTOM;
492 self.b_menu_time = time;
494 else if (self.impulse == 3)
496 if (self.current_way.b_aiflags & AI_RIDE_TRAIN)
497 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_RIDE_TRAIN);
499 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_RIDE_TRAIN;
500 self.b_menu_time = time;
502 else if (self.impulse == 4)
504 if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN)
505 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOOR_NO_OPEN);
507 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOOR_NO_OPEN;
508 self.b_menu_time = time;
510 else if (self.impulse == 5)
512 if (self.current_way.b_aiflags & AI_AMBUSH)
513 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_AMBUSH);
515 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_AMBUSH;
516 self.b_menu_time = time;
518 else if (self.impulse == 6)
520 if (self.current_way.b_aiflags & AI_SNIPER)
521 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SNIPER);
523 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SNIPER;
524 self.b_menu_time = time;
526 else if (self.impulse == 7)
528 if (self.current_way.b_aiflags & AI_TRACE_TEST)
529 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_TRACE_TEST);
531 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_TRACE_TEST;
532 self.b_menu_time = time;
536 if (self.impulse == 9)
538 self.b_menu = MENU_FLAGS;
539 self.b_menu_time = time;
541 else if (self.impulse == 10)
543 self.b_menu = MENU_MAIN;
544 self.b_menu_time = time;
548 else if (self.b_menu == MENU_BOTS)
550 if (self.impulse == 1)
555 else if (self.impulse == 2)
564 bot_get_path(b_temp3, TRUE);
572 else if (self.impulse == 3)
577 else if (self.impulse == 4)
585 self.target1 = self.target2 = self.target3 = self.target4 = world;
592 else if (self.impulse == 5)
594 if (self.current_way)
602 setorigin(self, b_temp1.current_way.origin);
609 sprint(self, "select a waypoint first\n");
611 else if (self.impulse == 6)
614 self.b_menu_time = time;
616 else if (self.impulse == 10)
618 self.b_menu = MENU_MAIN;
619 self.b_menu_time = time;
622 else if (self.b_menu == MENU_WAYLIST)
624 if (self.impulse == 1)
627 self.b_menu_time = time;
629 else if (self.impulse == 2)
633 else if (dump_mode == 1)
635 else if (dump_mode == 2)
638 else if (self.impulse == 3)
643 if ((t.target1 == world) && (t.target2 == world) && (t.target3 == world) && (t.target4 == world))
645 sprint(self, "Waypoint #");
648 sprint(self, " has no outbound links\n");
650 if ((t.target1 == t) || (t.target2 == t) || (t.target3 == t) || (t.target4 == t))
652 sprint(self, "Waypoint #");
655 sprint(self, " links to itself (??)\n");
659 sprint(self, "Error check complete\n");
661 else if (self.impulse == 4)
663 sprint(self, "not in this version (FBX 0.10.0)\n");
665 else if (self.impulse == 5)
667 if (waypoint_mode == WM_EDITOR_DYNAMIC)
668 waypoint_mode = WM_EDITOR;
670 waypoint_mode = WM_EDITOR_DYNAMIC;
671 self.b_menu_time = time;
674 else if (self.impulse == 6)
676 if (waypoint_mode == WM_EDITOR_DYNLINK)
677 waypoint_mode = WM_EDITOR;
679 waypoint_mode = WM_EDITOR_DYNLINK;
680 self.b_menu_time = time;
682 else if (self.impulse == 7)
685 self.b_menu_time = time;
687 else if (self.impulse == 8)
690 self.b_menu_time = time;
692 else if (self.impulse == 9)
695 self.b_menu_time = time;
697 else if (self.impulse == 10)
699 self.b_menu = MENU_MAIN;
700 self.b_menu_time = time;
703 else if (self.b_menu == 8)
705 if (self.impulse == 1)
707 if (self.current_way)
709 if (!LinkWays(self.last_way, self.current_way))
710 sprint(self, "Unable to link them\n");
711 self.b_menu = MENU_LINKS;
712 self.b_menu_time = time;
715 else if (self.impulse == 2)
717 self.b_menu = MENU_LINKS;
718 self.b_menu_time = time;
721 else if (self.b_menu == 9)
723 if (self.impulse == 1)
725 if (self.current_way)
727 if (!TeleLinkWays(self.last_way, self.current_way))
728 sprint(self, "Unable to link them\n");
729 self.b_menu = MENU_LINKS;
730 self.b_menu_time = time;
733 else if (self.impulse == 2)
735 self.b_menu = MENU_LINKS;
736 self.b_menu_time = time;
739 else if (self.b_menu == 10)
741 if (self.impulse == 1)
743 if (self.current_way)
745 UnlinkWays(self.last_way, self.current_way);
746 self.b_menu = MENU_LINKS;
747 self.b_menu_time = time;
750 else if (self.impulse == 2)
752 self.b_menu = MENU_LINKS;
753 self.b_menu_time = time;
756 else if (self.b_menu == 11)
758 if (self.impulse == 1)
760 if (self.current_way)
762 if (!LinkWays(self.last_way, self.current_way))
763 sprint(self, "Unable to link 1 to 2\n");
764 if (!LinkWays(self.current_way, self.last_way))
765 sprint(self, "Unable to link 2 to 1\n");
766 self.b_menu = MENU_LINKS;
767 self.b_menu_time = time;
770 else if (self.impulse == 2)
772 self.b_menu = MENU_LINKS;
773 self.b_menu_time = time;
776 else if (self.b_menu == 12)
778 if (self.impulse == 1)
780 if (self.current_way)
782 UnlinkWays(self.last_way, self.current_way);
783 UnlinkWays(self.current_way, self.last_way);
784 self.b_menu = MENU_LINKS;
785 self.b_menu_time = time;
788 else if (self.impulse == 2)
790 self.b_menu = MENU_LINKS;
791 self.b_menu_time = time;
794 else if (self.b_menu == 13)
796 if (self.impulse == 1)
799 self.b_menu = MENU_WAYLIST;
800 self.b_menu_time = time;
802 else if (self.impulse == 2)
804 self.b_menu = MENU_WAYLIST;
805 self.b_menu_time = time;
808 else if (self.b_menu == 14)
810 if (self.impulse == 10)
812 self.b_menu_value = self.b_menu_value * 10 + self.impulse;
813 self.b_menu_time = 0;
815 else if (self.b_menu == 15)
817 if (self.impulse == 1)
819 delete_waypoint(self.last_way);
820 self.b_menu = MENU_WAYPOINTS;
821 self.b_menu_time = time;
823 else if (self.impulse == 2)
825 self.b_menu = MENU_WAYPOINTS;
826 self.b_menu_time = time;
832 if (self.b_menu_time < time)
834 if (self.b_menu == MENU_MAIN)
836 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";
837 if (self.movetype == MOVETYPE_NOCLIP)
838 s2 = "[6] [#] Noclip \n";
840 s2 = "[6] [ ] Noclip \n";
842 if (self.flags & FL_GODMODE)
843 s3 = "[7] [#] Godmode \n";
845 s3 = "[7] [ ] Godmode \n";
846 if (self.b_aiflags & AI_HOLD_SELECT)
847 s4 = "[8] [#] Hold Select \n";
849 s4 = "[8] [ ] Hold Select \n";
850 s5 = "[9] Teleport to Way # \n[0] Close Menu \n";
852 else if (self.b_menu == MENU_WAYPOINTS)
854 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";
856 else if (self.b_menu == MENU_LINKS)
858 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";
860 else if (self.b_menu == MENU_FLAGS)
862 if (self.current_way.b_aiflags & AI_DOORFLAG)
863 s1 = "-- AI Flag Management --\n[1] [#] Door Flag \n";
865 s1 = "-- AI Flag Management --\n[1] [ ] Door Flag \n";
867 if (self.current_way.b_aiflags & AI_PRECISION)
868 s2 = "[2] [#] Precision \n";
870 s2 = "[2] [ ] Precision \n";
872 if (self.current_way.b_aiflags & AI_SURFACE)
873 s3 = "[3] [#] Surface for air \n";
875 s3 = "[3] [ ] Surface for air \n";
877 if (self.current_way.b_aiflags & AI_BLIND)
878 s4 = "[4] [#] Blind mode \n";
880 s4 = "[4] [ ] Blind mode \n";
882 if (self.current_way.b_aiflags & AI_JUMP)
883 s5 = "[5] [#] Jump \n";
885 s5 = "[5] [ ] Jump \n";
887 if (self.current_way.b_aiflags & AI_DIRECTIONAL)
888 s6 = "[6] [#] Directional \n";
890 s6 = "[6] [ ] Directional \n";
893 if ( (self.current_way.b_aiflags & AI_SUPER_JUMP) && (self.current_way.b_aiflags & AI_CARELESS) )
894 s7 = "[7] [#] Super Jump \n[8] [#] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n";
895 else if ( (self.current_way.b_aiflags & AI_SUPER_JUMP) && (!(self.current_way.b_aiflags & AI_CARELESS)) )
896 s7 = "[7] [#] Super Jump \n[8] [ ] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n";
897 else if ( (!(self.current_way.b_aiflags & AI_SUPER_JUMP)) && (self.current_way.b_aiflags & AI_CARELESS) )
898 s7 = "[7] [ ] Super Jump \n[8] [#] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n";
899 else if ( (!(self.current_way.b_aiflags & AI_SUPER_JUMP)) && (!(self.current_way.b_aiflags & AI_CARELESS)) )
900 s7 = "[7] [ ] Super Jump \n[8] [ ] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n";
902 else if (self.b_menu == MENU_FLAGS2)
904 if (self.current_way.b_aiflags & AI_DIFFICULT)
905 s1 = "-- AI Flags pg. 2--\n[1] [#] Difficult \n";
907 s1 = "-- AI Flags pg. 2--\n[1] [ ] Difficult \n";
909 if (self.current_way.b_aiflags & AI_PLAT_BOTTOM)
910 s2 = "[2] [#] Wait for plat \n";
912 s2 = "[2] [ ] Wait for plat \n";
914 if (self.current_way.b_aiflags & AI_RIDE_TRAIN)
915 s3 = "[3] [#] Ride train \n";
917 s3 = "[3] [ ] Ride train \n";
919 if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN)
920 s4 = "[4] [#] Door flag no open\n";
922 s4 = "[4] [ ] Door flag no open\n";
924 if (self.current_way.b_aiflags & AI_AMBUSH)
925 s5 = "[5] [#] Ambush \n";
927 s5 = "[5] [ ] Ambush \n";
929 if (self.current_way.b_aiflags & AI_SNIPER)
930 s6 = "[6] [#] Snipe \n";
932 s6 = "[6] [ ] Snipe \n";
934 if (self.current_way.b_aiflags & AI_TRACE_TEST)
935 s7 = "[7] [#] Trace Test \n\n[9] >>AI Flag Management \n[0] >>Main Menu \n";
937 s7 = "[7] [ ] Trace Test \n\n[9] >>AI Flag Management \n[0] >>Main Menu \n";
940 else if (self.b_menu == MENU_BOTS)
942 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";
944 else if (self.b_menu == MENU_WAYLIST)
946 s1 = "-- Waylist Management --\n[1] Delete ALL Waypoints \n[2] Dump Waypoints \n[3] Check For Errors \n[4] Save Waypoints \n";
948 if (waypoint_mode == WM_EDITOR_DYNAMIC)
949 s2 = "[5] [#] Dynamic Mode \n[6] [#] Dynamic Link \n";
950 else if (waypoint_mode == WM_EDITOR_DYNLINK)
951 s2 = "[5] [ ] Dynamic Mode \n[6] [#] Dynamic Link \n";
953 s2 = "[5] [ ] Dynamic Mode \n[6] [ ] Dynamic Link \n";
955 s3 = "[7] [#] WAY output \n[8] [ ] QC output \n[9] [ ] BSP ents output \n[0] Main Menu \n";
956 else if (dump_mode == 1)
957 s3 = "[7] [ ] WAY output \n[8] [#] QC output \n[9] [ ] BSP ents output \n[0] Main Menu \n";
958 else if (dump_mode == 2)
959 s3 = "[7] [ ] WAY output \n[8] [ ] QC output \n[9] [#] BSP ents output \n[0] Main Menu \n";
962 else if (self.b_menu == 8)
963 s1 = "-- Link Ways --\n\nSelect another way and push 1\nor press 2 to cancel";
964 else if (self.b_menu == 9)
965 s1 = "-- Telelink Ways --\n\nSelect another way and push 1\nor press 2 to cancel";
966 else if (self.b_menu == 10)
967 s1 = "-- Delete Link --\n\nSelect another way and push 1\nor press 2 to cancel";
968 else if (self.b_menu == 11)
969 s1 = "-- Create Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel";
970 else if (self.b_menu == 12)
971 s1 = "-- Delete Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel";
972 else if (self.b_menu == 13)
973 s1 = "-- Delete ALL Ways --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel";
974 else if (self.b_menu == 14)
976 s1 = "-- Teleport to Way # --\n\nEnter way number and press\nimpulse 104 to warp\n\nWaypoint #";
977 s2 = ftos(self.b_menu_value);
980 else if (self.b_menu == 15)
981 s1 = "-- Delete Waypoint --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel";
982 frik_big_centerprint(self, s1, s2, s3, s4, s5, s6, s7);
983 self.b_menu_time = time + 1.25;
989 void() bot_way_edit =
993 if (self.b_menu_value)
995 if (self.b_menu == 14)
997 t = WaypointForNum(self.b_menu_value);
999 setorigin(self, t.origin - self.view_ofs);
1001 sprint(self, "No waypoint with that number\n");
1003 self.b_menu = MENU_MAIN;
1004 self.b_menu_time = time;
1006 self.b_menu_value = 0;
1009 if (waypoint_mode < WM_EDITOR)
1011 self.b_menu = MENU_MAIN;
1012 waypoint_mode = WM_EDITOR;
1013 self.b_menu_time = 0;
1014 cvar_set("saved2", "0");
1015 WriteByte(MSG_ALL, 8);
1016 WriteByte(MSG_ALL, 1);
1017 WriteString(MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS -CONDEBUG BEFORE PROCEEDING\n");
1018 localcmd("cmdline\n");
1022 setmodel(t, "progs/s_bubble.spr"); // show the waypoints
1025 if (self.current_way)
1026 setmodel(self.current_way, "progs/s_light.spr");
1030 saved2 = cvar("saved2");
1034 self.b_menu = floor(saved2/16);
1035 self.impulse = saved2 & 15;
1038 cvar_set("saved2", "0");
1042 waypoint_mode = WM_LOADED;
1046 setmodel(t, string_null); // hide the waypoints
1054 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1056 Waypoint Saving to file.
1058 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1062 // bytecount is really iffy
1063 // since there is no true way to determine the length of an ftos
1064 // it uses an approximate of 5
1065 // various other things are guesses, but I don't cut it at the absolute
1066 // max so it should be okay
1068 void() PrintWaypoint =
1071 local float needcolon;
1074 if (self.enemy == world)
1077 t = self.enemy._next;
1078 if (bytecounter >= 8000)
1080 bprint("exec maps/");
1083 h = ftos(filecount);
1085 filecount = filecount + 1;
1086 bprint("\n// **** break here **** \n");
1093 bprint("saved4 3\n// end waypoint dump\n");
1094 bytecounter = bytecounter + 27;
1097 if ((t.origin_x != saved1) || (t.count == 1))
1100 h = ftos(t.origin_x);
1102 saved1 = t.origin_x;
1103 bytecounter = bytecounter + 12;
1106 if ((t.origin_y != saved2) || (t.count == 1))
1111 bytecounter = bytecounter + 2;
1116 h = ftos(t.origin_y);
1118 bytecounter = bytecounter + 12;
1119 saved2 = t.origin_y;
1121 if ((t.origin_z != saved3) || (t.count == 1))
1126 bytecounter = bytecounter + 2;
1131 h = ftos(t.origin_z);
1133 bytecounter = bytecounter + 12;
1134 saved3 = t.origin_z;
1136 bytecounter = bytecounter + 1;
1139 if ((scratch1 != t.target1.count) || t.count == 1)
1142 bprint("scratch1 ");
1143 bytecounter = bytecounter + 14;
1144 h = ftos(t.target1.count);
1146 scratch1 = t.target1.count;
1148 if ((scratch2 != t.target2.count) || t.count == 1)
1153 bytecounter = bytecounter + 2;
1157 bprint("scratch2 ");
1158 bytecounter = bytecounter + 14;
1159 h = ftos(t.target2.count);
1161 scratch2 = t.target2.count;
1163 if ((scratch3 != t.target3.count) || t.count == 1)
1168 bytecounter = bytecounter + 2;
1172 bprint("scratch3 ");
1173 bytecounter = bytecounter + 14;
1174 h = ftos(t.target3.count);
1176 scratch3 = t.target3.count;
1178 if ((scratch4 != t.target4.count) || t.count == 1)
1183 bytecounter = bytecounter + 2;
1187 bprint("scratch4 ");
1188 bytecounter = bytecounter + 14;
1189 h = ftos(t.target4.count);
1191 scratch4 = t.target4.count;
1193 bprint("\nsaved4 ");
1194 bytecounter = bytecounter + 19;
1196 h = ftos(t.b_aiflags * 4 + 2);
1198 h = ftos(t.b_aiflags * 4 + 1);
1200 bprint ("; wait\n");
1201 self.nextthink = time + 0.01;
1205 // to allow for 100+ waypoints, we need to trick the runaway loop counter
1206 void() DumpWaypoints =
1212 bprint(world.message);
1216 bprint("// Ways by ");
1217 bprint(self.netname);
1222 fixer.nextthink = time + 0.01;
1223 fixer.think = PrintWaypoint;
1224 fixer.enemy = world;
1228 void() PrintQCWaypoint =
1233 if (self.enemy == world)
1236 t = self.enemy._next;
1242 bprint("};\n\n// End dump\n");
1245 bprint(" make_way(");
1249 h = ftos(t.target1.count);
1252 h = ftos(t.target2.count);
1255 h = ftos(t.target3.count);
1258 h = ftos(t.target4.count);
1261 h = ftos(t.b_aiflags);
1264 self.nextthink = time + 0.01;
1268 void() QCDumpWaypoints =
1270 bprint("/* QC Waypoint Dump - src/frikbot/map_");
1273 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");
1274 bprint("// Ways by ");
1275 bprint(self.netname);
1278 bprint("void() map_");
1286 fixer.nextthink = time + 0.01;
1287 fixer.think = PrintQCWaypoint;
1288 fixer.enemy = world;
1292 void() PrintBSPWaypoint =
1297 if (self.enemy == world)
1300 t = self.enemy._next;
1304 bprint("\n\n// End dump\n");
1309 bprint("{\n\"classname\" \"waypoint\"\n\"origin\" \"");
1310 h = ftos(t.origin_x);
1313 h = ftos(t.origin_y);
1316 h = ftos(t.origin_z);
1318 if (t.target1.count)
1320 bprint("\"\n\"b_pants\" \"");
1321 h = ftos(t.target1.count);
1324 if (t.target2.count)
1326 bprint("\"\n\"b_skill\" \"");
1327 h = ftos(t.target2.count);
1330 if (t.target3.count)
1332 bprint("\"\n\"b_shirt\" \"");
1333 h = ftos(t.target3.count);
1336 if (t.target4.count)
1338 bprint("\"\n\"b_frags\" \"");
1339 h = ftos(t.target4.count);
1344 bprint("\"\n\"b_aiflags\" \"");
1345 h = ftos(t.b_aiflags);
1349 self.nextthink = time + 0.01;
1353 void() BSPDumpWaypoints =
1355 bprint("/* BSP entities Dump - maps/");
1358 bprint(".ent\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\n\n");
1363 fixer.nextthink = time + 0.01;
1364 fixer.think = PrintBSPWaypoint;
1365 fixer.enemy = world;