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

[GS] DELETE! - Modify Cavalry strength when defending vs. melee?

Discussion in 'Mod Creation Help' started by Knasp, Jul 16, 2019.

  1. Knasp

    Knasp Warlord

    Joined:
    Sep 10, 2011
    Messages:
    262
    UPDATE: The error was that I used OwnerRequirementSetId instead of SubjectRequirementSetId. Thread can be deleted!

    I'm trying to give Cavalry units negative Combat Strength vs. melee units when they're defending. But no matter how I try, it simply doesn't work. I don't see any errors in the database.log.

    Can someone help me figure out what's wrong?
    Code:
    INSERT INTO Requirements    (RequirementId,RequirementType,Inverse)             VALUES        ('OPPONENT_IS_MELEE',                    'REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES',        0    );
    
    INSERT INTO RequirementArguments    (RequirementId,Name,[Value])                VALUES        ('OPPONENT_IS_MELEE',                    'Tag',                                            'CLASS_MELEE'    );
    
    INSERT INTO Types         ([Type],Kind)                                             VALUES        ( 'ABILITY_CAVALRY_FOREST_DEFENSE',        'KIND_ABILITY');
    INSERT INTO TypeTags     ([Type] , Tag)                                             VALUES         ( 'ABILITY_CAVALRY_FOREST_DEFENSE',        'CLASS_HEAVY_CAVALRY' );
    INSERT INTO TypeTags     ([Type] , Tag)                                             VALUES         ( 'ABILITY_CAVALRY_FOREST_DEFENSE',        'CLASS_LIGHT_CAVALRY' );
    INSERT INTO TypeTags     ([Type] , Tag)                                             VALUES         ( 'ABILITY_CAVALRY_FOREST_DEFENSE',        'CLASS_RANGED_CAVALRY');
          
    INSERT INTO UnitAbilities         (UnitAbilityType,Name,Description,Inactive)     VALUES        ('ABILITY_CAVALRY_FOREST_DEFENSE',        'LOC_ABILITY_CAVALRY_FOREST_DEFENSE_NAME',        'LOC_ABILITY_CAVALRY_FOREST_DEFENSE_DESCRIPTION',    0);
    INSERT INTO UnitAbilityModifiers        (UnitAbilityType,ModifierId)             VALUES         ('ABILITY_CAVALRY_FOREST_DEFENSE',        'CAVALRY_FOREST_DEFENSE');
          
    INSERT INTO Modifiers     (ModifierId,ModifierType,OwnerRequirementSetId)         VALUES         ('CAVALRY_FOREST_DEFENSE',                'MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH',            'REQSET_CAVALRY_FOREST_DEFENSE');
    INSERT INTO ModifierArguments             (ModifierId,Name,[Value])                 VALUES         ('CAVALRY_FOREST_DEFENSE',                'Amount',    -5    );
          
    INSERT INTO ModifierStrings        (ModifierId,Context,Text)                        VALUES        ('CAVALRY_FOREST_DEFENSE',                'Preview',                                        'LOC_ABILITY_CAVALRY_FOREST_DEFENSE_SHORT_DESCRIPTION');
    
    INSERT INTO RequirementSets             (RequirementSetId,RequirementSetType)     VALUES         ('REQSET_CAVALRY_FOREST_DEFENSE',        'REQUIREMENTSET_TEST_ALL');
    
    
    INSERT INTO RequirementSetRequirements     (RequirementSetId,RequirementId)         VALUES         ('REQSET_CAVALRY_FOREST_DEFENSE',        'OPPONENT_IS_MELEE');
    INSERT INTO RequirementSetRequirements     (RequirementSetId,RequirementId)         VALUES         ('REQSET_CAVALRY_FOREST_DEFENSE',        'UNIT_WEAK_WHEN_DEFENDING_REQUIREMENT');
    Originally I had a requirement that the plot had to be Forest, which explains the name "forest defense", but I removed it in order to test if it worked without.
     
    Last edited: Jul 16, 2019

Share This Page