Code for ability proof-read?

Ghiaman1334

Chieftain
Joined
Feb 13, 2017
Messages
15
I know this probably isn't the point of the forums, but...
I just made this. I didn't do what I said I would at all, but I did use the assets to help with wording, and I was wondering if people could point out any potential flaws.
I'm not able to test my mod because I know things aren't complete yet and I'm gonna need time to fill in any gaps, so I'm relying on your speculation and knowledge to see if it should have the desired effect.
Code:
--==========================================================================================================================
-- CIVILIZATIONS: TRAITS
--==========================================================================================================================
-- Types
--------------------------------------------------------------------------------------------------------------------------   
INSERT INTO Types   
        (Type,                                                    Kind)
VALUES    ('TRAIT_CIVILIZATION_RRA_CIV_TRAIT',                        'KIND_TRAIT'),
--------------------------------------------------------------------------------------------------------------------------           
-- Traits           
--------------------------------------------------------------------------------------------------------------------------               
INSERT INTO Traits               
        (TraitType,                                                    Name,                                                    Description)
VALUES    ('TRAIT_CIVILIZATION_RRA_CIV_TRAIT',                        'LOC_TRAIT_CIVILIZATION_RRA_CIV_TRAIT_NAME',                    'LOC_TRAIT_CIVILIZATION_RRA_CIV_TRAIT_DESCRIPTION'),       
--------------------------------------------------------------------------------------------------------------------------       
-- TraitModifiers       
--------------------------------------------------------------------------------------------------------------------------           
INSERT INTO TraitModifiers           
        (TraitType,                                            ModifierId)
VALUES    ('TRAIT_CIVILIZATION_RRA_CIV_TRAIT',                    'RRA_TRAIT_NEGATIVE_COMBAT_MODIFIER');                                                                                   
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers   
        (ModifierId,                                                ModifierType)
VALUES    ('RRA_TRAIT_NEGATIVE_COMBAT_MODIFIER',                        'MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH');   
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
        (ModifierId,                                                Name,                        Value)
VALUES    ('RRA_TRAIT_NEGATIVE_COMBAT_MODIFIER',                                        'Amount',                    '-5');
It's meant to reduce military strength of opposing military units by 5, as an ability over all my military units. I'm worried the minus in the value will mean -- = + and add 5, also I'm worried it doesn't specify the units affected so all units will take the hit, or my units will and opposing units won't.
Help me.
Sorry.
 
A few comments:
1. Your current setup won't have any effect in the game, because you need to create a UnitAbility which your trait will then attach to all your units. Search for "ABILITY_VARU" and "VARU_NEGATIVE_COMBAT" in the UnitAbilities.xml and attempt to emulate the ability.

2. In SQL, don't put numbers inside of quotes. This
Code:
INSERT INTO ModifierArguments
        (ModifierId,                                                Name,                        Value)
VALUES    ('RRA_TRAIT_NEGATIVE_COMBAT_MODIFIER',                                        'Amount',                    '-5');
will prevent the game from starting. It should look like this:
Code:
INSERT INTO ModifierArguments
        (ModifierId,                                                Name,                        Value)
VALUES    ('RRA_TRAIT_NEGATIVE_COMBAT_MODIFIER',                                        'Amount',                    -5);
Rule of thumb: text goes in quotes, numbers don't.

So, what you need to do is the following:
  • Create Trait (which you've done)
  • Create UnitAbility
  • Attach UnitAbility to Trait (look up the Preslav CS and its "ABILITY_BALKAN_CAVALRY" for guidance)
 
So I need a unit ability even though it doesn't apply to a unit in particular? I'm not defending, just making sure.
And I'll try that, thanks!
Also yep, I'll take away the quotes then, thanks.
 
So would 'ABILITY_ALL_UNITS' and 'ALL_UNITS_NEGATIVE_COMBAT' work? Or would it need to be 'OPPOSING_UNITS'?
 
Top Bottom