I'm currently trying to use the Resources.py file, that it used to spawns "dynamic resources" at set dates, to also spawn terrain improvements. Rhye has been helpful enough to include a template for this, but that isn't doing me much good since I really don't know my Python.
This is an example of code that spawns a Resource:

What should the syntax be, and should I specify (define?) any parameters somewhere? (I tried "iTown = con.iTown" but it did me no good.)
I also noticed that "iTown" has been given the value of 22 in Consts.py, but maybe that has nothing to do with this? I tried substituting the "iTown" with "22" but it didn't work either.
Can anyone help with this? Even a qualified guess would be appreciated!
This is an example of code that spawns a Resource:
And the template for improvements looks like this:gc.getMap().plot(71, 30).setBonusType(iSugar) #Egypt
So I'm thinking you use it something like this:setImprovementType(ImprovementType eNewValue)
But all it does is end the game on the first turn (#181 in this case since I'm using the 600AD start). Clearly I'm not using it right...gc.getMap().plot(68, 56).setImprovementType(ImprovementType iTown) #Novgorod

What should the syntax be, and should I specify (define?) any parameters somewhere? (I tried "iTown = con.iTown" but it did me no good.)
I also noticed that "iTown" has been given the value of 22 in Consts.py, but maybe that has nothing to do with this? I tried substituting the "iTown" with "22" but it didn't work either.
Can anyone help with this? Even a qualified guess would be appreciated!