Viciousbunny
Chieftain
- Joined
- Apr 19, 2021
- Messages
- 2
TL;DR: I'm trying to add appropriate combat bonuses to anti-air guns and mobile SAMs. Having trouble with diplomatic visibility combat bonus, terrain defensive modifiers, and Victor governor's Garrison Commander promotion.
I'm very new to the modding community and happy to be here! Last year (about 6 months ago) I opened a support ticket to 2K explaining that anti air units did not properly receive combat bonuses from most sources. Since I play this game in multiplayer regularly, this resulted in bombers being able to take down anti air units with ease, giving no effective counter to air units. 2K confirmed this is a bug, and needs to be fixed. After waiting this long for a fix and not seeing one, I decided to try and learn how to mod so I can just fix it myself. I've spend hours now pouring through the SQL and XML, and I've been able to fix a number of these combat bonuses.
One such example was for Hojo Tokimune's bonus to units on the coast:
INSERT INTO TypeTags (Type, Tag)
VALUES ('ABILITY_HOJO_TOKIMUNE_COASTAL_COMBAT_BONUS', 'CLASS_SUPPORT');
It seems easy enough to fix for each buff listed in the table TypeTags, where I can just add support units to the list of units that receive the buff. However, I'm having trouble with the bonuses listed below:
Terrain Defensive Modifiers: In the "Terrains" table/file, there's a column for DefensiveModifier, but I can't find where that modifier is applied to a unit.
Diplomatic Visibility Combat Bonus: This one is elusive, I started by looking at leaders like Catherine de Medici and civilizations like Mongolia to get a sense of what their traits were doing with diplomatic visibility. Catherine increases an attribute called "Source" by 1, and Mongolia gets an additional +3 combat strength for visibility, but I also cannot seem to find where this is applied to units.
Garrison Commander Promotion: I tracked this bonus from Expansion1_Governors.xml to Expansion1_Modifiers.xml to a dead end here
<Row>
<ModifierType>MODIFIER_CITY_ADJUST_CITY_COMBAT_BONUS</ModifierType>
<CollectionType>COLLECTION_OWNER</CollectionType>
<EffectType>EFFECT_ADJUST_CITY_COMBAT_BONUS</EffectType>
</Row>
where it appears to apply to a collection.
While I believe adding CLASS_SUPPORT is a viable option for fixing most of these issues, I've found what I believe to be the source of the problem in my search. That is this in Units.xml:
<!-- IMPLICIT TAGS: filtered by criteria, do not need to be individually assigned to the UNIT -->
<Row Tag="CLASS_ALL_UNITS" Vocabulary="ABILITY_CLASS"/>
<Row Tag="CLASS_ALL_COMBAT_UNITS" Vocabulary="ABILITY_CLASS"/>
<!-- STANDARD TAGS -->
....
CLASS_ALL_COMBAT_UNITS does not include CLASS_SUPPORT, so every effect that applies to combat units will not apply to anti air guns and mobile SAMs. I'm not positive yet that this is intentional for any particular effects, but I'd be curious to know if there was a way that I could just add CLASS_SUPPORT to CLASS_ALL_COMBAT_UNITS somehow. If not, I think I'm missing a link.
I'm very new to the modding community and happy to be here! Last year (about 6 months ago) I opened a support ticket to 2K explaining that anti air units did not properly receive combat bonuses from most sources. Since I play this game in multiplayer regularly, this resulted in bombers being able to take down anti air units with ease, giving no effective counter to air units. 2K confirmed this is a bug, and needs to be fixed. After waiting this long for a fix and not seeing one, I decided to try and learn how to mod so I can just fix it myself. I've spend hours now pouring through the SQL and XML, and I've been able to fix a number of these combat bonuses.
One such example was for Hojo Tokimune's bonus to units on the coast:
INSERT INTO TypeTags (Type, Tag)
VALUES ('ABILITY_HOJO_TOKIMUNE_COASTAL_COMBAT_BONUS', 'CLASS_SUPPORT');
It seems easy enough to fix for each buff listed in the table TypeTags, where I can just add support units to the list of units that receive the buff. However, I'm having trouble with the bonuses listed below:
Terrain Defensive Modifiers: In the "Terrains" table/file, there's a column for DefensiveModifier, but I can't find where that modifier is applied to a unit.
Diplomatic Visibility Combat Bonus: This one is elusive, I started by looking at leaders like Catherine de Medici and civilizations like Mongolia to get a sense of what their traits were doing with diplomatic visibility. Catherine increases an attribute called "Source" by 1, and Mongolia gets an additional +3 combat strength for visibility, but I also cannot seem to find where this is applied to units.
Garrison Commander Promotion: I tracked this bonus from Expansion1_Governors.xml to Expansion1_Modifiers.xml to a dead end here
<Row>
<ModifierType>MODIFIER_CITY_ADJUST_CITY_COMBAT_BONUS</ModifierType>
<CollectionType>COLLECTION_OWNER</CollectionType>
<EffectType>EFFECT_ADJUST_CITY_COMBAT_BONUS</EffectType>
</Row>
where it appears to apply to a collection.
While I believe adding CLASS_SUPPORT is a viable option for fixing most of these issues, I've found what I believe to be the source of the problem in my search. That is this in Units.xml:
<!-- IMPLICIT TAGS: filtered by criteria, do not need to be individually assigned to the UNIT -->
<Row Tag="CLASS_ALL_UNITS" Vocabulary="ABILITY_CLASS"/>
<Row Tag="CLASS_ALL_COMBAT_UNITS" Vocabulary="ABILITY_CLASS"/>
<!-- STANDARD TAGS -->
....
CLASS_ALL_COMBAT_UNITS does not include CLASS_SUPPORT, so every effect that applies to combat units will not apply to anti air guns and mobile SAMs. I'm not positive yet that this is intentional for any particular effects, but I'd be curious to know if there was a way that I could just add CLASS_SUPPORT to CLASS_ALL_COMBAT_UNITS somehow. If not, I think I'm missing a link.