38 CS_CVAR(
this).cvar_cl_accuracy_data_share = 1;
39 CS_CVAR(
this).cvar_cl_accuracy_data_receive = 0;
44 entity bot = spawnclient();
70 CS(
this).movement =
'0 0 0';
107 if (
time < game_starttime)
110 CS(
this).movement =
'0 0 0';
121 CS(
this).movement =
'0 0 0';
146 int file, tokens, prio;
159 int smallest_team = -1;
160 int smallest_count = -1;
169 if (smallest_count < 0 || count < smallest_count)
172 smallest_count =
count;
178 while((readfile =
fgets(file)))
193 bool conflict =
false;
195 if (s == it.cleanname)
208 if (!forced_team || forced_team == smallest_team)
217 string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
220 if(
argv(0) !=
"") bot_name =
argv(0);
221 else bot_name =
"Bot";
223 if(
argv(1) !=
"") bot_model =
argv(1);
226 if(
argv(2) !=
"") bot_skin =
argv(2);
242 #define READSKILL(f, w, r) MACRO_BEGIN \ 243 if(argv(prio) != "") \ 244 this.f = stof(argv(prio)) * w; \ 246 this.f = (!autocvar_g_campaign) * (2 * random() - 1) * r * w; \ 268 if (file >= 0 &&
argv(prio) !=
"")
291 if(it.cleanname == name)
303 bot_model =
strcat(bot_model,
".iqm");
310 static string bot_priority_far_prev;
311 static string bot_priority_mid_prev;
312 static string bot_priority_close_prev;
313 static string bot_priority_distances_prev;
344 #define PARSE_WEAPON_PRIORITIES(dist) MACRO_BEGIN \ 345 if (bot_priority_##dist##_prev != autocvar_bot_ai_custom_weapon_priority_##dist) { \ 346 strcpy(bot_priority_##dist##_prev, autocvar_bot_ai_custom_weapon_priority_##dist); \ 347 tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_##dist)," "); \ 348 bot_weapons_##dist[0] = -1; \ 350 for(i = 0; i < tokens && c < REGISTRY_COUNT(Weapons); ++i) { \ 352 if (w >= WEP_FIRST && w <= WEP_LAST) { \ 353 bot_weapons_##dist[c] = w; \ 357 if (c < REGISTRY_COUNT(Weapons)) \ 358 bot_weapons_##dist[c] = -1; \ 397 prevbot.nextbot = it;
406 prevbot.nextbot =
NULL;
471 besttime = it.createdtime;
478 thiscount = TeamBalance_GetNumberOfPlayers(balance,
479 Team_TeamToIndex(it.team));
482 if(thiscount > bestcount)
484 bestcount = thiscount;
485 besttime = it.createdtime;
488 else if(thiscount == bestcount && besttime < it.createdtime)
490 besttime = it.createdtime;
520 besttime = it.createdtime;
523 if(besttime < it.createdtime)
525 besttime = it.createdtime;
543 bestplayer =
max(bestplayer, it.totalfrags - it.totalfrags_lastcheck);
545 bestbot =
max(bestbot, it.totalfrags - it.totalfrags_lastcheck);
548 string msg =
strcat(
"autoskill: best player got ",
ftos(bestplayer),
", ""best bot got ",
ftos(bestbot),
"; ");
549 if(bestbot < 0 || bestplayer < 0)
551 msg =
strcat(msg,
"not doing anything");
554 else if(bestbot <= bestplayer * factor - 2)
558 msg =
strcat(msg,
"2 frags difference, increasing skill");
563 else if(bestbot >= bestplayer * factor + 2)
567 msg =
strcat(msg,
"2 frags difference, decreasing skill");
574 msg =
strcat(msg,
"not doing anything");
586 jumpheight_vec = (autocvar_sv_jumpvelocity ** 2) / (2 * autocvar_sv_gravity) *
'0 0 1';
593 int activerealplayers = 0;
596 activerealplayers =
M_ARGV(0,
int);
597 realplayers =
M_ARGV(1,
int);
620 bots =
max(minbots, minplayers - activerealplayers);
624 bots =
min(bots,
max(player_limit - activerealplayers, 0));
643 bprint(
"Can not add bot, server full.\n");
646 if (!multiple_per_frame)
695 float wpcost_update =
false;
697 wpcost_update =
true;
699 wpcost_update =
true;
743 waypoint_save_links();
777 if (!bot_strategytoken_save)
780 bot_strategytoken_save =
NULL;
#define PHYS_INPUT_BUTTON_ATCK2(s)
#define PHYS_INPUT_BUTTON_JUMP(s)
#define IL_EACH(this, cond, body)
void waypoint_updatecost_foralllinks()
#define PHYS_INPUT_BUTTON_CHAT(s)
#define PHYS_INPUT_BUTTON_CROUCH(s)
bool autocvar_bot_usemodelnames
float botframe_loadedforcedlinks
bool SetPlayerTeam(entity player, int team_index, int type)
Sets the team of the player.
#define PHYS_INPUT_BUTTON_DRAG(s)
string RandomSelection_chosen_string
void ClientConnect(entity this)
ClientConnect
#define PHYS_INPUT_BUTTON_HOOK(s)
float autoskill_nextthink
float bot_preferredcolors
ERASEABLE void RandomSelection_Init()
string autocvar_bot_ai_custom_weapon_priority_mid
void TeamBalance_Destroy(entity balance)
Destroy the team balance entity.
ClientState CS(Client this)
#define FOREACH_CLIENT(cond, body)
#define PHYS_INPUT_BUTTON_ZOOM(s)
bool Team_IsValidIndex(int index)
Returns whether the team index is valid.
string autocvar_bot_config_file
void bot_setclientfields(entity this)
#define RandomSelection_AddString(s, weight, priority)
string autocvar_bot_ai_custom_weapon_priority_close
bool bot_fixcount(bool multiple_per_frame)
void TeamBalance_JoinBestTeam(entity player)
Assigns the given player to a team that will make the game most balanced.
int autocvar_bot_vs_human
#define PARSE_WEAPON_PRIORITIES(dist)
#define autocvar_bot_prefix
string autocvar_bot_ai_custom_weapon_priority_distances
void navigation_goalrating_timeout_force(entity this)
Player has manually selected their team.
string playermodel_freeme
float botframe_cachedwaypointlinks
void bot_calculate_stepheightvec()
#define IS_REAL_CLIENT(v)
void bot_removefromlargestteam()
float autocvar_bot_ai_dangerdetectioninterval
float autocvar_bot_ai_bunnyhop_skilloffset
int autocvar_g_waypointeditor_auto
float botframe_spawnedwaypoints
void bot_clientconnect(entity this)
void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
bool waypointeditor_enabled
float bot_rangepreference
float autocvar_bot_ai_dangerdetectionupdates
const float MOVE_NOMONSTERS
void waypoint_load_hardwiredlinks()
void bot_think(entity this)
bool waypoint_load_links()
void bot_clientdisconnect(entity this)
bool navigation_goalrating_timeout(entity this)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void autoskill(float factor)
#define PHYS_INPUT_BUTTON_USE(s)
void TeamBalance_GetTeamCounts(entity balance, entity ignore)
Counts the number of players and various other information about each team.
#define autocvar_bot_suffix
void bot_custom_weapon_priority_setup()
float botframe_nextdangertime
#define PHYS_INPUT_BUTTON_ATCK(s)
void bot_setnameandstuff(entity this)
bool autocvar_bot_join_empty
IntrusiveList g_waypoints
entity bot_waypoint_queue_owner
bool campaign_bots_may_start
campaign mode: bots shall spawn but wait for the player to spawn before they do anything in other gam...
void navigation_unstuck(entity this)
float bot_navigation_movemode
float autocvar_skill_auto
void bot_relinkplayerlist()
void havocbot_setupbot(entity this)
#define tokenizebyseparator
#define MUTATOR_CALLHOOK(id,...)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
float havocbot_keyboardskill
void botframe_showwaypointlinks()
int TeamBalance_GetNumberOfPlayers(entity balance, int index)
Returns the number of players (both humans and bots) in a team.
bool intermission_running
string autocvar_bot_ai_custom_weapon_priority_far
const int AI_STATUS_STUCK
bool bot_ispaused(entity this)
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings...
int autocvar_minplayers_per_team
void botframe_updatedangerousobjects(float maxupdate)
void bot_clearqueue(entity bot)
#define READSKILL(f, w, r)
#define PHYS_INPUT_BUTTON_INFO(s)
bool autocvar_waypoint_benchmark
bool Team_IsValidTeam(int team_num)
Returns whether team value is valid.
float autocvar_bot_ai_thinkinterval
float bot_strategytoken_taken
bool autocvar_bot_navigation_ignoreplayers
void botframe_autowaypoints()