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

How to provide a bonus on barbarian unit capture?

Discussion in 'Mod Creation Help' started by slegach, Feb 7, 2019.

  1. slegach

    slegach Chieftain

    Joined:
    Jan 28, 2019
    Messages:
    13
    Gender:
    Male
    I'm trying to figure out how to provide the player with a bonus on every barbarian unit capture.
    I'm not limited to a something particular, I just want to create any kind of reasonable thing. I was trying to find some modifiers but looks like it's impossible using only them.
    The nearest analogues are:
    - Gorgo's Thermopylae. Theoretically can be set for every leader to gain 50% culture on every barbarian unit capture, problem is that it will also provide culture in any other combat which is not good.
    - Montezuma capture as worker ability. Problem is that it doesn't work on barbarians, only on civs.
    - Boost of Bronze Working. There are no settings for this boost, it doesn't use traits like "on_barbarian_unit_capture", so also can't be used.

    The ideal thing is something working as Gorgo's ability (the amount based on combat strength) but working only in battles against barbarians.
    Also since I've increased improvements yield I think about reducing builders charges and having barbarians captured as builders with one charge looks good too.

    Is there any way to create some bonus attached to barbarian unit capture event?
     
  2. ofek8010

    ofek8010 Chieftain

    Joined:
    Jan 24, 2019
    Messages:
    19
    Gender:
    Male
    try using the requirement type REQUIREMENT_OPPONENT_IS_BARBARIAN.
     
  3. slegach

    slegach Chieftain

    Joined:
    Jan 28, 2019
    Messages:
    13
    Gender:
    Male
    I still can't understand where is the point of activation (I mean game event on which trait/modifier should be activated, in my case it's barb kill). Currently, the only moment of activation I know is Gorgo's trait. But looking into all things associated with it I haven't found anywhere something like "ON_BARB_KILL" so the moment of activation looks to be completely hidden. And that's pitty since the only way I see now is to duplicate Gorgo's trait, trait modifiers, modifiers arguments etc with the only difference - added requirement REQUIREMENT_OPPONENT_IS_BARBARIAN to the trait.
    The problem of such an approach that I will have to add this trait to every leader (even minor civ).
    Can it be improved?
     
  4. slegach

    slegach Chieftain

    Joined:
    Jan 28, 2019
    Messages:
    13
    Gender:
    Male
    Lol, looks like it's MODIFIER_PLAYER_UNITS_ADJUST_POST_COMBAT_YIELD modifier type
     
  5. slegach

    slegach Chieftain

    Joined:
    Jan 28, 2019
    Messages:
    13
    Gender:
    Male
    Here is the final working solution:
    Code:
    INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, NewOnly, Permanent, SubjectRequirementSetId) VALUES ('AARS_BARBARIAN_CAPTURE_BONUS', 'MODIFIER_PLAYER_UNITS_ADJUST_POST_COMBAT_YIELD', '0', '0', '0', 'REQUIREMENTS_OPPONENT_IS_BARBARIAN');
    INSERT INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES ('AARS_BARBARIAN_CAPTURE_BONUS', 'PercentDefeatedStrength', 'ARGTYPE_IDENTITY', '100');
    INSERT INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES ('AARS_BARBARIAN_CAPTURE_BONUS', 'YieldType', 'ARGTYPE_IDENTITY', 'YIELD_GOLD');
    INSERT INTO TraitModifiers (TraitType, ModifierId) VALUES ('TRAIT_LEADER_MAJOR_CIV', 'AARS_BARBARIAN_CAPTURE_BONUS');
    Thank you for the help!
     

Share This Page