SDK or phython

Minority

Chieftain
Joined
Jun 14, 2012
Messages
2
Hi,

I want to make a mod to change sieges, allowing a city to be surrounded by invaders and starved out, as a way to counter archer death stacks.
Would this be better done in python, or the SDK?
I was thinking of each city having an attrition value based on population and current tech level, which determines how long the city can hold out for under siege.
I'm not after step by step instructions on how to do this, but some pointers on where to start would be great. :)
I have a basic idea of python and XML, having a lot of experience in HTML and C++, so the issue isn't so much how to program.

Thanks.
 
Hi,

I want to make a mod to change sieges, allowing a city to be surrounded by invaders and starved out, as a way to counter archer death stacks.
Would this be better done in python, or the SDK?
I was thinking of each city having an attrition value based on population and current tech level, which determines how long the city can hold out for under siege.
I'm not after step by step instructions on how to do this, but some pointers on where to start would be great. :)
I have a basic idea of python and XML, having a lot of experience in HTML and C++, so the issue isn't so much how to program.

Thanks.

If you want to starve out a city, you can use the age old tactic of pillaging. If you pillage surrounding plots of a city that have developed food resources, Corn, Wheat, Rice, Pigs, Sheep and Deer; then you can starve out a city and watch the population start dropping. If the city workers are deployed to develop the resource again, then attack and capture the workers. Just an idea.
 
Currently all that would achieve would be to weaken the city's production. The idea is to build on this and cause the city to eventually surrender with out having to kill all troops stationed there.
 
It could be done in python but it would be much better to do it in the SDK.

Setting up SDK for compiling. There are other guides too, just look around the forum.

Once you have that set up you'll probably want to add a new XML entry to specify how much each tech should increase how long the city can hold out. There's a guide for adding new XML entires here.

You might want to add a GlobalDefine (also xml) which control how much each population point increase the value. GlobalDefines are a little bit different but you should be able to figure it out. Start at CvGlobals::cacheGlobals. Use GlobalDefinesAlt.xml for your mod, that way you only need to include the variables you have changed or added.

You'll probably want to add the actual attrition code somewhere in CvCity::doTurn.


As for making the AI understand the changes, that will be the big challenge. That you'll need to figure out/decide yourself how you want to do it.
 
Back
Top Bottom