View Full Version : How to add promotion abilities?
Quornix Jan 05, 2007, 03:09 PM Hi, all. Well, I asked this earlier (among other questions), but I think my subject was probably too generic -- not many reads, and only one reply, with an "I don't know, but they did it in this mod over here". So it CAN be done. Not that I'm surprised.
So, my question is quite simple, even if the answer is not.
How do you create new abilities for unit promotions, or units in general? For example, how would you make a promotion that gave "fast fortification" -- double the per-turn fortification bonus, but a shorter fortification time? I know how to do this globally, but I don't know how to put it into a promotion.
Another, probably easier example, is: +25% attack vs. units in forests (like <iHillsAttack>, but for forests?
Not afraid to mix it up in the SDK, but I don't want to start messing around without at least some idea of what I'm doing. My C++ skills are a decade old.
Thanks for the help!
Dale Jan 05, 2007, 04:27 PM You'll have to add a new tag in xml and load/process it through the SDK.
Lord Olleus Jan 06, 2007, 04:06 PM There's a guide in the Tutorial section by Kael which tells you exactly how to do this. I strongly recomend you read it.
Quornix Jan 06, 2007, 09:38 PM There's a guide in the Tutorial section by Kael which tells you exactly how to do this. I strongly recomend you read it.
Thanks! By listing by name, I think I've found the right thread (http://forums.civfanatics.com/showthread.php?t=190103), on adding Hidden Nationality to units as a promotion. I should have noticed it, but it's sometimes hard to figure out what thread has what information. Just figured I'd put a link in here in case anyone else comes along with similar troubles.
Thanks again!
strategyonly Jan 07, 2007, 08:50 AM Since this thread is already here!!! Lets say i want this added as a regular promotion and NO python, what files do i need to use to accomplish this ??
This is in the PromotionInfo under units, what else do i need to change??
<PromotionInfo>
<Type>PROMOTION_BURNING_BLOOD</Type>
<Description>TXT_KEY_PROMOTION_BURNING_BLOOD</Description>
<Civilopedia></Civilopedia>
<Sound>AS2D_IF_LEVELUP</Sound>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<PromotionPrereqOr3>NONE</PromotionPrereqOr3>
<PromotionPrereqOr4>NONE</PromotionPrereqOr4>
<PromotionPrereqAnd1>NONE</PromotionPrereqAnd1>
<PromotionPrereqAnd2>NONE</PromotionPrereqAnd2>
<PromotionNextLevel>NONE</PromotionNextLevel>
<TechPrereq>NONE</TechPrereq>
<BonusPrereq>NONE</BonusPrereq>
<bBlitz>1</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<bInvisible>0</bInvisible>
<bHiddenNationality>0</bHiddenNationality>
<iVisibilityChange>0</iVisibilityChange>
<iMovesChange>1</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCollateralDamageChange>0</iCollateralDamageChange>
<iBombardRateChange>0</iBombardRateChange>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
<iEnemyHealChange>0</iEnemyHealChange>
<iNeutralHealChange>0</iNeutralHealChange>
<iFriendlyHealChange>0</iFriendlyHealChange>
<iSameTileHealChange>0</iSameTileHealChange>
<iAdjacentTileHealChange>0</iAdjacentTileHealChange>
<iCombatPercent>40</iCombatPercent>
<iExtraCombatStr>0</iExtraCombatStr>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iHillsDefense>0</iHillsDefense>
<iCargo>0</iCargo>
<iAIWeight>0</iAIWeight>
<TerrainDefenses>
</TerrainDefenses>
<FeatureDefenses>
</FeatureDefenses>
<SpellTypeFlatMods>
</SpellTypeFlatMods>
<SpellTypePercentMods>
</SpellTypePercentMods>
<UnitCombatMods>
</UnitCombatMods>
<PromotionCombatType>NONE</PromotionCombatType>
<iPromotionCombatMod>0</iPromotionCombatMod>
<DomainMods>
</DomainMods>
<TerrainDoubleMoves>
</TerrainDoubleMoves>
<FeatureDoubleMoves>
</FeatureDoubleMoves>
<UnitCombats>
</UnitCombats>
<HotKey></HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/Buttons/Promotions/Burningblood.dds</Button>
</PromotionInfo>
Lord Olleus Jan 07, 2007, 09:05 AM PromotionInfo, UnitSchema, CvInfo.cpp, CvInfo.h, and probably CvUnit.cpp, but that depends on what your promotion actualy does.
snarko Jan 07, 2007, 09:15 AM <UnitCombats>
</UnitCombats>
Right now the promotion is set so that no units can be promoted to it. This could be what you intended, for example if a trait gives it out and units can't recieve the promotion in the normal way, but if you want it to be a normal promotion you need to define here what unitcombattypes can get it.
The promotion obviously goes into CIV4PromotionInfos.xml. You need the Art/Interface/Buttons/Promotions/Burningblood.dds file. That should be it if the promotion only does things the default XML files allow.
It looks like you just copied the promotion from FfH. FfH uses a different schema/dll, unless your mod uses the same one you will need to make some changes, for example there is no "<SpellTypeFlatMods>" in the default game.
strategyonly Jan 07, 2007, 12:21 PM So what your saying is that if you want a magic promotion to work you need to make SDK or Python changes?? Or is there just a simple way to make a magic spell work??
Dale Jan 07, 2007, 01:09 PM The general answer is that if you add any new tag to the xml files, with the corrected schema file it'll load, but to actually do something with the new tag you will have to make SDK changes. All of the xml files are loaded via the SDK. What the game actually does with the new tag is also done via the SDK.
|
|