Adding Civs

Molybdeus

Prince
Joined
Jul 30, 2006
Messages
528
I'd like to create a map script that adds a number of minor civs on tiny, isolated continents. But I can't find a way to add new civs with python. I first looked for a refence to colony creation in the python files, but I can't find any and now assume the .exe file handles it.

Has anyone else added civs using python?
 
To add a civ with python, you have several ways :
  • found a city for that civ, and it'll be created (in CyPlayer) :
    Code:
    CyCity initCity (int plotX, int plotY)
    initCity( plotX, plotY ) - spawns a city at x,y
  • create un new unit (a Settler) for that civ, and it'll be created (in CyPlayer) :
    Code:
    CyUnit initUnit (UnitType iIndex, int plotX, int plotY, UnitAIType iIndex, DirectionType iIndex)
    CyUnit* initUnit(UnitTypes iIndex, plotX, plotY, UnitAITypes iIndex) - place Unit at X,Y NOTE: Always use UnitAITypes.NO_UNITAI
  • and I suppose (I didn't tested it) that using the python function "addPlayer" should add a new civ (in CyGame) :
    Code:
    void addPlayer (int eNewPlayer, int eNewTeam, int eLeader, int eCiv) BtS Only
    void (int eNewPlayer, int eNewTeam, int eLeader, int eCiv)

If your player is defined in your map file, but not yet used in game, the player will appear when you decide it, via python.
 
I am a little confused by the eNewPlayer int for addPlayer. If this creates a new player, surely I don't have to pass it an existing player to create, right?
 
I am a little confused by the eNewPlayer int for addPlayer. If this creates a new player, surely I don't have to pass it an existing player to create, right?

eNewPlayer is the number the new player will have. Passing it the number of an existing player would be a bad idea, pass it a number which isn't used yet.
 
Back
Top Bottom