]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/default/waypoints.qh
Purge autocvars.qh from the codebase, cvars are defined in the headers of the feature...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / waypoints.qh
1 #pragma once
2
3 bool autocvar_g_waypointeditor;
4 bool autocvar_g_waypointeditor_symmetrical;
5 bool autocvar_g_waypointeditor_symmetrical_allowload = true;
6 vector autocvar_g_waypointeditor_symmetrical_origin;
7 int autocvar_g_waypointeditor_symmetrical_order;
8 vector autocvar_g_waypointeditor_symmetrical_axis;
9
10 // increase by 0.01 when changes require only waypoint relinking
11 // increase by 1 when changes require to manually edit waypoints
12 // max 2 decimal places, always specified
13 const float WAYPOINT_VERSION = 1.04;
14 float waypoint_version_loaded;
15 string waypoint_time;
16
17 // fields you can query using prvm_global server to get some statistics about waypoint linking culling
18 float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
19
20 float botframe_waypointeditorlightningtime;
21 float botframe_loadedforcedlinks;
22 float botframe_cachedwaypointlinks;
23
24 // waypoint wp links to waypoint wp.wpXX (OUTGOING link)
25 // links are sorted by their cost (wpXXmincost)
26 .entity wp00, wp01, wp02, wp03, wp04, wp05, wp06, wp07, wp08, wp09, wp10, wp11, wp12, wp13, wp14, wp15;
27 .entity wp16, wp17, wp18, wp19, wp20, wp21, wp22, wp23, wp24, wp25, wp26, wp27, wp28, wp29, wp30, wp31;
28
29 // used by jumppads to store original destination wp, used in case it gets changed in the editor
30 .entity wp00_original;
31
32 .float wp00mincost, wp01mincost, wp02mincost, wp03mincost, wp04mincost, wp05mincost, wp06mincost, wp07mincost;
33 .float wp08mincost, wp09mincost, wp10mincost, wp11mincost, wp12mincost, wp13mincost, wp14mincost, wp15mincost;
34 .float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost;
35 .float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost;
36
37 // hardwired links are saved to the .wpXX fields among normal links
38 // AND to the supporting .wphwXX fields to allow identifying them precisely
39 // these links are not sorted, unlike normal links
40 .entity wphw00, wphw01, wphw02, wphw03, wphw04, wphw05, wphw06, wphw07;
41
42 .float wpcost;
43 .int wpfire, wpconsidered, wpisbox, wplinked;
44 .int wpflags;
45 .entity wp_aimed;
46 .entity wp_locked;
47
48 .vector wpnearestpoint;
49
50 // holds reference to the support waypoint, if any
51 .entity goalentity;
52 #define SUPPORT_WP goalentity
53
54 /*
55  * Functions
56  */
57
58 spawnfunc(waypoint);
59
60 bool waypoint_has_hardwiredlinks(entity wp);
61 bool waypoint_is_hardwiredlink(entity wp_from, entity wp_to);
62 void waypoint_mark_hardwiredlink(entity wp_from, entity wp_to);
63 void waypoint_unmark_hardwiredlink(entity wp_from, entity wp_to);
64
65 void waypoint_removelink(entity from, entity to);
66 int waypoint_getlinknum(entity from, entity to);
67 bool waypoint_islinked(entity from, entity to);
68 void waypoint_addlink_customcost(entity from, entity to, float c);
69 void waypoint_addlink(entity from, entity to);
70 void waypoint_think(entity this);
71 void waypoint_clearlinks(entity wp);
72 void waypoint_schedulerelink(entity wp);
73
74 float waypoint_get_assigned_link_cost(entity w, float i);
75
76 float waypoint_getlinkcost(entity from, entity to);
77 float waypoint_gettravelcost(vector from, vector to, entity from_ent, entity to_ent);
78 float waypoint_getlinearcost(float dist);
79 void waypoint_updatecost_foralllinks();
80
81 void waypoint_remove_fromeditor(entity pl);
82 void waypoint_remove(entity wp);
83 void waypoint_schedulerelinkall();
84 void waypoint_save_links();
85 void waypoint_saveall();
86
87 void waypoint_spawnforitem_force(entity e, vector org);
88 void waypoint_spawnforitem(entity e);
89 void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent);
90 void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent);
91 void botframe_showwaypointlinks();
92
93 float waypoint_loadall();
94 bool waypoint_load_links();
95 void waypoint_load_hardwiredlinks();
96
97 void waypoint_spawn_fromeditor(entity pl, bool at_crosshair, bool is_jump_wp, bool is_crouch_wp, bool is_support_wp);
98 entity waypoint_spawn(vector m1, vector m2, float f);
99 entity waypoint_spawnpersonal(entity this, vector position);
100
101 void waypoint_unreachable(entity pl);
102
103 vector waypoint_fixorigin_down_dir(vector position, entity tracetest_ent, vector down_dir);
104
105 void botframe_autowaypoints();