]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/default/waypoints.qh
Merge branch 'TimePath/bot_api' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / waypoints.qh
1 #ifndef WAYPOINTS_H
2 #define WAYPOINTS_H
3 /*
4  * Globals and Fields
5  */
6 // const int WAYPOINTFLAG_GENERATED = 0x800000;
7 const int WAYPOINTFLAG_ITEM = 0x400000;
8 const int WAYPOINTFLAG_TELEPORT = 0x200000;
9 const int WAYPOINTFLAG_NORELINK = 0x100000;
10 const int WAYPOINTFLAG_PERSONAL = 0x80000;
11 const int WAYPOINTFLAG_PROTECTED = 0x40000;  // Useless WP detection never kills these.
12 const int WAYPOINTFLAG_USEFUL = 0x20000;  // Useless WP detection temporary flag.
13 const int WAYPOINTFLAG_DEAD_END = 0x10000;  // Useless WP detection temporary flag.
14
15 // fields you can query using prvm_global server to get some statistics about waypoint linking culling
16 float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
17
18 float botframe_waypointeditorlightningtime;
19 float botframe_loadedforcedlinks;
20 float botframe_cachedwaypointlinks;
21
22 .entity wp00, wp01, wp02, wp03, wp04, wp05, wp06, wp07, wp08, wp09, wp10, wp11, wp12, wp13, wp14, wp15;
23 .entity wp16, wp17, wp18, wp19, wp20, wp21, wp22, wp23, wp24, wp25, wp26, wp27, wp28, wp29, wp30, wp31;
24
25 // itemscore = (howmuchmoreIwant / howmuchIcanwant) / itemdistance
26 .float wp00mincost, wp01mincost, wp02mincost, wp03mincost, wp04mincost, wp05mincost, wp06mincost, wp07mincost;
27 .float wp08mincost, wp09mincost, wp10mincost, wp11mincost, wp12mincost, wp13mincost, wp14mincost, wp15mincost;
28 .float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost;
29 .float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost;
30
31 .float wpfire, wpconsidered, wpisbox, wplinked, wphardwired;
32 .int wpflags;
33
34 .vector wpnearestpoint;
35
36 /*
37  * Functions
38  */
39
40 spawnfunc(waypoint);
41 void waypoint_addlink(entity from, entity to);
42 void waypoint_think();
43 void waypoint_clearlinks(entity wp);
44 void waypoint_schedulerelink(entity wp);
45
46 void waypoint_remove(entity e);
47 void waypoint_removeall();
48 void waypoint_schedulerelinkall();
49 void waypoint_load_links_hardwired();
50 void waypoint_save_links();
51 void waypoint_saveall();
52
53 void waypoint_spawnforitem_force(entity e, vector org);
54 void waypoint_spawnforitem(entity e);
55 void waypoint_spawnforteleporter(entity e, vector destination, float timetaken);
56 void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken);
57 void botframe_showwaypointlinks();
58
59 float waypoint_loadall();
60 float waypoint_load_links();
61
62 entity waypoint_spawn(vector m1, vector m2, float f);
63 entity waypoint_spawnpersonal(vector position);
64
65 vector waypoint_fixorigin(vector position);
66
67 void botframe_autowaypoints();
68 #endif