Announcement

Collapse
No announcement yet.

Problem with culture

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with culture

    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.

    Code:
    plot = CyMap().plot(25, 21)
    plot.setCulture(0, 1000)
    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

  • #2
    Solved

    After looking over Bhuric's cultural decay mod, I've found the solution...

    pCity.changeCulture(iPlayer, iAmount, False)
    pCity.setCulture(iPlayer, iAmount, False)

    are the proper function calls, changeCulture to add or subtract iAmount, setCulture to set it to iAmount.

    Just thought I'd post here in case anyone else had the same problem.

    Comment

    Working...
    X