proper way to initialize city? python/mapscript?

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
I have a mapscript, not a pre-made scenario file. I want all the players to start out with a city already founded rather than starting with a settler. I can do this with a couple of lines of python in onGameStart:

Code:
      for iPlay in range(self.gc.getMAX_CIV_PLAYERS()):
         pPlay = self.gc.getPlayer(iPlay)
         if (pPlay.isAlive()):
            civid = pPlay.getCivilizationType()
            pPlot = pPlay.getStartingPlot()
            name = gc.getCivilizationInfo(civid).getCityNames(0)
            pPlay.found(pPlot.getX(), pPlot.getY())
            pPlay.getCity(0).setName(name, true)

This fires the onCityBuilt method which by default throws the "Enter City Name" dialog at the user. I can avoid that by setting a global variable while I am doing this, and in onCityBuilt, don't call the parent function if the global is set.

So far so good. But my problem is, the next thing that fires is the dialog which asks what I want to build in this city. So when the user starts the game, they are presented with this *modal* dialog. They cannot scroll or look at the map until they deal with it. That is not what I want.

How can I have the city start up, and *not* throw modal dialogs at the player? I would be happy if the initial build queue was empty, so the player could fill it after looking around at the map and the civilopedia.
 
Is it possible and what would be wrong with just setting each city to build some default, like a warrior? The player could change the build item before hitting the "next turn."
 
Back
Top Bottom