View Full Version : Modding victory conditions, help/advice please


mice
Jun 15, 2007, 08:02 PM
Hello, I'm looking for advice on how to go about modding victory conditions.

I would like to create a victory condition that is similar to Cultural, but recognises the trade of each city Eg. trade route income. Also possibly civ-wide resource trading. Possibly total gold.

My guess is it's not simple. Any advice for this? Where do I look.

The finished V.condition would be an Economic Victory or Trade Victory.

Most key thing is to link the cities trade route income to a victory condition ,

eg. five cities with trade income over 30 gpt.

juni_be_good
Jun 17, 2007, 06:54 AM
You will have to edit SDK file CvGame.cpp. In it, there is a testVictory() function called every turn. It checks all victory condition for all players. You will have to add a new test. It requires some programmind knowledge.

I don't know where you can get the income generated by trade routes (probably in CvCity class), but once you have found it, it may not be really hard to create a function that adds every turn the amount of gold generated by a city and returns the total amount generated since the beginning of the game. Then, you just have to test this value for every city of every player it in CvGame::testVictory().

You will also have to expose this new function to Python so that you can use it in CvVictoryScreen.py to display properly your new victory condition in the F8 screen.

mice
Jun 17, 2007, 05:33 PM
Thanks for that response . It's out of my ability range at the moment. I will have to learn about programming bit, but it is interesting.