Quick Modding Questions Thread

I changed the English names of some of the religious buildings in \Assets\XML\CIV4GameTextInfos_Objects.xml (the vanilla master files). Just the <Text><English> names, not the <Tag>.

Now, the Civilopedia and hints don't show those buildings' cultural output. You still get the cultural output, because it shows up when you hover over the cultural output breakdown in the City Screen. Any ideas as to what's causing this? It happens in both RFC and the otherwise unmodded game.

I'm running BTS 3.13 on Windows XP.
You obviously made some mistake, somewhere. Because the game no longer understands your XML settings.

Either start over and do one change at a time - and test it before doing another one. It takes time, sure, but its still faster than debugging - after the fact.

Or, you could post your buggy file here and let the community do the debugging for you. :D
 
That's not a bug in the mod, it's a bug in that patch version ;).
Cultural output was not displayed in BtS 3.13, that's it, the devs made a mistake.
Just patch to 3.19, that fixes the problem ;).

Discovering it wasn't my mistake gives me a warm fuzzy feeling... Thank you for the pleasant surprise!
 
1. When combat odds are being displayed in game (I'm thinking of when a unit's movement is moused over an enemy unit for this question), does whatever calculates those odds automatically take into account changes to the combat system, or does it do some separate calculations? (In other words, if I change how the combat system works in the units part of the SDK, will those changes automatically show up in the combat odds screen, or would I have to change something else to get a correct calculation?)

2. To create new 3-D models, what sort of programs might be used? (I've seen blender mentioned a couple of times, and do have nifskope installed, but know nothing else to get started with 3-D art.)

3. Are there any good sites to get started with AI editing, or would I just have to look at existing mods and slowly fiddle myself into some useful information?
 
1) I think this depends on if you add completely new mechanics, or make modifications to existing mechanics. In the former case, you'll probably have to adjust the interface, in the latter probably not.

2) For most of the editing you'll probably need the mentioned Blender, plus the Blender plugin for .nif files and PyFII (see here).
You can also do stuff with Nifskope, but mostly moving things/skeletons from one model to another one, i think we have a tutorial for it.
 
Is there a way to have the Unique Names for Units come in as per the XML list order rather than randomly?

Thanks.
 
Thank You The_J.

Actually, I could change the SDK if I knew where to look and how I could change the code!

But could you be more explicit about "the current system might be enough"?
 
It's in CvUnit::init().
Code:
        iUnitName = GC.getGameINLINE().getUnitCreatedCount(getUnitType());
	int iNumNames = m_pUnitInfo->getNumUnitNames();
	if (iUnitName < iNumNames)
	{
		int iOffset = GC.getGameINLINE().getSorenRandNum(iNumNames, "Unit name selection");

		for (iI = 0; iI < iNumNames; iI++)
		{
			int iIndex = (iI + iOffset) % iNumNames;
			CvWString szName = gDLL->getText(m_pUnitInfo->getUnitNames(iIndex));
			if (!GC.getGameINLINE().isGreatPersonBorn(szName))
			{
				setName(szName);
				GC.getGameINLINE().addGreatPersonBornName(szName);
				break;
			}
		}
	}
Haven't thought it through completely but at first glance it looks like you simply have to set iOffset to 0 instead of selecting a random number to get the unique names in sequential order.
 
Thank You very much Leoreth for that - I will give it a try!

Edit: It works fine (with iOffset = 0)! Thanks a lot again for your help!
 
You're welcome :) And good to know that it works.
 
Now on to one of my own questions: is it possible to influence which techs can be chosen as free techs? Because I'd like to disable Oracle and Liberalism slingshots by limiting the choices to techs of your own era or earlier. Unfortunately, I've only been able to backtrack the effect until the CvPlayer::chooseTech() method, where it gets lost in the popup system which I don't understand at all. It looks as if all information whether I'm choosing a free tech or only my regular next tech is lost at this point already ...
 
The AI component is probably found in CvPlayerAI::AI_chooseFreeTech(). This you can just modify so the AI won't get techs from different eras (since AI's obviously get no popups). I'm guessing you already figured this out though.

For the other part of your question, I believe you would have to put in a conditional for iDiscover. However I can't figure out what exactly iDiscover holds :think:. Have you figured out that much yet?
 
Oh I sort of figured it out:

iDiscover is data1 for the popup. I think what Firaxis did is makes the meanings of data1, data2, data3, data4 all different depending on the popup. In our case, our popup is BUTTONPOPUP_CHOOSETECH. So data1 tells it to add techs....

I'm not sure where to go from here, i.e., how to change it so only some techs are included.
 
iDiscover is data1 for the popup. I think what Firaxis did is makes the meanings of data1, data2, data3, data4 all different depending on the popup. In our case, our popup is BUTTONPOPUP_CHOOSETECH. So data1 tells it to add techs....

I'm not sure where to go from here, i.e., how to change it so only some techs are included.

I think you want the launchChooseTechPopup() function.
 
The AI component is probably found in CvPlayerAI::AI_chooseFreeTech(). This you can just modify so the AI won't get techs from different eras (since AI's obviously get no popups). I'm guessing you already figured this out though.
Yeah, exactly, AI wouldn't be a problem, and I'm not primarily concerned with the AI because it rarely oracles Machinery ;)

I think you want the launchChooseTechPopup() function.
I'll have a look at it, thanks.
 
It worked, thanks again! :)

Getting the AI to ignore these techs is actually harder, because you'd have add additional parameters to properly pass the information that it's a free tech, but I guess I can do without that.
 
Getting the AI to ignore these techs is actually harder, because you'd have add additional parameters to properly pass the information that it's a free tech, but I guess I can do without that.

Not if you put the limits in the AI_chooseFreeTech() function. That function is only used for choosing free techs. There is another function the AI uses for choosing techs to research.
 
Not if you put the limits in the AI_chooseFreeTech() function. That function is only used for choosing free techs. There is another function the AI uses for choosing techs to research.

I realize now my post was somewhat vague. This is pretty much what I meant.
 
Back
Top Bottom