BonusProductionModifiers

Thandor

Chieftain
Joined
Mar 1, 2019
Messages
21
Hello everybody,

First of all, I want say I love this mod, I can't think about playing Civ IV without it, I can't even play any of the newer Civ games because they seem too poor compared to this mod..

I'm posting here because I aslo love modding the games I enjoy playing and I was trying to change something about unit production requirements and bonuses, but I can't figure out what I'm missing here..

The idea is to remove strategic resources requirements so you can build any unit, no matter what, and instead use bonus to several stats (production, combat strength, etc) if you have access to that resource, but you don't punish a player just because it has not access to a given resource..

Example:

Spearman right now you need to have access to one of these resources
Spoiler :
<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_IRON</BonusType>
<BonusType>BONUS_OBSIDIAN</BonusType>
</PrereqBonuses>


I like to change it to something like:

Having access to OBSIDIAN gives you 25% production bonus
Having access to COPPER gives you 30% production bonus and 5% Combat Strength
Having access to IRON gives you 45% production bonus and 10% Combat Strength

So if you has no access to any of those resources you still can train Spearman, but it will cost you more time and will be less efficient than if you have access to any of them

I have modded AND_CIV4UnitSchema
Spoiler :

<ElementType name="BonusCombatModifier" content="eltOnly">
<element type="BonusType"/>
<element type="iCombatPercent"/>
</ElementType>
<ElementType name="BonusProductionModifiers" content="eltOnly">
<element type="BonusProductionModifier" minOccurs="0" maxOccurs="*"/>
<element type="BonusCombatModifier" minOccurs="0" maxOccurs="*"/>
</ElementType>


and CIV4UnitInfos
Spoiler :

<BonusProductionModifiers>
<BonusProductionModifier>
<BonusType>BONUS_OBSIDIAN</BonusType>
<iProductonModifier>25</iProductonModifier>
</BonusProductionModifier><BonusCombatModifier>
<BonusType>BONUS_COPPER</BonusType>
<iCombatPercent>10</iCombatPercent>
</BonusCombatModifier>
</BonusProductionModifiers>

But It seems I need to change something else.. any clues?

Thanks in advance and sorry for the long post
 
It would take DLL editing to get those kinds of effects. Editing the schema won't do anything unless you also edit the DLL to tell the game exactly how to use those modifiers. Theoretically, you could have an event-granted promotion that grants the units you want a Strength bonus, but the promotion is irrevocable once granted.

<BonusProductionModifiers> already exists so you can use that. If you want to remove the resource requirement, you would either need to edit the core files, or use a module and a <bForceOverwrite>.
 
It would take DLL editing to get those kinds of effects. Editing the schema won't do anything unless you also edit the DLL to tell the game exactly how to use those modifiers. Theoretically, you could have an event-granted promotion that grants the units you want a Strength bonus, but the promotion is irrevocable once granted.

<BonusProductionModifiers> already exists so you can use that. If you want to remove the resource requirement, you would either need to edit the core files, or use a module and a <bForceOverwrite>.


I was trying to avoid editing the DLL, it looks the best way to do it, but I don't feel confident enough about working with it..

The promotion was my second approach, something like Copper/Iron Equipment: Grants X% strength, but I don't like the idea of giving it with events.. I have to take a look at the files (It has been a very long time since I modded this game for the last time) maybe I can add a new building that grants a promotion to certain units like Copper/Iron Armory: Grants Copper/Iron Equipment promotion

Regards and Thanks for the advice!
 
I was trying to avoid editing the DLL, it looks the best way to do it, but I don't feel confident enough about working with it..

The promotion was my second approach, something like Copper/Iron Equipment: Grants X% strength, but I don't like the idea of giving it with events.. I have to take a look at the files (It has been a very long time since I modded this game for the last time) maybe I can add a new building that grants a promotion to certain units like Copper/Iron Armory: Grants Copper/Iron Equipment promotion

Regards and Thanks for the advice!

Fall From Heaven modmod upgrades the strength of units with a promotion when they have copper/iron or mithril available.
 
Fall From Heaven modmod upgrades the strength of units with a promotion when they have copper/iron or mithril available.

Thanks for the advice!

I will take a look on that, could you tell me what submod has those features? or are they in the main mod too?

Edit: Found it, I had an old version.
 
Last edited:
Top Bottom