kevinman4404
Lightning Warrior
This is for my mod component which emulates monthly snow cover. There is one map of values (like the ones from AIWars and CityNames from RFC), which has a value depending on the type of terrain its on and what month it gets covered in snow. For example month 1, the first month after July (August), when snow starts to advance, 10(tundra), 20(thinsoil) and 30(grasslands) are all changed to snow. These terrains are all labeled with different numbers so I can convert them back to their original terrain in the spring. Then month 2 (September) 40, 50 and 60 are covered with snow. Etc.
Here's some code
What I really need is to know how to say:
"If game turn = X or ever X turns after"
ie
"If game turn = X or every 48 turns (one year for this mod's purposes) after, change all the terrains to what they should be at this time"
This is because I don't want it to do it just on that one turn, I want it to change the terrains every year (48 turns)
If I can get that written I should easily have a working mod component.
Also let me know if you see any glaring errors so far.
Thank you
Kevin
Here's some code
Code:
if iGameTurn == 2:
if (iTerrain != iCoast and iTerrain != iCoastFrozen):
snowCover = tCityMap[67-pPlot.getY()][pPlot.getX()]
if (snowCover != "10"):
pPlot.setTerrainType(iSnow,True,True)
if iFeature == iForest:
pPlot.setFeatureType(iForest,2)
elif (snowCover != "20"):
pPlot.setTerrainType(iSnow,True,True)
if iFeature == iForest:
pPlot.setFeatureType(iForest,2)
elif (snowCover != "30"):
pPlot.setTerrainType(iSnow,True,True)
if iFeature == iForest:
pPlot.setFeatureType(iForest,2)
What I really need is to know how to say:
"If game turn = X or ever X turns after"
ie
"If game turn = X or every 48 turns (one year for this mod's purposes) after, change all the terrains to what they should be at this time"
This is because I don't want it to do it just on that one turn, I want it to change the terrains every year (48 turns)
If I can get that written I should easily have a working mod component.
Also let me know if you see any glaring errors so far.
Thank you
Kevin