Debugging Techniques

From Bohemia Interactive Community
Revision as of 21:54, 2 July 2006 by Raedor (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

These techniques should help you to find bugs faster when you're scripting.

Hints

If something is not working, check which variables could be wrong, check the output of the variables with hints.

You can also use Debugging Consoles for that, like the one by vektorboson ([Download http://home.arcor.de/vektorboson/res/console2.0.zip], [Documentation http://home.arcor.de/vektorboson/res/console2.0docs.zip]).

If you're at an advanced stage of a project, you can save the game when the bug appears and check the variable and script states with Chain of Command's Binary gamefile viewer.


Simplifying

Try to simplify the problem, take the part which does not work out in an extra test mission, so that you don't have to watch/whatever the effect of the whole rest of the script(s).

If you're scripting for an addon, don't pack the scripts in the PBO, as you have to restart after every change, make a test mission with the script included there.