• Civilization 7 has been announced. For more info please check the forum here .

Modders Guide to FfH2

So I would think it should work perfectly for seeding a forest as well.

This is very interesting, I hadn't noticed that tag before. I might have to start using it. :)

A quick question for which I can't seem to find an answer by reading the main forums: Is there a way to make a directly obtained resource (via building) untradable? Disabling via -
Code:
            <TechReveal>TECH_NEVER</TechReveal>
            <TechCityTrade>TECH_NEVER</TechCityTrade>

doesn't seem to work. Is it the iAITradeModifier or iAIObjective?

This is a very negative resource and I don't want human players to trade it away in order to negate its downsides.
 
Tech City Trade is what makes it show up in your city from the map (the dreaded "Why don't I get Incense!" bug report from Philosophy...).

AI trade Mod & Trade Objective would keep you from trading with the AI only. Trade Objective is (IIRC) how many of that resource the AI wants to have (so should be set to 3 for each mana ideally. It was implemented for Corporations I assume), AI trade Mod just makes them want more from you to give it away, and give more to you if you are offering it to them.

EDIT: Just found something interesting. You can move <Button></Button> to any place in the <PromotionInfo> that you want without any errors. So making the entire file order independant IS possible... just can't figure out precisely what makes Button so special.
 
How would I go about making the new mana types I've added (Ice and Dimensional, I might add Force too) show up on the mana bar?

(Kael, if you don't want to tell me, I'd be more than happy you just going ahead and adding them in .32, even if the spells themselves are not added yet.)
 
I highly doubt that Kael intends to add ANYTHING to .31 at this point in time :p


It's all in CvMainInterface. First thing you'll see is 2 Arrays defined manually (one for each of the rows). Search for either array name and it'll take you to the screen for them.

You'll also have to add your new types to the TGAs
 
How does UnitCreatefromCombat work? (Like the Spiders and Werewolves use.)

I've been trying to add a create-from-combat ability to a new unit and discovered I can't even add the ability to create Baby Spiders to plain ol' Archers. Nothing even shows up in the pedia.

(Wah!)

Any advice?
 
How does UnitCreatefromCombat work? (Like the Spiders and Werewolves use.)

I've been trying to add a create-from-combat ability to a new unit and discovered I can't even add the ability to create Baby Spiders to plain ol' Archers. Nothing even shows up in the pedia.

(Wah!)

Any advice?

Did you also add a chance for the unit to be created? If you didn't, and there is still a 0% chance and so nothing would be done.

I'm not really sure if the civilopedia displayed units created from combat anyway.
 
A little progress - it's something to do with the module I'm working on.

When I alter an Archer to create baby spiders in the base FFH2 unitinfos file and load the game without the module everything's fine - and "50% chance to create Baby Spider" or something similar shows up in the pedia for the Archer.

However, if I have the module load the archer "reverts" - no create-from-combat. The weird thing is that the module doesn't add a new Archer-class unit or modify Archers. Something, however, is turning off the ability for the Archer (and every other unit I've tried it with) - but not the Werewolves or Spiders.

EDIT: I narrowed it down to the module's unitinfos file. That file, however, doesn't contain anything I can connect to the problem - not even an archer unit.
 
In UnitClassInfos there's "iInstanceCostModifier"? What's that do? If forced to guess I'd say it increases the cost by the value given for each unit already present in the game. But I'm not being forced...
 
I should force you to do things more often (cause you are correct)...

While calculating Production Needed, one of the first things checked is:

iProductionNeeded *= 100 + getUnitClassCount(eUnitClass) * GC.getUnitClassInfo(eUnitClass).getInstanceCostModifier();
iProductionNeeded /= 100;

Thus it is a percentage increase in the cost of the unit, based on how many of that unitclass the player currently owns (getUnitClassCount(#) is the same function checked to see if you are allowed any more national units)
 
The only use I know of for this so far is for multiple structures in Final Frontier.
 
Thus it is a percentage increase in the cost of the unit, based on how many of that unitclass the player currently owns

Thanks!

I'm being _forced_ to write more, so I'll say: Too bad. I was hoping it was had-built rather than currently-owns.
 
I was having trouble with createfromcombat in a module. When I moved everything into the base infos I was still experiencing a bug. This time, though, instead of createfromcombat never showing up it did for 1 (out of 5) unit, and showed up in another unit that did not have anything listed for createfromcombat.

The problem turned out to be a comment line. "<!-- SOP infos START -->" placed on it's own line results in the bug. The same comment sharing a line with the first line of a unit's entry doesn't.

Is that not the way to enter a comment, or is the feng shui of my desk area just seriously FUBARed? I'm beginning to wonder. (There's no such thing as a blue spider, right?)
 
How hard would it be to make the resource's graphics not show up when on the tile of a Unique Feature? The elephants moving around below the Dragon's Bones get annoying.
 
Tarquelne: With XML, you never place a comment on a line alone unless you do it inbetween the main element tags (so in CIV4UnitInfos.xml you could place them between </UnitInfo> and <UnitInfo> of 2 different entries). Much of the XML reading is done by line instead of by tag, so adding another line to the code messes everything up. So yes, placing comments after an entry on the same line is the best way to do it.
 
This is maybe of topic, but has anybody though of giving the submarine in regular civ IV the marksman promotion?

It would be realy fitting for the submarine and finaly the submarine would get the role it should have (killing transports!!!)
 
How to apply a freepromotion via buildings only if bonusprereq of that promotion is met? In older versions of FFH you needed a forge and the respective bonus to get the weapontiers now I want to do something similar.
I.e. in buildinginfos for an armourer building: <FreePromotion>PROMOTION_ITHILMAR_ARMOUR</FreePromotion>
and <bApplyFreePromotionOnMove>1</bApplyFreePromotionOnMove>

the promotion in promotioninfos needs: <BonusPrereq>BONUS_ITHILMAR</BonusPrereq>

The promotion should only be applied if the civ has the bonus.
Edit:
My approach so far was this and it seems to work except units that are built in the city still get the promotion regardless the bonus and I can't find where this is applied:
Code:
    if (pPlot->isCity())
    {
        for (iI = 0; iI < GC.getNumBuildingInfos(); iI++)
        {
            if (pPlot->getPlotCity()->getNumBuilding((BuildingTypes)iI) > 0)
            {
                if (GC.getBuildingInfo((BuildingTypes)iI).getRemovePromotion() != NO_PROMOTION)
                {
                    if (isHasPromotion((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getRemovePromotion()))
                    {
                        setHasPromotion((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getRemovePromotion(), false);
                    }
                }
                if (GC.getBuildingInfo((BuildingTypes)iI).isApplyFreePromotionOnMove())
                {
                    if (GC.getBuildingInfo((BuildingTypes)iI).getFreePromotion() != NO_PROMOTION)
					{
//WH: Ploeperpengel begin modify meteoric iron
						if (GC.getPromotionInfo((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getFreePromotion()).getBonusPrereq() != NO_BONUS)
						{
							if (pPlot->getPlotCity()->hasBonus((BonusTypes)GC.getPromotionInfo((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getFreePromotion()).getBonusPrereq()))
							{
								if ((getUnitCombatType() != NO_UNITCOMBAT) && GC.getPromotionInfo((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getFreePromotion()).getUnitCombat(getUnitCombatType()))
								{
									setHasPromotion((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getFreePromotion(), true);
								}
							}
						}
						else if ((getUnitCombatType() != NO_UNITCOMBAT) && GC.getPromotionInfo((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getFreePromotion()).getUnitCombat(getUnitCombatType()))
						{
							setHasPromotion((PromotionTypes)GC.getBuildingInfo((BuildingTypes)iI).getFreePromotion(), true);
						}
//WH: end modify
 
Any suggestions for a way to require a civ have 2 of a luxury resource before getting the +1 Happy? Using python, I mean, rather than directly lifting code from the Saints and Sinners .dll.
 
Reasonably certain that it is because you are setting the <FreePromotion> tag. This calls a DLL function which gives that promotion to any unit built in the city. Just reference your building specifically instead of having it do a check for any building with appropriate tags, and remove the <FreePromotion> entry and it'll work.
 
Top Bottom