Specifing plots in a Map Script

vbraun

Raytracing
Joined
Jul 7, 2003
Messages
3,530
Location
Arizona, USA
I want to make certain spots on a random map always be a Peak. I've looked through a couple Map Scripts and noticed in the Highland map script where it will change a mountain to a hill to avoid "pockets". Most notably are these seris of commands:
Code:
map = CyMap()
i = map.plotNum(x, y)
pPlot = map.plotByIndex(i)
pPlot.setPlotType(PlotTypes.PLOT_HILLS, true, true)

When I try those exact commands in the same function as the one in the Highland map (def assignStartingPlots()) nothing happens. Here is my code:
Code:
def assignStartingPlots():
        map = CyMap()
        i = map.plotNum(1,1)
        pPlot = map.plotByIndex(i)
        pPlot.setPlotType(PlotTypes.PLOT_PEAK, true, true)

Funny thing is, Using the ingame Python Window, This works. (Also map.plot(x,y).setPlotType(PlotTypes.PLOT_PEAK, true, true) )

So what am I missing? :confused:
 
I'am not sure but i think that there is some restrictions when these functions are called . So , in the function that call 'def assignStartingPlots()' i think default don't allow to change terrain. (because assigning starting plots need the map to be generated!)
i had the same problem adding units to the map in the 'def startHumansOnSameTile()' .

So ,you 'd better choose another function before 'def assignStartingPlots()' and use global variables in you want to associate your terrain change with the assign of starting plots.

I made some changes in the random map generator ,perhaps that could help you :
http://forums.civfanatics.com/showthread.php?t=151629

tcho!
 
Top Bottom