From ec65a5e75d7b02c1d616b8c30794f8fd0f0201d0 Mon Sep 17 00:00:00 2001 From: INeedBots Date: Mon, 28 Dec 2020 10:22:47 -0600 Subject: [PATCH] bots_main_waitForHostTime --- README.md | 8 +++++--- main_shared/maps/mp/bots/_bot.gsc | 2 ++ main_shared/maps/mp/bots/_bot_utility.gsc | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f51e1c0..0a554de 100644 --- a/README.md +++ b/README.md @@ -69,11 +69,11 @@ Make sure to disable this DVAR by adding ```set bots_main_firstIsHost 0``` in yo ## Documentation ### Menu Usage -You can open the menu by pressing the primary grenade and secondary grenade buttons together. +- You can open the menu by pressing the primary grenade and secondary grenade buttons together. -You can navigate the options by the pressing the ADS and fire keys, and you can select options by pressing your melee key. +- You can navigate the options by the pressing the ADS and fire keys, and you can select options by pressing your melee key. -Pressing the menu button again closes menus. +- Pressing the menu button again closes menus. ### DVARs - bots_manage_add - an integer amount of bots to add to the game, resets to 0 once the bots have been added. @@ -153,6 +153,8 @@ Pressing the menu button again closes menus. - bots_main_GUIDs - a list of GUIDs (comma seperated) of players who will be considered a host +- bots_main_waitForHostTime - a float value, how long in seconds to wait for the host player to connect before adding in bots + - bots_main_menu - a boolean value (0 or 1), enables or disables the menu - bots_main_debug - a boolean value (0 or 1), enables or disables the waypoint editor diff --git a/main_shared/maps/mp/bots/_bot.gsc b/main_shared/maps/mp/bots/_bot.gsc index 9985160..ec3969b 100644 --- a/main_shared/maps/mp/bots/_bot.gsc +++ b/main_shared/maps/mp/bots/_bot.gsc @@ -24,6 +24,8 @@ init() setDvar("bots_main_GUIDs", "");//guids of players who will be given host powers, comma seperated if(getDvar("bots_main_firstIsHost") == "") setDvar("bots_main_firstIsHost", true);//first player to connect is a host + if(getDvar("bots_main_waitForHostTime") == "") + setDvar("bots_main_waitForHostTime", 10.0);//how long to wait to wait for the host player if(getDvar("bots_manage_add") == "") setDvar("bots_manage_add", 0);//amount of bots to add to the game diff --git a/main_shared/maps/mp/bots/_bot_utility.gsc b/main_shared/maps/mp/bots/_bot_utility.gsc index c74dcdd..3d8e43d 100644 --- a/main_shared/maps/mp/bots/_bot_utility.gsc +++ b/main_shared/maps/mp/bots/_bot_utility.gsc @@ -718,7 +718,7 @@ bot_wait_for_host() while (!isDefined(level) || !isDefined(level.players)) wait 0.05; - for(i = 0; i < 100; i++) + for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05) { host = GetHostPlayer(); @@ -731,7 +731,7 @@ bot_wait_for_host() if(!isDefined(host)) return; - for(i = 0; i < 100; i++) + for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05) { if(IsDefined( host.pers[ "team" ] )) break; @@ -742,7 +742,7 @@ bot_wait_for_host() if(!IsDefined( host.pers[ "team" ] )) return; - for(i = 0; i < 100; i++) + for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05) { if(host.pers[ "team" ] == "allies" || host.pers[ "team" ] == "axis") break;