ReggieB
Chieftain
- Joined
- Mar 28, 2018
- Messages
- 36
Hi all, I'm working on a mod to create a building that will prevent damage from disasters for the city in the same way that the Governor Liang's "Reinforced Materials" promotion does. However I haven't been able to get the effect to work so far, and I'm hoping you can offer some advice.
It was easy enough to create a building called "BUILDING_STRUCTURAL_REINFORCEMENTS", but so far I haven't found any way to apply the damage prevention modifier correctly. The first thing I tried was simply copying the modifier from Liang. Note that the spelling "PREVENET" instead of "PREVENT" is consistent with the game code:
My best guess as to why that doesn't work is because that modifier applies to "COLLECTION_OWNER", where owner refers to the governor herself and not the city where she resides. So to try to get around that, I made a dynamic modifier that has the same effect "EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE", but that applies to "COLLECTION_PLAYER_CITIES" instead:
However that modifier also doesn't seem to do anything. In theory there should be some way to apply that effect to a city using a building instead of a governor. But I'm at a loss as to how I would forumalte a dynamic modifier to do that. Any help would be appreciated, thanks!
It was easy enough to create a building called "BUILDING_STRUCTURAL_REINFORCEMENTS", but so far I haven't found any way to apply the damage prevention modifier correctly. The first thing I tried was simply copying the modifier from Liang. Note that the spelling "PREVENET" instead of "PREVENT" is consistent with the game code:
Code:
<BuildingModifiers>
<Row ModifierId="REINFORCED_INFRASTRUCTURE_PREVENET_STRUCTURAL_DAMAGE" BuildingType="BUILDING_STRUCTURAL_REINFORCEMENTS"/>
</BuildingModifiers>
My best guess as to why that doesn't work is because that modifier applies to "COLLECTION_OWNER", where owner refers to the governor herself and not the city where she resides. So to try to get around that, I made a dynamic modifier that has the same effect "EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE", but that applies to "COLLECTION_PLAYER_CITIES" instead:
Code:
<Types>
<Row Type="MODTYPE_STRUCTURAL_REINFORCEMENTS_PLAYER_CITIES_ADJUST_PREVENT_STRUCTURAL_DAMAGE" Kind="KIND_MODIFIER"/>
</Types>
<DynamicModifiers>
<Row ModifierType="MODTYPE_STRUCTURAL_REINFORCEMENTS_PLAYER_CITIES_ADJUST_PREVENT_STRUCTURAL_DAMAGE" CollectionType="COLLECTION_PLAYER_CITIES" EffectType="EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE"/>
</DynamicModifiers>
<Modifiers>
<Row ModifierId="STRUCTURAL_REINFORCEMENTS_PREVENTION" ModifierType="MODTYPE_STRUCTURAL_REINFORCEMENTS_PLAYER_CITIES_ADJUST_PREVENT_STRUCTURAL_DAMAGE"/>
</Modifiers>
<ModifierArguments>
<Row ModifierId="STRUCTURAL_REINFORCEMENTS_PREVENTION" Name="Prevent" Type="ARGTYPE_IDENTITY" Value="1"/>
</ModifierArguments>
<BuildingModifiers>
<Row ModifierId="STRUCTURAL_REINFORCEMENTS_PREVENTION" BuildingType="BUILDING_STRUCTURAL_REINFORCEMENTS"/>
</BuildingModifiers>
However that modifier also doesn't seem to do anything. In theory there should be some way to apply that effect to a city using a building instead of a governor. But I'm at a loss as to how I would forumalte a dynamic modifier to do that. Any help would be appreciated, thanks!