How to sign a permanent alliance using the in-game python console?

gc.getTeam(0).addTeam(1) doesn't work.

Any idea what's the correct command and syntax??

Hmm, I tested it and with this code I managed to get it work.
Code:
	def onBeginPlayerTurn(self, argsList):
		'Called at the beginning of a players turn'
		iGameTurn, iPlayer = argsList
		
		if iGameTurn == 15:
			if gc.getPlayer(iPlayer).isHuman():
				gc.getTeam(gc.getPlayer(iPlayer).getTeam()).addTeam(2)
Do you have python exeptions on? Also what do you have arround it?
 
Oh, I just noticed that you wanted to know how it works with python console. So I typed in the exact same code you posted here and it worked.

EDIT:
But to note: A team can't be bigger than 2 members.
So if the human team has already 2 players, the command will just not have an effect.
I actually tested this, and it appears that you CAN have more than two players in one team.
 
How did you test it?
Before you start a game, you can pre-set teams with more members, but not ingame.
It's also not possible via normal diplomacy to form a team with more members.

I forced it with python console. I used the addTeam(). But I can see from the SDK that you are right. The normal diplomacy doesn't allow more than 2 players in one team, but it doesn't change the fact you force it with addTeam(). :D
 
It doesn't work for me. :confused:

As NotSoGood said, that's not the Python console.

For some reason, if you just press ~, you get that- a grey window which looks like the Python console. However, if you try to do anything in it, you get syntax errors.

To bring up the actual console, you must use SHIFT + ~, and sometimes that doesn't even work. In which case, close it by pressing ~ and try again.

The actual console says "Python", and then on the next line "2.4.1", followed by a bunch of text about the version.
 
For some reason, if you just press ~, you get that- a grey window which looks like the Python console. However, if you try to do anything in it, you get syntax errors.

It uses a different syntax. Can't give any details though. All I use it for is "game.aiplay x", where x is the number of turns you wish to see autoplayed. It's easier and shorter to write than what you would have to type in the real python console: CyGame()...

To bring up the actual console, you must use SHIFT + ~, and sometimes that doesn't even work.

Thanks I figured it out. :) It's that laggy shift key which caused me issues, and made me think for a while I couldn't open the real python console. I wonder why shift works so badly for the in-game console. Eg when I type addTeam fast, I get addTEAm or so.
 
I wonder why shift works so badly for the in-game console. Eg when I type addTeam fast, I get addTEAm or so.

I only see that with my keyboard at work (not in Civ4 obviously). Shift works fine for me in-game and in the console, though I rarely use it.
 
Back
Top Bottom