1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Help with modding: How to use NearbyImprovementCombatBonus in a promotion

Discussion in 'Community Patch Project' started by gwennog, Jan 27, 2021.

  1. gwennog

    gwennog Prince

    Joined:
    May 31, 2015
    Messages:
    300
    Gender:
    Male
    Location:
    France
    I have a problem with NearbyImprovementCombatBonus in UnitPromotions.

    Either I'm using it wrong or it doesn't work.

    I have filled in all three entries:

    upload_2021-1-27_18-46-51.png

    When I look at the type of variable for each column, CombatBonusImprovement is defined as integer, should it be text?

    Could someone tell me if I'm on the wrong track?

    Thank you.
     
  2. HungryForFood

    HungryForFood Prince

    Joined:
    Oct 4, 2016
    Messages:
    451
    Location:
    Malaysia
    Try setting the Value of PROMOTIONS_IMPROVEMENT_BONUS in CustomModOptions to 1. I think the nearby improvement stuff was set to be disabled by default recently for performance reasons.
     
  3. gwennog

    gwennog Prince

    Joined:
    May 31, 2015
    Messages:
    300
    Gender:
    Male
    Location:
    France
    Thank you, I'm going to try that (indeed it's disabled by default)
     
  4. gwennog

    gwennog Prince

    Joined:
    May 31, 2015
    Messages:
    300
    Gender:
    Male
    Location:
    France
    I try but don't work. In fact, the same capacity exist in Traits and there, the variable is of type text ('CombatBonusImprovement' text default NULL).
    In UnitPromotions, the same variable is defined as integer, it can't work, in my opinion.

    should I post this on Github?
     
  5. HungryForFood

    HungryForFood Prince

    Joined:
    Oct 4, 2016
    Messages:
    451
    Location:
    Malaysia
    Sure, go ahead. Can't find any issue from a quick look in a code. I'll test it when I have time.

    One question, are you using the trait version and the promotion version at the same time?
     
    Last edited: Feb 18, 2021
  6. Padre19

    Padre19 Warlord

    Joined:
    Oct 4, 2016
    Messages:
    178
    Gender:
    Male
    for me it works
     
  7. gwennog

    gwennog Prince

    Joined:
    May 31, 2015
    Messages:
    300
    Gender:
    Male
    Location:
    France
    No, I just test the Promotion version.
     
  8. gwennog

    gwennog Prince

    Joined:
    May 31, 2015
    Messages:
    300
    Gender:
    Male
    Location:
    France
    The Trait version or the Promotion version ?
    Because if it's the Promotion version, I am at the end of my Latin... and I've requested @HungryForFood for nothing :blush:
     
    Last edited: Feb 18, 2021
  9. Padre19

    Padre19 Warlord

    Joined:
    Oct 4, 2016
    Messages:
    178
    Gender:
    Male
    Promotion version

    INSERT INTO UnitPromotions
    (Type, Description, Help, PortraitIndex, IconAtlas, Sound, EnemyRoute, CannotBeChosen, LostWithUpgrade, NearbyImprovementCombatBonus, NearbyImprovementBonusRange, PediaType, PediaEntry, CombatBonusImprovement)
    VALUES ('PROMOTION_CITADEL', 'TXT_KEY_PROMOTION_CITADEL', 'TXT_KEY_PROMOTION_CITADEL_HELP', 46, 'extraPromo_Atlas', 'AS2D_IF_LEVELUP', 1, 1, 1, 25, 2, 'PEDIA_ATTRIBUTES', 'TXT_KEY_PROMOTION_CITADEL', 'IMPROVEMENT_CITADEL');



    INSERT INTO Language_en_US (Tag, Text)
    VALUES ('TXT_KEY_PROMOTION_CITADEL', 'Citadel');

    INSERT INTO Language_en_US (Tag, Text)
    VALUES ('TXT_KEY_PROMOTION_CITADEL_HELP', '+25% [ICON_STRENGTH] Combat Bonus near Citadel.Can use enemy roads.');
     
    Last edited: Feb 18, 2021
  10. gwennog

    gwennog Prince

    Joined:
    May 31, 2015
    Messages:
    300
    Gender:
    Male
    Location:
    France
    OK, I use the same code but with no result.

    A last question @Padre19, how does the bonus appear in the unit combat text? Is it a Improment bonus or a miscellaneous bonus ?

    Thank you.
     
  11. Padre19

    Padre19 Warlord

    Joined:
    Oct 4, 2016
    Messages:
    178
    Gender:
    Male
    Near Combat Bonus Tile
     
    gwennog likes this.

Share This Page