mirror of
https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer.git
synced 2025-06-07 17:37:50 -05:00
debugging guide base added for mp
This commit is contained in:
parent
c53abf5d1f
commit
c720f7d82f
64
debugging mod/mp/_clientids.gsc
Normal file
64
debugging mod/mp/_clientids.gsc
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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 ) )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user