modding: give the ability ABILITY_CAPTIVE_WORKERS as civ trait

kassambique

Chieftain
Joined
Jun 1, 2011
Messages
4
Hello,

I was able to create a first modifier and indeed see it in the game (yeehaw) but I'm struggling with another one. I'd like to give the ability ABILITY_CAPTIVE_WORKERS to units of this new civilization, this ability is yet defined une the UnitAbilities file of the game.
Even though there is no error when building the mode and fire tuner seems to apply the modifier MODIFIER_RWK_PLAYER_UNITS_CAN_CAPTURE to all unit, the ability is not there on each unit, as if one step to "propagate" the modifier from "Player's unit" to the unit itself was missing. But I can't see what, can somebody help?
Code:
--==========================================================================================================================
-- CIVILIZATIONS: TRAITS
--==========================================================================================================================
-- Types
--------------------------------------------------------------------------------------------------------------------------   
INSERT INTO Types   
        (Type,                                                    Kind)
VALUES    ('TRAIT_CIVILIZATION_RWK_CAN_CAPTURE',                        'KIND_TRAIT'),
        ('MODIFIER_RWK_PLAYER_UNITS_CAN_CAPTURE',               'KIND_MODIFIER');   
        
        
--------------------------------------------------------------------------------------------------------------------------           
-- Traits           
--------------------------------------------------------------------------------------------------------------------------               
INSERT INTO Traits               
        (TraitType,                                                    Name,                                                    Description)
VALUES    ('TRAIT_CIVILIZATION_RWK_CAN_CAPTURE',                        'LOC_TRAIT_CIVILIZATION_RWK_CAN_CAPTURE_NAME',                    'LOC_TRAIT_CIVILIZATION_RWK_CAN_CAPTURE_DESCRIPTION');
--------------------------------------------------------------------------------------------------------------------------       
-- TraitModifiers       
--------------------------------------------------------------------------------------------------------------------------           
INSERT INTO TraitModifiers           
        (TraitType,                                            ModifierId)
VALUES    ('TRAIT_CIVILIZATION_RWK_CAN_CAPTURE',                    'MODIFIER_RWK_PLAYER_UNITS_CAN_CAPTURE');   


                                                                                
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers   
        (ModifierId,                                                ModifierType, Permanent)
VALUES    ('MODIFIER_RWK_PLAYER_UNITS_CAN_CAPTURE',                                        'MODIFIER_PLAYER_UNITS_GRANT_ABILITY', '1');           
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
        (ModifierId,                                                Name,                        Value)
VALUES    ('MODIFIER_RWK_PLAYER_UNITS_CAN_CAPTURE',         'AbilityType',  'ABILITY_CAPTIVE_WORKERS');

Thanks
 
You don't need a Types definition for your Modifier. You only need to define new DynamicModifiers, which you have none of. That said, the rest of your code seems fine. You should take a look at your Database log after running your code, though I'm not sure even the extraneous Type definition would cause an error. One thing you're missing is linking your Trait to a civilization or leader. Instead of using Firetuner, you should specify a specific civ or leader to attach your trait to, and see if it applies it properly there. You can even just use a base civ, like America. It might be an issue using Firetuner where it's not propagating through the collection properly for whatever reason.
 
Back
Top Bottom