Modify victories and disable Play now!

Gurra09

Emperor
Joined
Jan 1, 2008
Messages
1,302
Location
Sweden
Hi! I'm making a scenario/mod and I want to know if it's possible to edit the victories so the only way to win is to meet a special leader?

Another question is how I do to disable the Play now! function?


Gurra09
 
Yes, it's possible to edit the victories in whatever way you want. It can be done in the SDK/C++ code or just from Python and XML.

I've never actually tried the Python and XML route, but I assume it would work like this:

Assets\XML\GameInfo\CIV4VictoryInfo.xml - Reduce the number of victories in this file to the one victory type. Turn off all the victory conditions in the victory. (Note: if you test this before editing the Python part, you will always win the game on the fifth turn. That's because we haven't defined yet the conditions of winning.)

Notice the sections I have in blue. You can name these parts whatever you want, but make sure to create game text entries in the Text folder for the Description and Civilopedia.

Code:
 <Type>[COLOR="blue"]VICTORY_MEET_LEADER[/COLOR]</Type>
  <Description>[COLOR="Blue"]TXT_KEY_VICTORY_MEET_LEADER[/COLOR]</Description>
  <Civilopedia>[COLOR="blue"]TXT_KEY_VICTORY_MEET_LEADER_PEDIA[/COLOR]</Civilopedia>
  <bTargetScore>0</bTargetScore>
  <bEndScore>0</bEndScore>
  <bConquest>0</bConquest>
  <bDiploVote>0</bDiploVote>
  <bPermanent>0</bPermanent>
  <iPopulationPercentLead>0</iPopulationPercentLead>
  <iLandPercent>0</iLandPercent>
  <iMinLandPercent>0</iMinLandPercent>
  <iReligionPercent>0</iReligionPercent>
  <CityCulture>NONE</CityCulture>
  <iNumCultureCities>0</iNumCultureCities>
  <iTotalCultureRatio>0</iTotalCultureRatio>


Assets\Python\CvGameUtils.py - Find the code for the isVictory function. Right now it simply returns True. Edit the code so that it returns False unless the conditions of your custom victory have been met.


Assets\Python\Screens\CvVictoryScreen.py - This is the code for the Victory screen. You will need to edit this file to make instructions for your victory show up. One easy way to do this is just to create a text entry or two in the Assets\XML\Text folder and slap them up on the screen.



I don't know how you would go about turning off the Play Now button.
 
Back
Top Bottom