Debugging Techniques: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (→‎Simplifying: updated some text)
Line 16: Line 16:
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''' [http://www.mapfact.net/include.php?path=content/download_eng.php&contentid=282 Binary gamefile viewer].
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''' [http://www.mapfact.net/include.php?path=content/download_eng.php&contentid=282 Binary gamefile viewer].


==Simplifying==
==Keep it simple==


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 your having great difficulty solving a problem, simplify the problem, take the part of the mission which does not work paste it into a new test mission, so that you don't have to watch/whatever the effect of the whole rest of the script(s).  


== Addon Tips ==
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.
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.

Revision as of 02:43, 3 July 2006

Introduction

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 using hints.


Vektorboson released a 'debugging console for advanced users that is very helpful at debugging your scripting in real time.

Download

Documentation on using the console can be found http://home.arcor.de/vektorboson/res/console2.0docs.zip here).

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.

Keep it simple

If your having great difficulty solving a problem, simplify the problem, take the part of the mission which does not work paste it into a new test mission, so that you don't have to watch/whatever the effect of the whole rest of the script(s).

Addon Tips

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.