bots_loadout_rank dvar

This commit is contained in:
INeedBots 2020-12-20 20:41:07 -06:00
parent 0a2ad28468
commit 10751e2e65
3 changed files with 51 additions and 33 deletions

View File

@ -123,6 +123,8 @@ Pressing the menu button again closes menus.
- bots_loadout_allow_op - a boolean value (0 or 1), whether or not if the bots are allowed to use jug, marty, etc.
- bots_loadout_rank - an integer number, bots will be around this rank, -1 is average of all players in game, 0 is all random
- bots_play_move - a boolean value (0 or 1), whether or not if the bots will move
- bots_play_knife - a boolean value (0 or 1), whether or not if the bots will use the knife
- bots_play_fire - a boolean value (0 or 1), whether or not if the bots will fire their weapons

View File

@ -60,6 +60,8 @@ init()
setDvar("bots_loadout_reasonable", false);
if(getDvar("bots_loadout_allow_op") == "")//allows jug, marty and laststand
setDvar("bots_loadout_allow_op", true);
if(getDvar("bots_loadout_rank") == "")// what rank the bots should be around, -1 is around the players, 0 is all random
setDvar("bots_loadout_rank", -1);
if(getDvar("bots_play_move") == "")//bots move
setDvar("bots_play_move", true);

View File

@ -815,6 +815,11 @@ get_random_weapon(groups, rank)
*/
bot_get_rank()
{
rank = 1;
rank_dvar = getDvarInt("bots_loadout_rank");
if (rank_dvar == -1)
{
ranks = [];
bot_ranks = [];
human_ranks = [];
@ -857,6 +862,15 @@ bot_get_rank()
s = array_std_deviation( ranks, avg );
rank = Round( random_normal_distribution( avg, s, 0, level.maxRank ) );
}
else if (rank_dvar == 0)
{
rank = Round( random_normal_distribution( 35, 15, 0, level.maxRank ) );
}
else
{
rank = Round( random_normal_distribution( rank_dvar, 5, 0, level.maxRank ) );
}
return maps\mp\gametypes\_rank::getRankInfoMinXP( rank );
}