Automaticaly at War

Riker13

King
Joined
Nov 9, 2001
Messages
853
Location
UK
Hi All,

Have a small issue which I hope you can help me with.

I need some Python code which will allow Player A to automaticaly be at war with Player B as soon as the game starts.

Hope you can help with this.

All the best.

Riker13 :crazyeye:
 
Is this for something that has a map already? If so there is support in the wbs for this:
Code:
BeginTeam
	TeamID=0
	Tech=TECH_ETRUSCAN_HERITAGE
	Tech=TECH_CIVILIZED_BUILDINGS
        AtWar=14
        PermanentWarPeace=14
        AtWar=5
        PermanentWarPeace=5
	RevealMap=0
EndTeam

For python the snippet is something like this:
Code:
         if (gc.getPlayer(self.iCisalpinaGaulID).isAlive()):
	          pCarthage = gc.getPlayer(self.iCisalpinaGaulID)
	          pCarthageTeam = gc.getTeam(pCarthage.getTeam())
	
	          if (not pCarthageTeam.isAtWar(self.iRomanID)):
	               pCarthageTeam.declareWar(self.iRomanID, false)

I usually check to make sure the civ is alive and not at war already.
 
Thanks for that info Prime but it is for a mod I am working on which does not include a map to start but one generated by the A.I.

Would your Python code still work with that?

Many Regards

Riker13 :crazyeye:
 
That's only a part of it, the war part :) Basically something like that would be added into onGameStart so that it executes only on the first turn of the game.


That code is from RFRE which has a specific maps and civs, so I can hard code the civ ID number (eg self.iRomanID = 0). Do you only have civ A and civ B? Or are there a bunch and if so how is it determined who is to be at war with each other?
 
Hi Prime,

Basicaly I have made my own little private mod with the normal nations in it but have spilt the United States to also have the Confederate States and its those two who I want to be at war with as the game starts.

Also I wanted to have a civic called "Crusade" which when picked meant that when you went to war with someone you could not go back to peace until the other was totaly destroyed, any ideas on that?

But first its the first part which is priority no 1 ;)

Many thanks for your time and effort on this.

Best Regards

Riker13 :crazyeye:
 
Top Bottom