OK, the order at which we do this is not really important. Once you know what your doing, it doesn't really matter. But for simplicity, let's start with the xml\units\Civ4SpellInfos.xml file. This is the new XML file which Talchas added when he made the Spell system for Fall from Heaven 2. If your spell/skill is going to be Active it will need an entry here.
This is what the current entry of the Skill Maim Thrust looks like in my Notepad2:
Everything from
<SpellInfo> to
</SpellInfo> is one spell/skill. Lets go over each tag one by one.
The
<Type> tag is the game's XML reference to this entry. It can actually be called anything, as long as it isn't called the same as another skill, which will mean the last one Civ4 loads will overwrite the previous one. We should call these SKILL_*** when it's a skill, SPELL_*** when it's a spell, ACTION_*** when it's an action.
The
<Description> tag leads to the XML description of the skill. Just name it
TXT_KEY_ + Whatever you wrote in the
<Type> tag. We'll get to more about this tag later.
The
<Civilopedia> tag leads to the XML civilopedia entry of the skill. Just name it
TXT_KEY_ + Whatever you wrote in the
<Type> tag. +
_PEDIA. We'll get to more about this tag later.
The
<Strategy> tag is normally the Sid's Tips part of a unit/tech etc. I'm not sure it does anything in for Spells in FfH atm, so just skip this one for now.
The
<Help> tag leads to an XML entry which should describe what the skill does, it will show up in the Mousover of the skill's button. We'll get to more about this tag later.
The
<PromotionPrereq1> tag should have an entry pointing to what Promotion enables the skill. The entry is the
<Type> entry from the
CIV4PromotionInfos.xml file. You can go back and change this later, but enter what you think you will call the promotion.
The
<PromotionPrereq2> tag should almost always have NONE in it's field. The only time you should use this is when this version of the skill should be limited to a certain race or class, etc.
The
<iRangeSelectNum> tag tells the game if the spell needs a target, -1 means no target, 0 means a target plot but you don't get the selection pop-up. 1 means you get the selection pop-up and you need to select 1 target from it, etc.
The
<Effect> tag should link to an effect if you want one to show up. NONE means no effect obviously.
EFFECT_SPELL1 is one effect for example. More effects can be found in xml\misc\CIV4EffectInfos.xml
The
<Sound> tag should link to a sound if you want one. NONE means no sound. You see an example in the picture. More sounds can be found in xml\audio\Audio2DScripts.xml or xml\audio\Audio3DScripts.xml, the entry you want here is the <ScriptID> from one of those files.
The
<PyResult> tag points to the Python entry for the result of this Skill. Copy what I have entered here, and Rename the MaimThrust part to whatever your skill's name is. If the skill needs a target use the (pCaster, pTarget) as it is, if not, only use (pCaster).
The
<PyRequirement> tag points to the Python entry for the requirement of this Skill. Copy what I have entered here, and Rename the MaimThrust part to whatever your skill's name is.
The
<PyValidUnitTargets> tag points to the Python entry for the target validation of this Skill. If your skill needs a target, copy what I have entered here, and Rename the MaimThrust part to whatever your skill's name is. If not, dont enter anything and let this field be empty like so;
<PyValidUnitTargets></PyValidUnitTargets>
The
<HotKey> tag's entry should be empty if you dont intend the skill to have a hotkey, if you want a hotkey, enter it like I have above. KB_A would be the A key. Be SURE to not use duplicate hotkeys for skills on one character. If you do, the whole universe could collapse.
The
<Button> tag is should point to a graphics file for the ingame Button. I'm not gonna explain how to make those in this tutorial.
Ok, that was every tag you need to worry your little head about in this file.
What you should do when making a skill is Copying an entire entry of an existing Skill, Paste it in, then edit it. The above info should help you do that. Now on to the Promotions file.
You will find the file at xml\units\CIV4PromotionInfos.xml
Each promotion got many more tags than a spell, so I'm not gonna go over every one here. They are rather self-explanatory anyways. The important ones are the
<Type>,
<PromotionPrereq...> ones, the
<PromotionNextLevel> one in some cases, and for these Promotion type Promotions (eh? Yes, the ones you pick when you level up) the
<UnitCombats> is important as well.
OK, the
<Type> should have the name you entered in the
<PromotionPrereq1> in the SpellInfos. The
<Description> tag can link to the same TXT as the one in the spell, unless you want them to differ somehow (like in the above example).
<PromotionPrereqOr1> should always point to the CLASS_ that this skill is for. The CLASS_*** is another Promotion, that exists in this file, which is given to the Unit in question.
<PromotionPrereqOr2...4> can point to other class promotions if the skill could be used by another class. Otherwise use NONE here. (Remember, these are OR statements, if you want to make the skill for a single class, move the CLASS_ promotion to the AND preReq)
<PromotionPrereqAnd1> should have the Level requirement, which also is a promotion the unit gets automatically when he levels. This might be a temporary solution for skills level requirement, but as long as we use that system, you need to do this.
<PromotionPrereqAnd2> should point to another promotion that the unit HAS to have for it to be able to get this promotion.
<PromotionNextLevel> points to the next promotion in this line of promotions. This is ONLY for graphical reasons, so that for example the Combat I-V promotions are stacked.
<UnitCombats> here, work a little differently then other tags so far. It has Sub-entries like you can see. Kind of self-explanatory. The UNITCOMBAT_MOUNTED isnt really needed for this skill, but keeping it makes it easier for copying. I should probably remove it for the sake of the civilopedia. The IMPORTANT part here, is that the promotion NEEDS the unitcombat of the units which you want to get this promotion or they wont be able to get it at level up.
Now this promotion should be done (except for the button tag at the bottom which you add in the same way as for the spell entry). This promotion shouldn't give any stats or anything since it's purpose is to open up for the active skill.
If your skill applies a buff, you should also Search for a BUFF_ and copy one, name it appropriately, and add whatever effects you deem appropriate. DO NOT add a UNITCOMBAT for a buff, since it should NOT appear as an available promotion at level up.
The
<Type> should be named like this; BUFF_***_1TURNS, and you need to add one promotion for every turn the buff should last, for example; BUFF_***_4TURNS, BUFF_***_3TURNS, BUFF_***_2TURNS, BUFF_***_1TURNS.
You could also add TECH_NEVER to the
<TechPrereq> tag, to make sure you can't get the promotion in any way (except through your skill). I'm not entirely sure if this is needed, but I seem to have done this with every buff so far.
Now, the last thing that needs to be done in XML is adding the TXT_ entries, etc. This isn't a requirement for it to work, but it sure looks better.
That should be all for the XML part of this tutorial. If I've forgotten anything, or if anything should be unclear, please post and I'll update.