View Full Version : 2.5 Questions: Civilopedia & SDK


draco963
Feb 01, 2007, 03:36 PM
OK, so trying to make some changes for my MOD, noticed a few things...

1) The Civilopedia is missing some info for Towns, Watermills, & Workshops. If you check the screenshots, you'll note that they all show the expected Yield changes, but don't list the Civics' names that said changes occur at. Any idea which Text files contain this info?

http://forums.civfanatics.com/uploads/109272/Civ_Screenshot.JPG

http://forums.civfanatics.com/uploads/109272/Civ_Screenshot1.JPG

- - - - - - -

2) I was thinking of trying my hand at SDK/Python modding, but I want to check if my idea is possible first...
2a) Would it be possible to enact a change that would allow you to specify the amount of gold or population to use when hurrying production, a la SMAC?
2b) I've noticed in my own playing, that I try to allow a city to build an item for one turn before buying it, to save on the hurry cost. How complicated would it be to add Hurry instructions to the build queue?
As in, I set a city to build a Jewish Temple, add a Hurry command that will delay 2 turns before actually happening (so I don't get hit with the cost increase of hurrying with no production), then build a Monastary, with a Hurry command after two turns, then the same again with a Cathedral. I get all three items hurried, don't pay the cost multiplier for hurrying without any accumulated production, and I don't have to remember to come back to the city every third turn for 9 turns. :D

- - - - - - -

Thanks in advance for any help/advice you can provide. :)

draco963
Feb 04, 2007, 09:09 AM
OK, two & a half days and no answers at all? What did I do? or not do? Would really like some help with these questions please...

Gaurav
Feb 05, 2007, 08:31 AM
As to #2, I'm not experienced enough with the SDK to answer your question, but I suspect it will be not easy.

As to #1, if it is XML and python only, post or pm your code and I may take a look at it, but I have not seen the problem before.

Kael
Feb 05, 2007, 09:45 AM
OK, two & a half days and no answers at all? What did I do? or not do? Would really like some help with these questions please...

You will need an SDK change to do this. It will be in CvGameTextMgr.cpp somewhere. Thats the file that builds all those help popups.

draco963
Feb 05, 2007, 04:18 PM
As to #1, if it is XML and python only, post or pm your code and I may take a look at it, but I have not seen the problem before.

Gaurav, would be more than willing to PM you the code in question, but I'm honestly not sure which Text file in the XML branch to check for this missing info... If you look at the pics, you'll note that Python is properly bringing up the popups for the different improvements I snapshot, and that there is info being displayed. It's properly showing the strict value changes involved, ie: Watermill gets +1 Food, & Towns get +1 Hammer & +2 Gold. But it's not showing why those additions are happening; the space is blank instead of showing State Property, or Universal Suffrage, or Free Speech. And if I change the value of the changes in CIV4CivicInfos.xml, the numbers correctly update.

So, what's leaving me dumbfounded, is: Where is the name???

Thanks for responding...

cf_nz
Feb 05, 2007, 05:25 PM
What changes were you trying to make for your mod?

It does seem like the CIV4CivicInfos.xml file is involved somehow because that is where the improvements are linked to the civic types. (See screen shot - changed state property food bonus from watermill to town).

draco963
Feb 05, 2007, 09:35 PM
K, see, that's what weird...

The numbers & icons are showing up, and when I change info in CIV4CivicInfos.xml, those changes show up. What's weird is that the Civic names aren't showing... Doesn't matter if I change what Civic causes what, or how much the change is, still doesn't show... As you can see below...

http://forums.civfanatics.com/uploads/109272/Civ_Screenshot.JPG

Weird, wot?

Dale
Feb 05, 2007, 11:14 PM
Did you change the civic's "Description" tag at all, or the text associated with that tag?

Maybe you did like other modders, and made a new text for the description tag in the "English" definition but forgot to put the one in for your own language (which would show as blank like you have it).

draco963
Feb 08, 2007, 02:36 PM
Nope, never touched 'em... Nor have any of the Mods I've downloaded and worked into mine.

draco963
Feb 16, 2007, 08:00 PM
No answers? No guesses even? To add to my previously posted info, what's really weird about this is that it's occuring in my vanilla edition (which I have not modded) as well as both my modded and plain Warlords. I have yet to find any explaination of why only the Civics aren't displaying in the Improvements page of the Civilopedia...

I really appreciate any help anybody can give me...
Thanks

Lord Olleus
Feb 17, 2007, 09:24 AM
Its a bug in CvGameTextMgr::setImprovementHelp in the SDK.


// Civics
for (int iYield = 0; iYield < NUM_YIELD_TYPES; iYield++)
{
for (int iCivic = 0; iCivic < GC.getNumCivicInfos(); iCivic++)
{
int iChange = GC.getCivicInfo((CivicTypes)iCivic).getImprovement YieldChanges(eImprovement, iYield);
if (0 != iChange)
{
szTempBuffer.Format( SETCOLR L"%s" ENDCOLR , TEXT_COLOR("COLOR_HIGHLIGHT_TEXT"), GC.getCivicInfo((CivicTypes)iCivic).getDescription ());
szBuffer += NEWLINE + gDLL->getText("TXT_KEY_CIVIC_IMPROVEMENT_YIELD_CHANGE", iChange, GC.getYieldInfo((YieldTypes)iYield).getChar()) + szTempBuffer;
}
}
}


The line in bold is the problem. It does not return the name of the civic. If you change it to:

szBuffer += NEWLINE + gDLL->getText("TXT_KEY_CIVIC_IMPROVEMENT_YIELD_CHANGE", iChange, GC.getYieldInfo((YieldTypes)iYield).getChar(), GC.getCivicInfo((CivicTypes)iCivic).getDescription ()) + szTempBuffer


And you then also change "TXT_KEY_CIVIC_IMPROVEMENT_YIELD_CHANGE" to read the new argument, then this should be fixed.

draco963
Jul 20, 2008, 09:17 AM
Lord Olleus, thank-you for your post. Ironically, I happened to take a break from Civ IV as of my last post, and so never saw your response. Now I can get this bizarre error fixed. Thank-you again.