Quick Modding Questions Thread

Yeah, but AI_chooseFreeTech() only calls AI_bestTech(), so I'd have to limit that one, but it has no way of knowing that it has to decide on a free tech in this case and thus have limited options.
 
Yeah, but AI_chooseFreeTech() only calls AI_bestTech(), so I'd have to limit that one, but it has no way of knowing that it has to decide on a free tech in this case and thus have limited options.

Ah yes. I see what you're saying. You would need to add another variable to pass to the AI_bestTech() function.
 
Sure, I could.
 
How do I make towns spread irrigation?

In Civ4ImprovementInfos.xml, I can see IMPROVEMENT_TOWN has a <bCarriesIrrigation> tag, but changing it from 0 to 1 has no effect.
 
bCarriesIrrigation is the right tag to use, so that's not the problem.
Things to check:
a) are you on Windows Vista/7? If yes, did you have admin rights when you modified the file? Because windows file protection mechanism might have prevented your changes, without notifying you.
b) did you clear the cache (hold down shift during loading)? The cache is a temporal file storage, which means that all the original files are placed there in a special form, so that the game loads faster, if you load it more than once. If you didn't clear the cache, it might be that the game still used the unmodified files.
 
I've been looking for a way to mod inflation such that it levels off in the endgame. The idea I had for this was to edit the Federal Reserve random event to make it occur every turn after a certain point in the game, and only give it the option to reduce inflation by 1%.

The problem is this seemed to mess with the inflation rate in unintended ways. Some turns the inflation rate stayed the same, sometimes it decreased by 1%, and every few turns it would decrease by 5% for some reason. I understand that the financial advisor only shows inflation to the nearest integer so I won't always be able to tell exactly how much the inflation rate has changed, but there is no reason why a 1% decrease in inflation per the XML file should result in a 5% decrease in-game.

Does anybody know what I can do to mod inflation to cause it to level off in the future era?
 
I'm getting a C++ exception when trying to call the method "addWBPlayerControlTabs()", line 2367 in CvWorldBuilderScreen.py. Does somebody know what the method does, and what could've caused the error?
 
Wasn't able to find it, that's why I ask. I suppose it's part of the DLL. Here's the part where it's called (it appears nowhere else in the code):

Code:
	def refreshPlayerTabCtrl(self):
		
		initWBToolPlayerControl()
		
		self.m_normalPlayerTabCtrl = getWBToolNormalPlayerTabCtrl()

		self.m_normalPlayerTabCtrl.setNumColumns((gc.getNumUnitInfos()/10)+2);
		self.m_normalPlayerTabCtrl.addTabSection(localText.getText("TXT_KEY_WB_UNITS",()));
		self.m_iUnitTabID = 0
		self.m_iNormalPlayerCurrentIndexes.append(0)

		self.m_normalPlayerTabCtrl.setNumColumns((gc.getNumBuildingInfos()/10)+1);
		self.m_normalPlayerTabCtrl.addTabSection(localText.getText("TXT_KEY_WB_BUILDINGS",()));
		self.m_iBuildingTabID = 1
		self.m_iNormalPlayerCurrentIndexes.append(0)

		self.m_normalPlayerTabCtrl.setNumColumns((gc.getNumTechInfos()/10)+1);
		self.m_normalPlayerTabCtrl.addTabSection(localText.getText("TXT_KEY_WB_TECHNOLOGIES",()));
		self.m_iTechnologyTabID = 2
		self.m_iNormalPlayerCurrentIndexes.append(0)
		
		addWBPlayerControlTabs()
		return
 
I'm getting a C++ exception when trying to call the method "addWBPlayerControlTabs()", line 2367 in CvWorldBuilderScreen.py. Does somebody know what the method does, and what could've caused the error?

It's likely not that function itself that is the problem. Looks like the function its crashing on is checking Unit, Building and Tech infos. Did you make any changes to any of those three sections of the game recently?
 
Like, for example, adding one of those three things and giving it a bad button path (extraneous leading comma being the typical example). What it is doing is building the display that has the 3 tabs that show the buttons for each of the three things. Therefore buttons are a likely culprit.
 
What is that for, if I may ask?
Don't know, seems to be some part of the WB interface. All I know is that it throws exceptions at me :D

So the function addWBPlayerControlTabs is nowhere in there?

mmhh...do you know how to compile a debug dll?
Never did it, but I think yes.

It's likely not that function itself that is the problem. Looks like the function its crashing on is checking Unit, Building and Tech infos. Did you make any changes to any of those three sections of the game recently?
Like, for example, adding one of those three things and giving it a bad button path (extraneous leading comma being the typical example). What it is doing is building the display that has the 3 tabs that show the buttons for each of the three things. Therefore buttons are a likely culprit.
That was my first idea as well, but I checked my recent additions and they all showed the correct buttons in civilopedia. Can they still cause problems then? I'll check for leading commas anyway, thanks.
 
A quick question:

Is there a Mod that lets you set reminders for yourself? For example, I'd like a pop-up every 5 or 10 turns that will remind me to cycle through the city screens and micromanage.

Additionally, it might be handy to set a one-time reminder: for example, if your borders will expand in 3 turns, you might want to set a reminder to send a worker there (or wake one up) so that he can build a pasture around the cows that fall within the expanded borders.

This seems like quite a simple/common thing, so I imagine there'd be a mod for it already, but my cursory sweep through the forum didn't yield anything.
 
Back
Top Bottom