• In anticipation of the possible announcement of Civilization 7, we have decided to already create the Civ7 forum. For more info please check the forum here .

How To Add City Conquest Victory Condition

Louis the XIV

Sun King
Joined
Jun 23, 2020
Messages
837
Location
Court of Versailles
I'm trying to create a victory condition for my Crusader mod that is something like this, if a civilization controls Jerusalem, Mecca, Constantinople, Cairo, Damascus then that civ wins the game.
I was thinking the python code should look something like this but I'm not sure if it's enough.
Code:
        if (pCity.getX(), pCity.getY()) == (1, 9) and (1, 1) and (1, 2) and (1, 3) and (1, 4):
                gc.getGame().setWinner(iNewOwner, 7)
If anyone sees this thread please help me fix the bit of python.
Thanks in advance!
 
You could write
Code:
pCity1 = CyMap().plot(1,9)
pCity2 = CyMap().plot(1,1)
pCity3 = CyMap().plot(1,2)
pCity4 = CyMap().plot(1,3)
pCity5 = CyMap().plot(1,4)

if pCity1.getOwner == iNewOwner and pCity2.getOwner == iNewOwner and pCity3.getOwner == iNewOwner and pCity4.getOwner == iNewOwner and pCity5.getOwner == iNewOwner:
        gc.getGame().setWinner(pCity1.getOwner(), 7)

If you download my scenario https://forums.civfanatics.com/resources/year-of-the-four-emperors-68-69-d-c-warlords.28006/, there's the code you're looking for in CvEventManager file
 
Thanks! Is the Italian Communes mod for BTS? Because when I open it in BTS it gives me a bunch of errors. Also why is it Owner 7? Is it only for team 7?

No. It's the mod "Year of the four emperors" for warlords. 7 isn't the owner. 7 is the victory condition I added in file CIV4VictoryInfo.xml
 
Top Bottom