Modders Guide to FfH2

Say, where's the Civ 4 Art Defines schema? It doesn't appear to be with the actual art defines files, and I need it for making my mod modular.

Check the base BtS files. If a file isn't changed by a mod, it's not distributed. ;)

Edit: Apparently there was a new page I was unaware of. :lol:
 
Three questions:

1. Where in the WM code is that part I need (as asked in my last question)?

2. If I wanted to disable access to a civilization to a certain resource (and I mean all access, even by trading or conquest) how would I do it?

3. What exactly does the text in the fallowing quote mean?
Recommendations:


1. Try to block spells in SDK prereq functions whenever possible.

Keep in mind that every unit in the game checks to see which spells it can cast every turn. If a spell only uses a python function for requirements and you have 300 units in the game then that python functions will be run 300 times per turn. If you can put a limit in one of the SDK prereqs (lets say its limited to a specific unitclass) then even with the same python requirement check it will only occur for the units that meet the SDK conditions. This can dramatically effect performance when there are a lot of units on the map.

Sometimes its better to split spells into multiple spells if that allows you to apply SDK qualifiers, which is why the Create Den and Take Equipment spells were split into multiple spells.​
Does it mean that I should change the SDK for every new spell I make or that I should try and link the requirements in the XML to something already defined in the SDK like unit_class?

Also, spell effects are done purely in XML and python right?

4. If I have a unit with 2 separate promotions (or just normal traits).
One is vulnerable to fire (-50/60 what ever % vs fire attacks) and the other gives it fire affinity will these two coexist or clash?

Like if a unit has +2 Fire Damage and -50% vs fire attacks does that transform it into +1 Fire Damage or does it just mean +2 Fire Damage but takes more damage from opponents with fire damage?
 
3. Either one. Your goal is just to avoid calling python on EVERY unit in the game. If none of the current XML tags work for your spell, it is desirable to write a new tag instead of go with pure python.

4. The second option. +2 damage and takes more if enemy is +Fire damage.
 
Alright, what about #2?
That one is quite essential for my whole concept.
 
just a quick question: where are the rituals saved, in case i want to modify one or create a new one?

edit: nvm found it :)
 
tesb: CIV4ProjectInfos.xml

PPQ: I'd use the DLL for it myself. And I imagine there would be quite a few places where you need to slip code in to block one approach to gaining the resource or another. Main issue will be finding all areas where the AI will react to the resource and ensuring that they don't see it as desirable.
 
I am having problems loading the SDK into my Visual Studio.
I have Microsoft Visual Basic 2005 Professional Edition so it should not be producing any problems.

However, when I try to load the solution I get a message that I need to update it (the solution) to a new version but the update always fails.


Is there any tutorial out there that is not for the Express Edition since I have no idea what the differences are.
 
OK. I found a tutorial here on using Visual Studio 2005, and it it's all correct except for the makefile link. I used the one found here - http://forums.civfanatics.com/showpost.php?p=8191788&postcount=323|

Once I made sure the paths were set correctly for my system, the build went off smoothly!

Hey PPQ. Here's a post from last week when I was trying to get my Visual Studio setup. Follow the directions in that link and use the alternate makefile (also linked above).
 
And it works with professional as well? Just checking.
 
Hello,

I got two questions at the moment, hope someone could answer them ;)

First, my Air Elementals wouldn't spawn Lightning Elementals after battle. I tested with vanilla FfH-m and it spawned alright. I didn't modmod the dll, only xml and py. I also didn't change the value of iUnitCreateFromCombatChance in CIV4UnitInfos.xml (it still 100). What did I do wrong? Or at least, which file can I look at?

Second, I use this code frequently in CvSpellInterface.py

Code:
	for iiX in range(iX-2, iX+3, 1):
		for iiY in range(iY-2, iY+3, 1):
			bNeutral = false
			iValue = 0
			pPlot = CyMap().plot(iiX,iiY)
			for i in range(pPlot.getNumUnits()):
				pUnit = pPlot.getUnit(i)
				if eTeam.isAtWar(pUnit.getTeam()):
					iValue += 5 * pUnit.baseCombatStr()
				else:
					bNeutral = true
			if (iValue > iBestValue and bNeutral == false):
				iBestValue = iValue
				pBestPlot = pPlot
	if pBestPlot != -1:
   --> actual spell effect begin here

Is it possible to write this code at CustomFunctions.py and call it in each spells (such : cf.getAttackPlot or something, then the actual spell)? Would it help the game performance if I move the code into CustomFunctions.py?

Thank you!
 
That's what I'm using. 2005 Pro.

Thanks man. Will try it. Wish me luck.



Does anyone know where exactly I should look for the resource code?
Just as a reference.
 
Yes, any non-zero MinLevel value will prevent building the unit. Negative values mean you cannot acquire the unit at all (except through forced acquisition, like Python, events or spells), and a positive value means you have to upgrade to it from another unit.
 
tesb: CIV4ProjectInfos.xml

PPQ: I'd use the DLL for it myself. And I imagine there would be quite a few places where you need to slip code in to block one approach to gaining the resource or another. Main issue will be finding all areas where the AI will react to the resource and ensuring that they don't see it as desirable.
Can you tell me what this means? Because I am completely new in this.

Also, does anyone know where I should look for when examining the approach types.

Step 1. Remove the specific improvements

Step 2.
Is there any way to see where the whole "tech enables resource" thing is handled or where the check is if the said resource is discovered/enabled is done. If there is some place where this is checked I could simply add an If to it and be done.
 
AI will consider what resources it can gain when choosing where to settle. If some of those won't actually be gained, it needs to ignore them.

AI will consider resources it doesn't have as potential trade leverage for someone else, but if it isn't something they can trade for, it must ignore them.

AI will consider resources unlocked when choosing what tech to learn. If that resource won't unlock...

And so on from there. Worker improving tiles, which tiles to protect from pillaging, and potentially a lot of other locations the AI needs to understand that there isn't a resource there for them to work with.

You MIGHT be able to do this REALLY easily by making the resource be considered Obsolete for that Civ from the start of the game. The logic for that already exists (I think), and may cover you perfectly. Linking in with the techs to make them "unlearn" the resource may work, but I don't think that blocks acquisition by trade.
 
Back
Top Bottom