How to insert debug messages?

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
What's the easiest way to display a message for debugging a script? I want to check some things like if an onBeginPlayerTurn event is firing and which way an if statement is going.
 
I usually use
Code:
popup = PyPopup.PyPopup()
popup.launch()
Can also add popup.setBodyString(somestring) inbetween if neccessary. Don't know if this is actually the easiest but atleast it works :p
(Except there seems to be a bug if you have too many popups, or atleast was pre patch.)
 
I use Stone-D's SD-toolkit for some debug messages (mainly checking values at certain stages of the code to make sure it's doing what I think it is), and the inbuilt python error messages for error checking.

I find the SD-toolkit good, as it prints the message/value up in the top left, as well as in the log, while in the inbuilt "PyPrint" function only does it in the log.
 
I use

CvUtil.pyPrint("debug text")

Then open up My Games\civ 4\logs directory and open up PythonDbg, PythonErr and PythonErr2 logs, which are the files that the output is sent to.
 
Back
Top Bottom