From c720f7d82f85739af4cfe131f276ec85d6945cc0 Mon Sep 17 00:00:00 2001 From: JezuzLizard Date: Wed, 29 Apr 2020 10:41:33 -0700 Subject: [PATCH] debugging guide base added for mp --- debugging mod/mp/_clientids.gsc | 64 ++++++++++++++++++++++++++++++ debugging mod/readme.md | 3 ++ debugging mod/{ => zm}/_zm_bot.gsc | 0 3 files changed, 67 insertions(+) create mode 100644 debugging mod/mp/_clientids.gsc rename debugging mod/{ => zm}/_zm_bot.gsc (100%) diff --git a/debugging mod/mp/_clientids.gsc b/debugging mod/mp/_clientids.gsc new file mode 100644 index 0000000..59c54e5 --- /dev/null +++ b/debugging mod/mp/_clientids.gsc @@ -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; +} + + + + + + + + diff --git a/debugging mod/readme.md b/debugging mod/readme.md index 448c3d7..9ce47e0 100644 --- a/debugging mod/readme.md +++ b/debugging mod/readme.md @@ -44,6 +44,9 @@ If you would like to debug a script that isn't already supported use this templa ``` //begin debug code level.custom_GSC_FILE_NAME_loaded = 1; +//if mp +maps/mp/gametypes/_clientids::init(); +//if zm maps/mp/zombies/_zm_bot::init(); if ( !isDefined( level.debugLogging_GSC_FILE_NAME ) ) { diff --git a/debugging mod/_zm_bot.gsc b/debugging mod/zm/_zm_bot.gsc similarity index 100% rename from debugging mod/_zm_bot.gsc rename to debugging mod/zm/_zm_bot.gsc