Python coders, is this possible?

woodelf

Bard
Retired Moderator
Joined
Jun 12, 2003
Messages
15,036
Location
Gallery
I'm wondering if it would be possible to code a unit who's sole function is to create a culture border onto a tile. For our SMAC mod we have the default cities owning 1 tile to signify a desperate struggle to survive. Sadly when our culture does expand it gives the entire 8 more tiles. What if a terraforming unit could work an adjacent tile over time and when finished your border now encompassed that tile? Painstakingly your colony could expand and these units would have to be expensive.

My concern isn't with the AI yet, but whether this is even possible.

Thoughts? Ideas? Volunteers? ;)
 
The Great Apple said:
I think it's possible - you just set the plot so that is has one culture of the people you want to own it.

*ahem*

Care to take a crack at it? :D

Also, would it be possible to only allow it on adjacent tiles? You can create checks for that, correct?
 
Unless it's changed in the last patch if you make someone own a plot with python it'll change back as soon as the c++ part checks the plot for culture... which it does alot.

The good news is this doesn't make it impossible. You can take a look at Paaskys WWII mod, the culture border of all the cities are controlled with python. Ofcourse that's much easier, knowing where the cities are and non changing borders*, but it should help you get started. Specificly you'll need to return True in doPlotCulture in CvGameUtils to stop the game from doing it's own thing.

Still, I recommend using the SDK for this. It should be less to code, you don't need to rewrite the whole culture to plots code, just add to it.


*the border of each city doesn't change. The border of nations may change as cities change hands.
 
snarko said:
Unless it's changed in the last patch if you make someone own a plot with python it'll change back as soon as the c++ part checks the plot for culture... which it does alot.

The good news is this doesn't make it impossible. You can take a look at Paaskys WWII mod, the culture border of all the cities are controlled with python. Ofcourse that's much easier, knowing where the cities are and non changing borders*, but it should help you get started. Specificly you'll need to return True in doPlotCulture in CvGameUtils to stop the game from doing it's own thing.

Still, I recommend using the SDK for this. It should be less to code, you don't need to rewrite the whole culture to plots code, just add to it.


*the border of each city doesn't change. The border of nations may change as cities change hands.

Thanks snarko. I was looking for a brave soul to dabble with it, but I guess this would be a reason to try, eventually.
 
Back
Top Bottom