Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
bot.qh
Go to the documentation of this file.
1#pragma once
2/*
3 * Globals and Fields
4 */
5
6const int AI_STATUS_ROAMING = BIT(0); // Bot is just crawling the map. No enemies at sight
7const int AI_STATUS_ATTACKING = BIT(1); // There are enemies at sight
8const int AI_STATUS_RUNNING = BIT(2); // Bot is bunny hopping
9const int AI_STATUS_DANGER_AHEAD = BIT(3); // There is lava/slime/trigger_hurt ahead
10const int AI_STATUS_OUT_JUMPPAD = BIT(4); // Trying to get out of a "vertical" jump pad
11const int AI_STATUS_OUT_WATER = BIT(5); // Trying to get out of water
12const int AI_STATUS_WAYPOINT_PERSONAL_LINKING = BIT(6); // Waiting for the personal waypoint to be linked
13const int AI_STATUS_WAYPOINT_PERSONAL_GOING = BIT(7); // Going to a personal waypoint
14const int AI_STATUS_WAYPOINT_PERSONAL_REACHED = BIT(8); // Personal waypoint reached
17const int AI_STATUS_STUCK = BIT(11); // Cannot reach any goal
18
19.bool isbot; // true if this client is actually a bot
21
22// Skill system
23#define SUPERBOT (skill > 100)
24
26
27// havocbot_keyboardskill // keyboard movement
28.float bot_moveskill; // moving technique
29.float bot_dodgeskill; // dodging
30
31.float bot_pingskill; // ping offset
32
33.float bot_weaponskill; // weapon usage skill (combos, e.g.)
34.float bot_aggresskill; // aggressivity, controls "think before fire" behaviour
35.float bot_rangepreference; // weapon choice offset for range (>0 = prefer long range earlier "sniper", <0 = prefer short range "spammer")
36
37.float bot_aimskill; // aim accuracy
38.float bot_offsetskill; // aim breakage
39.float bot_mouseskill; // mouse "speed"
40
41.float bot_thinkskill; // target choice
42.float bot_aiskill; // strategy choice
43
45
46// Custom weapon priorities
49
51.entity nextbot;
52.string cleanname;
53// the *_freeme fields exist only to avoid an engine crash
54// when trying to strunzone the original fields
58
60
64.float bot_dodge;
66
72
75
78
82
84#define IN_LAVA(pos) (_content_type = pointcontents(pos), (_content_type == CONTENT_LAVA || _content_type == CONTENT_SLIME))
85#define IN_LIQUID(pos) (_content_type = pointcontents(pos), (_content_type == CONTENT_WATER || _content_type == CONTENT_LAVA || _content_type == CONTENT_SLIME))
86#define SUBMERGED(pos) IN_LIQUID(pos + autocvar_sv_player_viewoffset)
87#define WETFEET(pos) IN_LIQUID(pos + eZ * (m1.z + 1))
88
89/*
90 * Functions
91 */
92
94bool bot_fixcount(bool multiple_per_frame);
95
96void bot_think(entity this);
99void bot_endgame();
102void bot_clientconnect(entity this);
104void bot_removenewest();
105void autoskill(float factor);
106void bot_serverframe();
107
108.void(entity this) bot_ai;
109.float(entity player, entity item) bot_pickupevalfunc;
110
111/*
112 * Imports
113 */
114
116
float bot_forced_team
Definition api.qh:41
float bot_dodge
Definition api.qh:40
float bot_moveskill
Definition api.qh:42
float bot_dodgerating
Definition api.qh:39
float bot_attack
Definition api.qh:38
float bot_pickup
Definition api.qh:43
float isbot
Definition api.qh:49
string cleanname
Definition api.qh:45
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
float bot_aiskill
Definition bot.qh:42
entity nextbot
Definition bot.qh:51
string netname_freeme
Definition bot.qh:55
const int AI_STATUS_JETPACK_LANDING
Definition bot.qh:16
const int AI_STATUS_ATTACKING
Definition bot.qh:7
const int AI_STATUS_OUT_JUMPPAD
Definition bot.qh:10
float createdtime
Definition bot.qh:61
float bot_aggresskill
Definition bot.qh:34
const int AI_STATUS_JETPACK_FLYING
Definition bot.qh:15
bool bot_fixcount(bool multiple_per_frame)
Definition bot.qc:623
void bot_custom_weapon_priority_setup()
Definition bot.qc:351
entity bot_list
Definition bot.qh:50
int aistatus
Definition bot.qh:20
float bot_pingskill
Definition bot.qh:31
float totalfrags_lastcheck
Definition bot.qh:44
float autoskill_nextthink
Definition bot.qh:25
const int AI_STATUS_RUNNING
Definition bot.qh:8
const int AI_STATUS_DANGER_AHEAD
Definition bot.qh:9
float bot_weaponskill
Definition bot.qh:33
float bot_rangepreference
Definition bot.qh:35
string playermodel_freeme
Definition bot.qh:56
float bot_config_loaded
Definition bot.qh:74
entity bot_strategytoken
Definition bot.qh:77
float bot_mouseskill
Definition bot.qh:39
float botframe_spawnedwaypoints
Definition bot.qh:79
float bot_distance_far
Definition bot.qh:47
float bot_nextthink
Definition bot.qh:59
void bot_think(entity this)
Definition bot.qc:62
float botframe_nextthink
Definition bot.qh:80
entity bot_spawn()
Definition bot.qc:45
void autoskill(float factor)
Definition bot.qc:569
float bot_thinkskill
Definition bot.qh:41
const int AI_STATUS_WAYPOINT_PERSONAL_LINKING
Definition bot.qh:12
int _content_type
Definition bot.qh:83
float bot_aimskill
Definition bot.qh:37
float bot_jump_time
Definition bot.qh:71
float bot_pickupbasevalue
Definition bot.qh:68
void bot_calculate_stepheightvec()
Definition bot.qc:615
float botframe_nextdangertime
Definition bot.qh:81
float bot_offsetskill
Definition bot.qh:38
const int AI_STATUS_ROAMING
Definition bot.qh:6
string playerskin_freeme
Definition bot.qh:57
bool bot_pickup_respawning
Definition bot.qh:69
void bot_setnameandstuff(entity this)
Definition bot.qc:163
void bot_removefromlargestteam()
Definition bot.qc:486
void bot_clientdisconnect(entity this)
Definition bot.qc:454
void bot_endgame()
Definition bot.qc:412
float bot_strategytoken_taken
Definition bot.qh:76
float bot_preferredcolors
Definition bot.qh:62
float bot_strategytime
Definition bot.qh:70
void bot_clientconnect(entity this)
Definition bot.qc:469
void bot_serverframe()
Definition bot.qc:689
float bot_dodgeskill
Definition bot.qh:29
float bot_distance_close
Definition bot.qh:48
const int AI_STATUS_WAYPOINT_PERSONAL_REACHED
Definition bot.qh:14
const int AI_STATUS_WAYPOINT_PERSONAL_GOING
Definition bot.qh:13
const int AI_STATUS_OUT_WATER
Definition bot.qh:11
const int AI_STATUS_STUCK
Definition bot.qh:17
void bot_removenewest()
Definition bot.qc:533
void bot_relinkplayerlist()
Definition bot.qc:424
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void havocbot_setupbot(entity this)
Definition havocbot.qc:1764
void
Definition self.qh:72