• Paradox Games has announced today their new game “Millennia”, a semi-historical turn-based 4X game. Find out more here .

Help using a Templated mod

MrTankerson

Chieftain
Joined
Jul 20, 2021
Messages
2
New Civ 6 modder here trying to learn the ropes. I'm using the Custom Civilization modbuddy template that Maconnolly posted 6-30-2020, and modified a bunch of things to my liking, but the only thing not working is the Unique Unit gaining combat strength during a Golden Age. The actual unit itself is edited and shows up correctly (spearman unit with different name, changed combat strength, lower cost, different icon), but the ability is not triggering correctly. The preview is also showing correctly (when you hover over the sword combat strength icon in game it says +20 combat strength during a golden age, as specified in the text preview, so literally everything besides the actual ability itself is there.

I'll post the code I have without the comments from the template, and would appreciate any help in figuring it out!

Code:
INSERT INTO Types
        (Type,                                        Kind        )
VALUES    ('TRAIT_CIVILIZATION_BOONER_SLAVE',            'KIND_TRAIT'    ),
        ('UNIT_BOONER_SLAVE',                        'KIND_UNIT'        ),
        ('ABILITY_BOONER_SLAVE',                    'KIND_ABILITY'    );


INSERT INTO Tags
        (Tag,                        Vocabulary        )
VALUES    ('CLASS_BOONER_SLAVE',        'ABILITY_CLASS'    );


INSERT INTO TypeTags
        (Type,                        Tag                    )
VALUES    ('UNIT_BOONER_SLAVE',        'CLASS_BOONER_SLAVE'    ),
        ('ABILITY_BOONER_SLAVE',    'CLASS_BOONER_SLAVE'    );

INSERT INTO TypeTags (Type,        Tag)
SELECT     'UNIT_BOONER_SLAVE',    Tag
FROM     TypeTags
WHERE     Type = 'UNIT_SPEARMAN';

        
INSERT INTO Traits
        (TraitType,                            Name,                            Description                            )
VALUES    ('TRAIT_CIVILIZATION_BOONER_SLAVE',    'LOC_UNIT_BOONER_SLAVE_NAME',    'LOC_UNIT_BOONER_SLAVE_DESCRIPTION'    );

        
INSERT INTO CivilizationTraits
        (CivilizationType,                TraitType                                )
VALUES    ('CIVILIZATION_MC_BOONER',        'TRAIT_CIVILIZATION_BOONER_SLAVE'        );

    
INSERT INTO Units    (
        UnitType,
        Name,
        Description,
        TraitType,
        BaseMoves,
        Cost,
        PurchaseYield,
        AdvisorType,
        Combat,
        RangedCombat,
        Range,
        BaseSightRange,
        ZoneOfControl,
        Domain,
        FormationClass,
        PromotionClass,
        Maintenance,
        MandatoryObsoleteTech,
        PrereqTech,
        PrereqCivic
        )
SELECT    'UNIT_BOONER_SLAVE',    -- UnitType
        'LOC_UNIT_BOONER_SLAVE_NAME',    -- Name
        'LOC_UNIT_BOONER_SLAVE_DESCRIPTION', -- Description
        'TRAIT_CIVILIZATION_BOONER_SLAVE', -- TraitType
        BaseMoves,
        Cost - 15,
        PurchaseYield,
        AdvisorType,
        Combat - 10,
        RangedCombat,
        Range,
        BaseSightRange,
        ZoneOfControl,
        Domain,
        FormationClass,
        PromotionClass,
        Maintenance,
        MandatoryObsoleteTech,
        PrereqTech,
        PrereqCivic
FROM    Units
WHERE    UnitType = 'UNIT_SPEARMAN';

        
INSERT INTO UnitUpgrades (Unit,    UpgradeUnit)
SELECT     'UNIT_BOONER_SLAVE',    UpgradeUnit
FROM     UnitUpgrades
WHERE    Unit = 'UNIT_SPEARMAN';

        
INSERT INTO UnitAiInfos (UnitType,    AiType)
SELECT     'UNIT_BOONER_SLAVE',        AiType
FROM     UnitAiInfos
WHERE     UnitType = 'UNIT_SPEARMAN';
        
        
INSERT INTO UnitReplaces
        (CivUniqueUnitType,        ReplacesUnitType    )
VALUES    ('UNIT_BOONER_SLAVE',    'UNIT_SPEARMAN'        );


INSERT INTO UnitAbilities
        (UnitAbilityType,            Name,                                Description                    )
VALUES    ('ABILITY_BOONER_SLAVE',    'LOC_UNIT_BOONER_SLAVE_NAME',        'LOC_ABILITY_BOONER_SLAVE'    );

    
INSERT INTO Modifiers   
        (ModifierId,                                    ModifierType,                                    OwnerRequirementSetId        )
VALUES    ('MODIFIER_BOONER_SLAVE_GOLDEN_AGE_STRENGTH',        'MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH',            'PLAYER_HAS_GOLDEN_AGE'        );


INSERT INTO ModifierArguments       
        (ModifierId,                                        Name,                        Value    )
VALUES    ('MODIFIER_BOONER_SLAVE_GOLDEN_AGE_STRENGTH',            'Amount',                    20        );


INSERT INTO ModifierStrings
        (ModifierId,                                    Context,        Text                        )
VALUES    ('MODIFIER_BOONER_SLAVE_GOLDEN_AGE_STRENGTH',        'Preview',        'LOC_ABILITY_BOONER_SLAVE'    );


Hopefully that show up correctly, this is my first post. Let me know if you need more than what is there. Thank you so much for your time if you are able to help!
 
You never attached the Modifier to the UnitAbility. The table to do this is called UnitAbilityModifiers and has columns UnitAbilityType and ModifierId.


Wow, thanks for the reply! So do I just need to add:

Code:
INSERT INTO UnitAbilityModifiers
(UnitAbilityType, ModifierId)
VALUES ('ABILITY_BOONER_SLAVE', 'MODIFIER_BOONER_SLAVE_GOLDEN_AGE_STRENGTH')

And that's it? Does the location it is included in the rest of the code matter?



Edit: that worked! THANK YOU!!! :)
 
Last edited:
Top Bottom