I'm trying to manipulate control of a plot through python, but not with much luck. I can change it over with plot.setOwner(playerID) but it will flip as soon as the game rechecks culture for each civ. I'm trying to set culture for the tile on a per-civ basis.
I started a game, plopped down my settler and worldbuildered in a settler 2 squares away for Kublai... after he founded next turn, I WB'd 500 culture into his city. He now has control of the square directly below my city (25, 21). This is the code (as entered in the python console to test this) that isn't working for me.
The python reference on this site shows that CyPlot has a .setCulture function with player ID and culture ints as arguments, but I get 'TypeError: this constructor takes no arguments' when I try this. Does anyone know a way to pragmatically set the culture of a given plot?
Also, if anyone is wondering why I need this, I'm making a diplomacy mod that will allow a 'Respect the borders of [some city]' as a trade item. When this border agreement is in effect, the game will check culture levels for all civs in each plot in the city's fat cross and if 'plotGiver' is #1 and 'cityOwner' is #2, 'plotGiver' will concede the plot to 'cityOwner'. Each turn, I'll increment stored amounts for each plot so that correct cultural levels can be restored when/if the agreement ends.
-Jamison
I started a game, plopped down my settler and worldbuildered in a settler 2 squares away for Kublai... after he founded next turn, I WB'd 500 culture into his city. He now has control of the square directly below my city (25, 21). This is the code (as entered in the python console to test this) that isn't working for me.
Code:
plot = CyMap().plot(25, 21) plot.setCulture(0, 1000)
Also, if anyone is wondering why I need this, I'm making a diplomacy mod that will allow a 'Respect the borders of [some city]' as a trade item. When this border agreement is in effect, the game will check culture levels for all civs in each plot in the city's fat cross and if 'plotGiver' is #1 and 'cityOwner' is #2, 'plotGiver' will concede the plot to 'cityOwner'. Each turn, I'll increment stored amounts for each plot so that correct cultural levels can be restored when/if the agreement ends.
-Jamison
Comment