Debugging tips: Difference between revisions
m (1 revision imported) |
No edit summary |
||
Line 45: | Line 45: | ||
/bot dbg_scriptgoals | /bot dbg_scriptgoals | ||
The 2nd way is to edit the game autoexec file i.e. | The 2nd way is to create or edit the game autoexec file i.e. | ||
~\et\scripts\ | ~\et\scripts\et_autoexec_user.gm | ||
~\rtcw\scripts\ | ~\rtcw\scripts\rtcw_autoexec_user.gm | ||
~\d3\scripts\d3_autoexec.gm | ~\d3\scripts\d3_autoexec.gm | ||
~\q4\scripts\q4_autoexec.gm | ~\q4\scripts\q4_autoexec.gm |
Latest revision as of 14:54, 12 June 2023
Omni-Bot_Map_Scripting | Debugging Tips |
Finding Basic Script Errors
The biggest problem with scripting is that we are all human & we make mistakes (errors).
There are 2 main ways to find out if your script has errors:
The 1st way is to use the inbuilt debugger in notepad++ (CTRL+F9), this lists the 1st error it finds in the script.
The 2nd way is to run the map & open the console, this also lists the 1st error it finds in the script & prints the error in red with the aproximate line in brackets (123). The console will also list any incorrect goal names you have used.
Full Debugging
By Default the "debug flags" are set to false as they are not needed when playing with omni-bot.
Note: If Map.Debug is true, then all debug flags (except DEBUG_SCRIPT_GOALS_FILTER) are ignored and all debug messages are printed.
The 1st flag is "DEBUG_MAP_SCRIPTS". This will print the messages when "Util.MapDebugPrint" is used.
The 2nd flag is "DEBUG_GOAL_AVAILABILITY". This will also print in console a list of all currently available goals when "Util.MapDebugPrint" is used and the second parameter of "Util.MapDebugPrint" is not true.
The 3rd flag is "DEBUG_SCRIPT_GOALS". This will print error messages when "Util.ScriptDebugPrint" is used. These messages can be filtered by DEBUG_SCRIPT_GOALS_FILTER.
There are 2 ways to enable/disable these.
The 1st is via the console
/bot dbg_mapscripts /bot dbg_goalavailability /bot dbg_scriptgoals
The 2nd way is to create or edit the game autoexec file i.e.
~\et\scripts\et_autoexec_user.gm ~\rtcw\scripts\rtcw_autoexec_user.gm ~\d3\scripts\d3_autoexec.gm ~\q4\scripts\q4_autoexec.gm
Change the statements from false to true so they look like this:
// global debug flags
global DEBUG_MAP_SCRIPTS = true;
global DEBUG_GOAL_AVAILABILITY = true;
global DEBUG_SCRIPT_GOALS = true;
DEBUG_SCRIPT_GOALS_FILTER["pathfailed"] = 1;
DEBUG_SCRIPT_GOALS_FILTER["timedout"] = 1;
DEBUG_SCRIPT_GOALS_FILTER["disabled"] = 1;
DEBUG_SCRIPT_GOALS_FILTER["regiontrigger"] = 1;
DEBUG_SCRIPT_GOALS_FILTER["initialized"] = 1;