Is there an events tutorial for Python?

nokmirt

Emperor
Joined
Feb 14, 2009
Messages
5,088
Location
Iowa USA
I heard there was an events tutorial but I am not sure where it is?
 
These are just vague is there any event python and xml tutorials that are more in depth. It could not be that hard to have one civ declare war on another at a pre-destined point in the game. I just do not know how to write the code. Where do I begin?
 
The_J's link tells you how to create non random events. Declaring war at a pre-destined point is a non-random event.

The link from me tells you what the tag means where you'll find the one you need for declaring war.

Go ahead and read them all the way through, they have what you want.
 
The_J's link tells you how to create non random events. Declaring war at a pre-destined point is a non-random event.

The link from me tells you what the tag means where you'll find the one you need for declaring war.

Go ahead and read them all the way through, they have what you want.

I read through and did not see anything about one civ declaring war on another at a given point. Does anyone know the BTS code for 3.19, the basic code for this to occur?
 
Untested Python code:

Code:
# only works with scenarios with pre-defined civilizations
PLAYER_FRANCE = 4
PLAYER_MEXICO = 2

france = gc.getPlayer(PLAYER_FRANCE)
mexico = gc.getPlayer(PLAYER_MEXICO)

france.getTeam().declareWar(mexico.getTeam())
 
Untested Python code:

Code:
# only works with scenarios with pre-defined civilizations
PLAYER_FRANCE = 4
PLAYER_MEXICO = 2

france = gc.getPlayer(PLAYER_FRANCE)
mexico = gc.getPlayer(PLAYER_MEXICO)

france.getTeam().declareWar(mexico.getTeam())

I will try it and let you know if it works.
 
Top Bottom