[Warlords] Python help

1984plusplus

Chieftain
Joined
May 23, 2011
Messages
59
Can anyone recommend me a good python guide that covers what code is where? I know enough about C++ and Java that the syntax isn't a problem. I just can't seem to locate the code that I'm trying to modify.

Particularly, I'm attempting to add a popup whenever one of my cities grown in population that gives me the option of going to the city screen, but I can't seem to find all the code for the other popups to structure mine after. Also, I'd like to make it so that resources that I already have still show up on the AI's side of the trade screen, just redded out, but I can't find the code for the trade screen either. I'd appreciate any help.
 
Thanks, I got the popup working. To be more clear, I was asking if anyone has made a guide that covers what the code in each file does. Most of the file names are pretty self explanatory, but some of them are less straightforward, and my high school C++ teacher would have deducted lots of points for insufficient commenting. I guess no one has though, as it would be a lot to cover.

Anyway, I've still had no luck locating the python code for the trade screen interface, so if anyone knows what file that's in, it would be really helpful. Or is it even in the python code. I assume it is since the whole interface is done in python, right? And to be clear, I mean the screen where you can trade resources, techs, cities, etc with a single AI or other player when I say trade screen.
 
but some of them are less straightforward, and my high school C++ teacher would have deducted lots of points for insufficient commenting.

You're not really wrong about this ^^ ;).

Anyway, I've still had no luck locating the python code for the trade screen interface, so if anyone knows what file that's in, it would be really helpful. Or is it even in the python code. I assume it is since the whole interface is done in python, right? And to be clear, I mean the screen where you can trade resources, techs, cities, etc with a single AI or other player when I say trade screen.

Sadly you're wrong on this part. That screen (or in general the whole diplomacy window) as well as the main menu are in the .exe and not done in Python.
 
It is possible to do some moding of what appears on the diplomacy screen. I know Caveman to Cosmos has added some stuff that can be traded (some units can be traded, and there are embassies to set up before opening borders). In regular BtS, resources that can be used by a corporation that you have are shown even if they are duplicates (but you can, or course, trade for them then) - this has to be triggered somewhere (although it could be in the EXE).

I have not looked, but there may be some function in the DLL that the EXE calls to build the list when it is needed. There are classes (and files) with names like CvDiploparameters and CvDeal. Checking the source code for places these are used could be helpful.
 
Back
Top Bottom