Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
api.qh
Go to the documentation of this file.
1#pragma once
2
4#include <common/stats.qh>
7
10
12const int WAYPOINTFLAG_ITEM = BIT(22);
13const int WAYPOINTFLAG_TELEPORT = BIT(21); // teleports, warpzones and jumppads
14//const int WAYPOINTFLAG_NORELINK = BIT(20); // deprecated, see explanation below. Do not recycle this bit.
15const int WAYPOINTFLAG_PERSONAL = BIT(19);
16const int WAYPOINTFLAG_PROTECTED = BIT(18); // Useless WP detection never kills these.
17const int WAYPOINTFLAG_USEFUL = BIT(17); // Useless WP detection temporary flag.
18const int WAYPOINTFLAG_DEAD_END = BIT(16); // Useless WP detection temporary flag.
19const int WAYPOINTFLAG_LADDER = BIT(15);
20const int WAYPOINTFLAG_JUMP = BIT(14);
21const int WAYPOINTFLAG_CUSTOM_JP = BIT(13); // jumppad with different destination waypoint (changed in the editor)
22const int WAYPOINTFLAG_CROUCH = BIT(12);
23const int WAYPOINTFLAG_SUPPORT = BIT(11);
24
25// removed WAYPOINTFLAG_NORELINK since it breaks backward compatibility
26// e.g. support waypoints would have no outgoing links in old Xonotic versions
27// In general, old Xonotic versions should spawn a normal waypoint for each unknown waypoint type
30
35float skill;
36
40.float bot_dodge;
42.float bot_moveskill; // moving technique
44.float(entity player, entity item) bot_pickupevalfunc;
45.string cleanname;
47.void(entity this) havocbot_role;
48.void(entity this) havocbot_previous_role;
49.float isbot; // true if this client is actually a bot
55.float speed;
63.float wpcost;
66
67bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate);
68void bot_aim_reset(entity this);
69void bot_clientconnect(entity this);
71void bot_cmdhelp(string scmd);
72void bot_endgame();
73bool bot_fixcount(bool multiple_per_frame);
75void bot_queuecommand(entity bot, string cmdstring);
77void bot_resetqueues();
78void bot_serverframe();
79bool bot_shouldattack(entity this, entity e);
80void bot_think(entity this);
81
84
85void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius);
86void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius);
87void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius);
88
90
96
99.entity ignoregoal;
100
102
105
108void navigation_dynamicgoal_init(entity this, bool initially_static);
109void navigation_dynamicgoal_set(entity this, entity dropper);
111entity navigation_findnearestwaypoint(entity ent, float walkfromwp);
116void navigation_goalrating_timeout_expire(entity this, float seconds);
120void navigation_markroutes(entity this, entity fixed_source_waypoint);
121void navigation_markroutes_inverted(entity fixed_source_waypoint);
122void navigation_routerating(entity this, entity e, float f, float rangebias);
123
125
126void set_tracewalk_dest(entity ent, vector org, bool fix_player_dest);
128bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float end_height, float movemode);
129
131void waypoint_remove(entity wp);
132void waypoint_saveall();
137void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent);
138void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent);
139void waypoint_spawn_fromeditor(entity pl, bool at_crosshair, bool is_jump_wp, bool is_crouch_wp, bool is_support_wp);
140entity waypoint_spawn(vector m1, vector m2, float f);
142void waypoint_start_hardwiredlink(entity pl, bool at_crosshair);
143void waypoint_lock(entity pl);
144
145void waypoint_getSymmetricalOrigin_cmd(entity caller, bool save, int arg_idx);
146void waypoint_getSymmetricalAxis_cmd(entity caller, bool save, int arg_idx);
147
152{
156}
float wp24mincost
Definition api.qh:61
float wp06mincost
Definition api.qh:58
float wp27mincost
Definition api.qh:61
const int WAYPOINTFLAG_CROUCH
Definition api.qh:22
void waypoint_lock(entity pl)
Definition waypoints.qc:270
void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
Definition roles.qc:16
bool havocbot_goalrating_item_pickable_check_players(entity this, vector org, entity item, vector item_org)
Definition roles.qc:60
float wp03mincost
Definition api.qh:58
entity wp19
Definition api.qh:57
float bot_forced_team
Definition api.qh:41
void waypoint_spawnforitem(entity e)
void bot_resetqueues()
float wp29mincost
Definition api.qh:61
const int WAYPOINTFLAG_PERSONAL
Definition api.qh:15
void waypoint_schedulerelinkall()
entity find_bot_by_number(float number)
Definition scripting.qc:246
const int WAYPOINTFLAG_LADDER
Definition api.qh:19
bool bot_fixcount(bool multiple_per_frame)
Definition bot.qc:623
void waypoint_getSymmetricalAxis_cmd(entity caller, bool save, int arg_idx)
Definition waypoints.qc:137
float wp11mincost
Definition api.qh:59
const int WAYPOINTFLAG_DEAD_END
Definition api.qh:18
bool bot_waypoints_for_items
Definition api.qh:9
entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
float navigation_hasgoals
Definition api.qh:52
entity bot_basewaypoint
Definition api.qh:106
void navigation_goalrating_start(entity this)
const int WAYPOINTFLAG_TELEPORT
Definition api.qh:13
entity ignoregoal
Definition api.qh:99
entity wp11
Definition api.qh:56
entity wphw02
Definition api.qh:65
float lastteleporttime
Definition api.qh:50
float wp14mincost
Definition api.qh:59
const int WAYPOINTFLAG_PROTECTED
Definition api.qh:16
float wp26mincost
Definition api.qh:61
float wp01mincost
Definition api.qh:58
float wp19mincost
Definition api.qh:60
void navigation_goalrating_timeout_force(entity this)
Definition navigation.qc:29
float wp25mincost
Definition api.qh:61
float wp21mincost
Definition api.qh:60
entity find_bot_by_name(string name)
Definition scripting.qc:235
entity wp09
Definition api.qh:56
entity wp15
Definition api.qh:56
const int WAYPOINTFLAG_CUSTOM_JP
Definition api.qh:21
float wp02mincost
Definition api.qh:58
void navigation_markroutes_inverted(entity fixed_source_waypoint)
void bot_queuecommand(entity bot, string cmdstring)
Definition scripting.qc:30
float havocbot_symmetry_axis_q
Definition api.qh:94
void navigation_goalrating_timeout_set(entity this)
Definition navigation.qc:20
bool navigation_goalrating_timeout_can_be_anticipated(entity this)
Definition navigation.qc:56
float bot_dodge
Definition api.qh:40
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
Definition roles.qc:106
float wp05mincost
Definition api.qh:58
const int WAYPOINTFLAG_NORELINK__DEPRECATED
Definition api.qh:28
float bot_weapons_close[REGISTRY_MAX(Weapons)]
Definition api.qh:32
float wp17mincost
Definition api.qh:60
entity wp24
Definition api.qh:57
float havocbot_symmetry_axis_m
Definition api.qh:93
entity wp13
Definition api.qh:56
void bot_think(entity this)
Definition bot.qc:62
float nearestwaypointtimeout
Definition api.qh:53
entity wphw06
Definition api.qh:65
entity wp30
Definition api.qh:57
entity nearestwaypoint
Definition api.qh:54
bool navigation_dynamicgoal
Definition api.qh:107
entity wp17
Definition api.qh:57
void bot_cmdhelp(string scmd)
Definition scripting.qc:331
void set_tracewalk_dest(entity ent, vector org, bool fix_player_dest)
void waypoint_getSymmetricalOrigin_cmd(entity caller, bool save, int arg_idx)
Definition waypoints.qc:169
const int WAYPOINTFLAG_SUPPORT
Definition api.qh:23
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
Definition roles.qc:176
float wp13mincost
Definition api.qh:59
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent)
float wp28mincost
Definition api.qh:61
float wp00mincost
Definition api.qh:58
entity wphw04
Definition api.qh:65
bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float end_height, float movemode)
vector lastteleport_origin
Definition api.qh:51
vector havocbot_middlepoint
Definition api.qh:91
void waypoint_unreachable(entity pl)
Definition waypoints.qc:28
float wp04mincost
Definition api.qh:58
entity wp06
Definition api.qh:56
bool navigation_goalrating_timeout(entity this)
Definition navigation.qc:44
void waypoint_schedulerelink(entity wp)
float bot_tracewalk_time
Definition api.qh:37
float bot_moveskill
Definition api.qh:42
float wp09mincost
Definition api.qh:59
float wp07mincost
Definition api.qh:58
void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent)
void navigation_dynamicgoal_init(entity this, bool initially_static)
Definition navigation.qc:77
void navigation_markroutes(entity this, entity fixed_source_waypoint)
entity wp22
Definition api.qh:57
float goalentity_lock_timeout
Definition api.qh:97
vector get_closer_dest(entity ent, vector org)
float havocbot_symmetry_origin_order
Definition api.qh:95
entity wp31
Definition api.qh:57
float skill
Definition api.qh:35
float bot_dodgerating
Definition api.qh:39
float wp10mincost
Definition api.qh:59
float bot_attack
Definition api.qh:38
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
const int WAYPOINTFLAG_USEFUL
Definition api.qh:17
const int WAYPOINTFLAG_ITEM
Definition api.qh:12
void navigation_goalrating_timeout_extend_if_needed(entity this, float seconds)
Definition navigation.qc:50
entity wp20
Definition api.qh:57
void navigation_routerating(entity this, entity e, float f, float rangebias)
entity wp25
Definition api.qh:57
entity wp29
Definition api.qh:57
entity wp23
Definition api.qh:57
void navigation_dynamicgoal_set(entity this, entity dropper)
Definition navigation.qc:87
float wpcost
Definition api.qh:63
const int WAYPOINTFLAG_GENERATED
Definition api.qh:11
float bot_custom_weapon
Definition api.qh:31
entity wp07
Definition api.qh:56
float wp31mincost
Definition api.qh:61
entity wphw01
Definition api.qh:65
entity wp18
Definition api.qh:57
float bot_weapons_mid[REGISTRY_MAX(Weapons)]
Definition api.qh:34
const int WPFLAGMASK_NORELINK
Definition api.qh:29
void bot_clientdisconnect(entity this)
Definition bot.qc:454
entity wphw07
Definition api.qh:65
entity wp04
Definition api.qh:56
IntrusiveList g_bot_targets
Definition api.qh:149
float wp08mincost
Definition api.qh:59
void bot_endgame()
Definition bot.qc:412
entity waypoint_spawn(vector m1, vector m2, float f)
Definition waypoints.qc:433
entity wp27
Definition api.qh:57
void navigation_goalrating_timeout_expire(entity this, float seconds)
Definition navigation.qc:36
void bot_list_commands()
Definition scripting.qc:444
void navigation_goalrating_end(entity this)
float wp30mincost
Definition api.qh:61
void bot_aim_reset(entity this)
Definition aim.qc:134
float wp18mincost
Definition api.qh:60
float wp20mincost
Definition api.qh:60
void bot_clientconnect(entity this)
Definition bot.qc:469
float bot_pickup
Definition api.qh:43
float havocbot_role_timeout
Definition api.qh:46
int bots_would_leave
how many bots would leave so humans can replace them
Definition api.qh:101
vector set_tracewalk_dest_2(entity ent, vector org)
entity wp26
Definition api.qh:57
float wp15mincost
Definition api.qh:59
float wp23mincost
Definition api.qh:60
void waypoint_remove_fromeditor(entity pl)
Definition waypoints.qc:838
entity wp05
Definition api.qh:56
void bot_serverframe()
Definition bot.qc:689
entity wp10
Definition api.qh:56
int currentbots
Definition api.qh:104
float isbot
Definition api.qh:49
int player_count
Definition api.qh:103
float wpconsidered
Definition api.qh:62
entity wphw05
Definition api.qh:65
void waypoint_spawnforitem_force(entity e, vector org)
float wp12mincost
Definition api.qh:59
string cleanname
Definition api.qh:45
void waypoint_spawn_fromeditor(entity pl, bool at_crosshair, bool is_jump_wp, bool is_crouch_wp, bool is_support_wp)
Definition waypoints.qc:568
entity wphw00
Definition api.qh:65
entity wp14
Definition api.qh:56
entity wphw03
Definition api.qh:65
entity wp21
Definition api.qh:57
float wp22mincost
Definition api.qh:60
bool autocvar_g_waypoints_for_items
Definition api.qh:8
entity wp12
Definition api.qh:56
void waypoint_saveall()
entity wp16
Definition api.qh:57
float bot_weapons_far[REGISTRY_MAX(Weapons)]
Definition api.qh:33
entity wp08
Definition api.qh:56
IntrusiveList g_bot_dodge
Definition api.qh:150
entity wp28
Definition api.qh:57
void waypoint_start_hardwiredlink(entity pl, bool at_crosshair)
Definition waypoints.qc:532
const int WAYPOINTFLAG_JUMP
Definition api.qh:20
float ignoregoaltime
Definition api.qh:98
void navigation_dynamicgoal_unset(entity this)
Definition navigation.qc:96
int wpflags
Definition api.qh:64
void waypoint_remove(entity wp)
Definition waypoints.qc:819
float havocbot_middlepoint_radius
Definition api.qh:92
float wp16mincost
Definition api.qh:60
bool bot_shouldattack(entity this, entity e)
Definition aim.qc:97
void bot_relinkplayerlist()
Definition bot.qc:424
IntrusiveList g_waypoints
Definition api.qh:148
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
float speed
Definition dynlight.qc:9
Weapons
Definition guide.qh:113
#define IL_NEW()
string name
Definition menu.qh:30
#define REGISTRY_MAX(id)
Definition registry.qh:17
vector
Definition self.qh:92
vector org
Definition self.qh:92
int int number
Definition impulse.qc:89
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32
entity wp01
entity wp03
entity wp02
entity wp00