Debugging python / XML on the fly

Michelangelo said:
IIRC it should be possible to edit the python files while CIV4 is running and see the effects immediately. However this doesn't work and I have to reload CIV4 completely to see the effects.

Is my memory letting me down or if not, how to do this.

In general it works, modifications to existing functions. But if they are dramatic changes I have gotten crashes.

You always have to reload CIV4 for xml changes to take effect.
 
When you save the python file then switch windows back to Civ4, does it give you a little message saying "Python files reloaded"? If not, you might want to check that you're editting the right python files (with so many assets and custom assets directories, and sometimes the possiblity of having more than one python file open at once, it can get confusing. I've definetely been modifying a file that wasn't part of the mod I currently had loaded, but was just using as a reference, and couldn't figure out why when I saved the file that the code was't reloading. ). If you are getting the message, but nothing is changing, then your code is probably not doing what you expect it to.

I haven't had any other trouble with python files not reloading. And as Kael said, most XML files require a reload. I think opening the console and doing something like XML.reloadTextFiles or something like that (type help and look for the XML functions) will be able to reload some of the XML files (like just the art XML's, or just the text XML's).
 
Back
Top Bottom