Posting to the in-game log.

Taurendil

Second Banana
Joined
Jan 18, 2003
Messages
68
Location
Brussels, Belgium
Just one simple question for now. Is there a function i can call that will add a line of text to the in-game event log?
 
Just answered my own question by browsing existing mods. Thanks to Eotinb for using this function in his "simple reminders" mod :D

I'm using this to show a message when a city grows. I know quite a few other ppl were looking for this as well. The automatic assigning of new citizens can be a pain.
So, if you want this, make a copy of CvEventManager.py, and place it in your ...\My Games\Sid Meier's Civilization 4\CustomAssets\python folder.
Right after this:
Code:
	def onCityGrowth(self, argsList):
		'City Population Growth'
		pCity = argsList[0]
		iPlayer = argsList[1]
		CvUtil.pyPrint("%s has grown" %(pCity.getName(),))
add this:
Code:
# Notify me when a city grows.
		message = pCity.getName() + " has grown."
		CyInterface().addMessage(iPlayer, True, 30, message, '', 0, None, ColorTypes(11), 0, 0, False, False)
 
Back
Top Bottom