Modders Guide to FfH2

I personally would prefer this code just be removed, since Meta Magic can revert nodes now.



Where are the icons for the religions determined? I tried changing the religions to a more logical order (Most Good-> Most Evil makes much more sense than FoL-Order-OO-RoK-AV-Empyrean-CoEsus) by rearranging them in CIV4ReligionsInfos.xml, but in most (not all) places the religious icons were still displaying based on the religion's normal order. Having the Order use a Leaf icon and RoK use an Octopus is just wierd.
 
I personally would prefer this code just be removed, since Meta Magic can revert nodes now.



Where are the icons for the religions determined? I tried changing the religions to a more logical order (Most Good-> Most Evil makes much more sense than FoL-Order-OO-RoK-AV-Empyrean-CoEsus) by rearranging them in CIV4ReligionsInfos.xml, but in most (not all) places the religious icons were still displaying based on the religion's normal order. Having the Order use a Leaf icon and RoK use an Octopus is just wierd.

Did you adjust the gamefonts.tga to match your order in xml?
 
Did you adjust the gamefonts.tga to match your order in xml?

He speaks wisdom.

edit: and MC, your right that the mana conversion on capture isnt nessesary anymore since dispel magic can perform the function.
 
Remember though, the order you load them in ALSO determines the order in which they are granted to units which don't naturally have a Religion. So placing Esus as near to the beginning is the ideal, as they are the only ones to grant bonuses to other units for having the religion.

Thus you may want to order it from Evil --> Good
 
Its the only one that grants such bonuses so far. I'm thinking I may add some such spells for each religion. At the very least, I'm going to add some spells for AV Arcane units. (Of course, that too might make make it going from evil to good be better)

(Hmm...I don't suppose great people can randomly start with Religions, can they? I doubt it (unless I make some changes to the code), but I was just thinking religion specific Great Person spells could be interesting. How does an Esus Great Merchant stealing all the gold from a rival sound? Or an Empyrean Great Sage revealing the whole world map? Or a FoL Great Bard having a version of Mesmerize that works on Beast Class units too? Or an Order Great Priest that can be sacrificed to call a Holy War, forcing other Order civs to join your crusade?)
 
Since they aren't built it might be a special case, but I am reasonably certain that even a Great Person could be made to have a religion. Just shift the code to have it grant the religions to any unit created rather than built if neccessary.

It would probably be in your best interest to write it as a 20% chance * # Religions Present to gain a Religion. Then have it do a check against an array of the religions which are present in the city so that the unit has an equal chance to gain any religion present, and the chances overall are slightly higher to start with a religion (being guaranteed once you get 5/7 religions present).
 
I might do something like that. I might also decrease the chance of a unit having a religion upon first being built/created slightly and make it so that units without a religion can randomly gain once based on the religion of nearby units or the city where they are stationed.

On the other hand, I suspect that might slow things down a bit too much. Maybe I'll just stick with my original idea of making an Evangelist promotion (which wouldn't have the same effect as the old one from before BtS, when it just spread the unit's religion to cities that unit conquered) for Disciple Class units which would have a pyPerTurn effect that can randomly spread religion to units and cities. (The Luonnatar would use this promotion/effect to remove religions instead. Causing rival High Priests to lose their faith, and thus also their spells, can be quite useful.)


How would I block a unit from getting a promotion if you have no religion? If the unit doesn't have a particular religion? If your state religion isn't the same as the unit's religion? Is there a way to block this in Python, or do I need to make some new tags and the corresponding SDK changes?
 
I've searched essentially all the python files, and I've not found anything that can block a unit from getting a promotion. I just looked in the SDK, and bool CvUnit::canPromote(PromotionTypes ePromotion, int iLeaderUnitId) const does not appear to be exposed to python. It really should be.

I'll look into exposing it when I have time (or convince Grey Fox to do it)
 
He speaks wisdom.

edit: and MC, your right that the mana conversion on capture isnt nessesary anymore since dispel magic can perform the function.

If you all are talking about making it so that a mana node keeps its type after switching cultural borders, there are consequences.

it would, for example, require you have meta magic, a metamagic trained mage(level 2), and more importantly have him johnny on the spot when conquering a neighbor, or unless i'm mistaken, find yourself suffering diplomatic penaties for using taboo mana types, the most severe of which would probably be undercouncil resolutions.

you'll even get zinged for simple border shifts, something that is not neccessaily easily forseeable, so you won't have the oppertunity to prepare even.
 
Ok. I think moding is fun so I tried to mod my first unit:

A shapeshifter that can take 5 different animal forms. (hawk, tiger, bear, wolf and shark). Used existing graphics.

First I tried to make a 'hawk' which could be upgraded to all the other forms and a bear which could be upgraded etc. But I guess that created some kind of infinite loop. So I changed it so that I have a shapeshifter hawk can cast
a spell to summon any of the other forms permanently but kills the caster.

And actually after some time of debugging it actually worked and the unit was realy fun. However there is one problem? I want my shapeshifter to be able to keep his experience when changing form, but currently it looses all XP:

Any idees how to be able to change form without loosing the XP?

The mirror summons something which has the XP based on the caster, but then I have to edit python code?

Is it possible to create spesial promotions which are carried over to its summons?
 
From what I have heard it is possible to link graphic information to certain promotions. Perhaps you could link all form graphics to promotions and make a spell that removes/adds them, like the different crew promotions for ships.

It is possible to create promotions that carry over to summons. Take a look at how combat gives summons empower. It should be possible to make a promotion that actually gives itself to the summon. However, this would only work with promotions you create only for the shapeshifter, or else they would mess with the entire rest of the promotions.
 
I wouldn't mind creating a spesific promotion three for my shapeshifter, so thats an real alternative. Only problem then is that I should dissallow ALL 'none' shapeshifter-spesific promotions for the AI. Then I have to make a
combatclass_shapeshifter, is that right? I'll look at how combat gives empowerment.
 
I'm not sure how possible it is to link promotions to terrain. Pre-Bts, you could make promotions that depended on the terrain type, but the onMove portion of the code was deemed to be too computationally intensive. You could still make spells that add promotions depend on terrain and removed other promotions, but promotions will still last when the unit leaves that terrain.


Any promotions can grant any promotion to summons, using the <PromotionSummonPerk> tag. This includes the promotion itself.


It is quite possible to add a shapeshifter promotion and make it a prerequisite for any other promotions that you only want shapeshifters to have. There is no need to make a separate unitcombat, so long as you want the shapeshifter to have access to the other promotions of an existing unitcombat too. If you don't want the promotions to be availible though xp purchases, but only spells, then you can just set the tech prereq to TECH_NEVER or just not allow it for any unitcombat (f it is granted through python)
 
Personally I think that stp nailed what you want to do.

"Changing Shape" should be done by promotion, and replace any other shape promotions, just copy the code for Crew Changing, and remove the need to be in a city. Then set up Art Defines so that when you have the Shape Promotion your art is changed to that of the appropriate Animal, as well as making the Animal Promotion give you the changes in stats which are appropriate for the Animal which you have become. Since you are already in Python for the Animal Promotions, you can add in Hidden Nationality or any other Promotions which you think are appropriate and don't want to lump in with the shape (HN is really the only one I can think of for the category since you will want to be able to Declare).

You'll have to set the <UnitArtStyleType> for your Promotion, then define it for each promotion on the Shapeshifter in Assets/Civilizations/UnitArtStyleTypeInfos.xml.
 
But lets say I make my shapeshifter a recon and make a promotion three for him.

How can I make it such that normal promotions available to recon troops is not available for my shapeshifter? Ie normal promotions which are lost when shapeing form (using permanent summonging and caster killed methode)
 
CvPlot.cpp, in setOwner

Short version - if there is (a) no improvment or (b) a non-unique improvement on a tile with a Bonus of BONUSCLASS_MANA (any mana-type has this class), reset the tile to have the Bonus described as "BONUS_MANA" in the global-defines.

You'd want a setImprovementType here as well, to remove the improvement (possibly checking that the improvment is a mana-related one first)

Thanks a bunch for finding this!

I'm not sure I'm ready to make the jump to modifying the dll, yet... guess I'll come up with a workaround. I'm mostly just playing around - some mental masturbation - I've removed a bunch of techs and shuffled things around, but was running into issues with mana nodes.
 
Back
Top Bottom