Declare War unless have Capital and able to Open Borders

vincentz

Programmer
Joined
Feb 4, 2009
Messages
3,614
Location
Denmark
A quickie (I hope ;))

In my mod, the Palace isn't instabuilt when first city is founded, and can be build later with Masonry.

I wanted to make civs not be able to negotiate peace before a Capital is present AND the civs are able to negotiate Open Borders (not that they HAVE to make Open Borders or be friendly enough to do so, but more of a formalia that the civs are civil enough to actually negotiate a peace process.

I thought about doing a check in CvDiplomacy.py, but need help with Language.

Line 44 :

Code:
		# If this is the first time we are being contacted by the AI
		elif (self.isComment(eComment, "AI_DIPLOCOMMENT_FIRST_CONTACT") ):

			# if you are on different teams and NOT at war, give the user the option to declare war
			if (gc.getTeam(gc.getGame().getActiveTeam()).canDeclareWar(gc.getPlayer(self.diploScreen.getWhoTradingWith()).getTeam())):
				self.addUserComment("USER_DIPLOCOMMENT_WAR", -1, -1)

			# We say hi and begin our peace
			if (gc.getTeam(gc.getGame().getActiveTeam()).canOpenBorder(gc.getPlayer(self.diploScreen.getWhoTradingWith()).getTeam()))
 			AND (gc.getTeam(gc.getGame().getActiveTeam()).haveCapital AND (gc.getPlayer(self.diploScreen.getWhoTradingWith()).getTeam()).haveCapital):
				self.addUserComment("USER_DIPLOCOMMENT_PEACE", -1, -1)

			self.diploScreen.endTrade()

This is obvious wrong, thats why I need YOUR help :D

Thanks in advance
Vincentz


Edit : well, this only works for Human players :(
 
What would be the added value?

You meet a Civ for the first time and if the conditions are met, you can declare war (or not, meaning you chose peace).

If you don't want war and cannot chose peace, then what?
 
Ah, forgot to redlight the changes.

# We say hi and begin our peace
if (gc.getTeam(gc.getGame().getActiveTeam()).canOpenBorder(gc.getPlayer(self.diploScreen.getWhoTradingWith()).getTeam()))
AND (gc.getTeam(gc.getGame().getActiveTeam()).haveCapital AND (gc.getPlayer(self.diploScreen.getWhoTradingWith()).getTeam()).haveCapital):
self.addUserComment("USER_DIPLOCOMMENT_PEACE", -1, -1)


The idea was practically stolen from Revolutions iirc, where you were Minor Civ until, I think, you discovered Writing.

My mod starts in 10.000 BC, and my thought was that when civs met, they would be rather hostile towards eachother in the beginning.
Then as citystates formed (Palace=Government Center), and writing was discovered, civs would be able to make negotiate Peace deals.

So, while you are able to meet another leader (Minor Civs didnt allow that), the only option, until both civs had Palace and Writing, would be War Declaration.

I tried to # the line, to test, but its ofcourse just the "graphical/human player" part of it, and doesnt affect AI's. Gonna look elsewhere in the dll.
 
Allright then.
 
Back
Top Bottom