SD-CultureConquest 1.30
by Stone-D ( Laga Mahesa )
For Civilization IV
Compatibility : 1.00+
Data Source   : 1.09
New Game Req  : NO



Introduction
=-=-=-=-=-=-=
So what is this then?

I thought it was unrealistic for a city's culture to drop to zero upon capture. So, to fix that, I implemented this.

Upon capture, the city's culture is reset to one half of the original, PLUS a random number whose maximum is half of the original. Prior to this calculation, the original number is adjusted to account for the lost population.


        NewCulture = ( OriginalCulture / 2 ) + ( Random(OriginalCulture / 4) ) + ( Random(OriginalCulture / 4) )


If the conqueror is also the original founder, this calculation becomes :


        NewCulture = OldCulture x ((Current_year - Loss_year) / (Max_years * 0.25))

If the conqueror is NOT the original founder AND the losing civilization is also NOT the original founder AND the city's culture is at least double what it was when the founder lost it, the loser becomes the founder.

If you build a city on the same plot as that of an older city that got itself razed, the new city will gain some of the older city's culture to a maximum of 80%, depending on how long ago the razing took place.


        NewCulture = (Culture_old x ((Current_year - Loss_year) / (Max_years * 0.15))) * 0.8


Additionally, if you check the logs, each city now has a capture count.

Now, instead of a city being completely written off after capture due to zero culture, you can fight over it!


History
=-=-=-=

v1.00 - Initial Release.

v1.10 - Uses SdToolKit.
        Better motive to regain lost cities. 80% of ORIGINAL culture is restored to the founder, minus a small chunk for population depletion and building loss. If the original culture is less than the current culture, then the current culture is used.
        If a city is captured from a previous conqueror by someone other than the original founder AND the current culture value is equal to or over 200% of the original culture, then the loser becomes the 'founder' and gains the aforementioned motive.
        Adjusted loss calculation from (0.25 + rand(0.25) + rand(0.25)) to (0.5 + rand(0.25) + rand(0.25))

v1.20 - Requires sdToolKit 1.10+
        Implemented safeguards to allow continuation of current savegames with no disruption.
        Eliminated a potential exploit. A city's data is no longer dependant on the city's name.
        Removed population loss adjustment. T'was a silly idea.
        New variable, fDateLost. Stores the date the city was taken from the founder.
        Founder recapture culture redone : Culture_new = Culture_old x ((Current_year - Loss_year) / (Max_years * 0.25)). NOT turn based... year based.
        If founder's restored culture is less than the non-founder culture, the non-founder culture is used.
        Included two mods by Bhruic for the user's convenience. Please see the "Included Mods" section.

v1.30 - Requires sdToolKit 1.20+
        Implemented version control. Will no longer perform a fix-loop every game turn, causing a slowdown.
        Some minor cleanups and optimizations.
        Founding a city where an older city once stood will give some (max 80%) of that older city's culture to the new city.
        Rebuilt culture is : Culture_new = (Culture_old x ((Current_year - Loss_year) / (Max_years * 0.15))) * 0.8


Included Mods
=-=-=-=-=-=-=
In order to avoid a deluge of queries and requests, I have decided to include a number of 3rd party mods... however, they have been disabled. To enable them, open "sdEventManager.py" in your favourite TEXT (ASCII) editor. Notepad should suffice. Search the content for the mod's opening and closing tags (for example, # <sdTechConquest>) and uncomment everything WITHIN those tags. There may be multiple occurances, depending on the mod. The included mods are :


MOD Title       Author          Tag
-----------------------------------------------
Cultural Decay  Bhruic          <CulturalDecay>
TechConquest    Bhruic          <TechConquest>


Note that there are a number of other commented mod tags. The components for these you will have to download separately, the tags are there to serve as a guide and example.


About sdToolKit
=-=-=-=-=-=-=-=
sdToolKit is a python module I developed which contains a number of functions that are commonly used, in particular a method of saving a mod's data to a savegame without compromising the data belonging to other mods.

One minor feature is an enhanced logging tool which can output debug data to the usual pythondbg.log file AND to the screen. These functions can be toggled by editing sdToolKit.py and finding the following section near the top :


################# BASIC UTILITIES ###################
def sdEcho(echoString):
	printToScr = True
	printToLog = True
	message = "%s" %(echoString)
	if (printToScr):
		CyInterface().addImmediateMessage(message,"")
	if (printToLog):
		CvUtil.pyPrint(message)
	return 0


printToScr : Set to FALSE to disable on-screen logging.
printToLog : Set to FALSE to disable pythondbg.log logging.


Compatibility
=-=-=-=-=-=-=
This mod, on its own, should be compatible with all versions of Civilization IV, up to and including version 1.09. As it features python elements, I cannot guarantee compatibility with future versions.

This mod stores data in the savegame. It is fully compatible with other mods that do the same, but only if they are also using sdToolKit for their saving routines.


Merging with existing MODs
=-=-=-=-=-=-=-=-=-=-=-=-=-=
Wanna use this data in your MOD? Credit me prominently in your docs and any internal credit screens, that's it.

If you're a newbie (no offense intended) end user and want to mix and match various mods, I strongly suggest that you first download and install WinMerge. Find it on Sourceforge.net.


Contacting Me
=-=-=-=-=-=-=
Contact me at :  laga@tbi.co.id

I also have email addresses at yahoo, hotmail and gmail under the user lmahesa. However, I rarely remember to check them, so be prepared for a reply well after you've solved your issues yourself or no replies at all.

Also I occasionally dabble in the dark arts of Internet chatting. Usually Yahoo or MSN, mostly Yahoo.

Note though, I don't even vaguely understand German, Russian, Polynesian or Hindustani, so contact me in English please.  :)

Or Indonesian.  =|;'D


The Obligatory Disclaimer
=-=-=-=-=-=-=-=-=-=-=-=-=
Life being what it is at the moment for me, something is bound to happen. So :

You downloaded this.  You opened the zip.  You extracted the files.

You, and you alone are responsible.

If anything goes wrong, please tell me but in no way can you possibly consider me responsible.

I'm not MacDonalds you know.  ;)

Nor, for that matter, am I American, so you can't summarily sue me for ruining your gaming session. Nerrr!
