So I finished my Python mod. How do I hunt for bugs.

Chronis

Warlord
Joined
Feb 3, 2011
Messages
102
So I just finished my first python mod. Well it was more of a significant change to an existing mod but regardless.

I made a lot of changes that all seem to work but I wanted to do some more extensive testing.

If I autorun the game how do it get it to collect any python errors that come up and save them so I can look them over.
 
So I just finished my first python mod. Well it was more of a significant change to an existing mod but regardless.

I made a lot of changes that all seem to work but I wanted to do some more extensive testing.

If I autorun the game how do it get it to collect any python errors that come up and save them so I can look them over.

In the CivilizationIV.ini there is the following;

Code:
; Set to 1 for no python exception popups
HidePythonExceptions = 1

Set that to 0 and if something goes wrong in Python it will give you a big popup saying what happened.
 
That will just tell you what are the obvious errors in the codes like indentation, undefined variables etc.

You will not catch any logic errors from it because logic errors happen when the codes are perfectly fine, just that they do not do what they are supposed to do sometimes.

Example
A trait that grants free special building to cities.
You need to test manually whether
1) it really works in normal condition
2) can the building be destroyed by nukes, spies etc
3) is it applied/ removed to newly captured cities
4) what if a liberated colony starts with that trait
5) does it interface with existing codes

These are questions you should ask yourself and test each situation.
 
That will just tell you what are the obvious errors in the codes like indentation, undefined variables etc.

You will not catch any logic errors from it because logic errors happen when the codes are perfectly fine, just that they do not do what they are supposed to do sometimes.

Example
A trait that grants free special building to cities.
You need to test manually whether
1) it really works in normal condition
2) can the building be destroyed by nukes, spies etc
3) is it applied/ removed to newly captured cities
4) what if a liberated colony starts with that trait
5) does it interface with existing codes

These are questions you should ask yourself and test each situation.

Well he was asking how to find errors, I assume he knows how to test specific situations using the WB or something.
 
Logic errors are still errors, in fact the worst of them all.
The others, you get error messages while you will not notice logic errors happening until you notice something weird.

Then you won't even know which part of the python is causing them since he already made huge changes.
 
Back
Top Bottom