bots_loadout_rank

This commit is contained in:
INeedBots 2020-12-20 20:36:22 -06:00
parent 4f374c60e7
commit 9f327ec50b
3 changed files with 51 additions and 33 deletions

View File

@ -126,6 +126,8 @@ You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfar
- bots_loadout_allow_op - a boolean value (0 or 1), whether or not if the bots are allowed to use deathstreaks, noobtubes, rpg, laststand, etc. - bots_loadout_allow_op - a boolean value (0 or 1), whether or not if the bots are allowed to use deathstreaks, noobtubes, rpg, laststand, 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_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_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 - bots_play_fire - a boolean value (0 or 1), whether or not if the bots will fire their weapons

View File

@ -66,6 +66,8 @@ init()
setDvar("bots_loadout_reasonable", false); setDvar("bots_loadout_reasonable", false);
if(getDvar("bots_loadout_allow_op") == "")//allows jug, marty and laststand if(getDvar("bots_loadout_allow_op") == "")//allows jug, marty and laststand
setDvar("bots_loadout_allow_op", true); 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 if(getDvar("bots_play_move") == "")//bots move
setDvar("bots_play_move", true); setDvar("bots_play_move", true);

View File

@ -56,6 +56,11 @@ connected()
Gets an exp amount for the bot that is nearish the host's xp. Gets an exp amount for the bot that is nearish the host's xp.
*/ */
bot_get_rank() bot_get_rank()
{
rank = 1;
rank_dvar = getDvarInt("bots_loadout_rank");
if (rank_dvar == -1)
{ {
ranks = []; ranks = [];
bot_ranks = []; bot_ranks = [];
@ -99,6 +104,15 @@ bot_get_rank()
s = array_std_deviation( ranks, avg ); s = array_std_deviation( ranks, avg );
rank = Round( random_normal_distribution( avg, s, 0, level.maxRank ) ); rank = Round( random_normal_distribution( avg, s, 0, level.maxRank ) );
}
else if (rank_dvar == 0)
{
rank = Round( random_normal_distribution( 45, 20, 0, level.maxRank ) );
}
else
{
rank = Round( random_normal_distribution( rank_dvar, 5, 0, level.maxRank ) );
}
return maps\mp\gametypes\_rank::getRankInfoMinXP( rank ); return maps\mp\gametypes\_rank::getRankInfoMinXP( rank );
} }