How do I make someone declare war on a specified turn?

Suit to Skill

Chieftain
Joined
Jun 23, 2008
Messages
10
Location
Los Angeles, CA
Can somebody tell me what I need to write to make Player1 declare war on Player3 on Turn 25? I don't know Python and I have a little scenario in development, but I don't know how to make Player1 (Germany) declare war on Player3 (Russia) at that given turn.
 
RFRE marches along a historical timeline for the most part. For example, Hannibal invades Italia sometime close to 218BC. onBeginGameTurn is used to fire off historical events.

To see the organization, you can look at the python for RFRE: http://rs270.rapidshare.com/files/122704727/RFRE.june15.7z.

For example, look at the cimbri event:
Code:
    def cimbri(self):
          CvUtil.pyPrint('historical_event: Cimbri are migrating on turn: %s' %(self.iGameTurn) )

          pCimbri = gc.getPlayer(self.iCimbriID)
          pCimbriTeam = gc.getTeam(pCimbri.getTeam())
               
          if (not pCimbriTeam.isAtWar(self.iRomanID)):
               pCimbriTeam.declareWar(self.iRomanID, false)

    def onBeginGameTurn( self, argsList):
        'Called at the beginning of the end of each turn'
        self.iGameTurn = argsList[0]
        ..
        elif (self.iGameTurn == 145 + self.iRandCimbri):   # 109BC +/- 3 turns   125(150BC) + (150-109)/2 = 125+20 
             self.cimbri()

To understand the organization just look for the key strings (eg "import rfre", cimbri, onBeginGameTurn). The above code is from rfre.py, but how does the game know to source this file??
 
The above code is from rfre.py, but how does the game know to source this file??

Most likely RFRE includes Dr. Elmer Jiggles's CvCutomEventManager.py and uses it to fire off all its historical events.
 
I have been working on a Python tutorial called "How to add custom scripted events to a scenario," which deals exactly with Suit to Skill's question in detail. Maybe one of these days I will get around to posting it. :)
 
Back
Top Bottom