debugging guide base added for mp

This commit is contained in:
JezuzLizard 2020-04-29 10:41:33 -07:00
parent c53abf5d1f
commit c720f7d82f
3 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,64 @@
#include maps/mp/_utility;
#include maps/common_scripts/utility;
init()
{
debug_tracker();
}
debug_tracker()
{
numberOfScriptsBeingLogged = 0;
if ( getDvarIntDefault( "debugModTestBotsEnabled", 0 ) == 1 )
{
level thread add_bots();
}
level.errorDisplayLevel = getDvarIntDefault( "debugModErrorDisplay", 0 ); //Use this to choose what is written to the log
//Error levels:
//0 - Display all types of log messages
//1 - Display only errors
//2 - Display only warnings
//3 - Display only info
}
add_bots()
{
//Wait for the host!
players = get_players();
while ( players.size < 1 )
{
players = get_players();
wait 1;
}
//Then spawn bots
botsToSpawn = getDvarIntDefault( "debugModBotsToSpawn", 1 )
for ( currentBots = 0; currentBots < botsToSpawn; currentBots++ )
{
bot_spawn();
wait 1;
}
SetDvar("bot_AllowMovement", "1");
SetDvar("bot_PressAttackBtn", "1");
SetDvar("bot_PressMeleeBtn", "1");
}
bot_spawn()
{
bot = AddTestClient();
if ( !IsDefined( bot ) )
{
return;
}
bot.pers["isBot"] = true;
bot.equipment_enabled = false;
return bot;
}

View File

@ -44,6 +44,9 @@ If you would like to debug a script that isn't already supported use this templa
``` ```
//begin debug code //begin debug code
level.custom_GSC_FILE_NAME_loaded = 1; level.custom_GSC_FILE_NAME_loaded = 1;
//if mp
maps/mp/gametypes/_clientids::init();
//if zm
maps/mp/zombies/_zm_bot::init(); maps/mp/zombies/_zm_bot::init();
if ( !isDefined( level.debugLogging_GSC_FILE_NAME ) ) if ( !isDefined( level.debugLogging_GSC_FILE_NAME ) )
{ {