Call of Duty 5: Script Debugging
If you've encountered a message similar to the one in the image, you've run into a problem with your script.
You can fail-safe your script through various ways and/or use debug script functions to report any errors as you work on your map/mod.
Dvars
If you've run into an error but the engine error message is vague or does not specificy an exact script line, you may have Developer set to 0 (by default). Be sure to set Developer to 1 before you launch your map.
You may also want to set Developer_Script to 1 too, it is 0 by default. This will read any script between /# #/
-- it is explained below through examples.
Logfile
You may want to have a digital text copy of the engine error, which is where a Logfile comes in hand.
Also, you may run into nasty errors that freeze/crash the game depending on how servely bugged your script is, and may not get a chance to view the error within the game. A Logfile will generate a digital copy of the error report in a text file for your convenience when you can't view the error in-game.
You can set it by command line:
+set logfile #
You can set it via the console:
/logfile #
Value | Description |
---|---|
0 | Disable |
1 | Async Write |
2 | Sync Every Write |
Defined vs Undefined
Asserts
Developer Script
Common Tips
Sources: Treyarch's Wiki