NEED HELP: Free Promotion for an unit type as leader ability

Tomice

Passionate Smart-Ass
Joined
Oct 5, 2009
Messages
2,366
Location
Austria, EU, no kangaroos ;)
Hi!
I'd like to create a custom civ as my first real mod (just copy-pasted stuff in XML files before, e.g. giving roman legions to china or whatever).

I want to give all archers a free promotion as civ ability.
While the topic was somehow touched here before, I judt don't understand how. Note that I have no knowledge about SQL, so i'd really prefer going an XML route if possible.

Macedon Hetairoi have free promotions, but looking through the XML "Macedonia_Persia_GameplayData" I just can't see where the free promotion is attached to Hetairoi and how I could "harvest" the code to give it to all ranged units.
 
look for <ModifierId>HETAIROI_FREE_PROMOTION</ModifierId> in that file. The code appears to be adjusting the unit's starting XP to a negative value which appears to have the effect of granting a promotion-choice to the unit from the start of it's "life". There may be more going on in that file but I saw that from a quick search for "HETAIROI" in the file.
 
Here are the details of the Hetairoi modifier LeeS mentioned.

I have not tested it but I believe the Amount field in ModifierArguments is a negative number if you want to award a specific number of levels. It's positive (I think) if you want to award a specific amount of experience. Could be wrong about this.

upload_2017-6-16_18-56-23.png
 
I didn't test this code, but here is close to what I would start with if I were doing this for Cleopatra:


Code:
INSERT INTO Modifiers
    (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES    ('MYTAG_FREE_PROMOTION', 'MODIFIER_PLAYER_UNIT_ADJUST_GRANT_EXPERIENCE', 0, 0, NULL, NULL) ,
('MYTAG_FREE_PROMOTION_PLAYER', 'MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER', 0, 0, NULL, NULL) ;
    
INSERT INTO ModifierArguments
    (ModifierId,             Name,         Type,             Value,             Extra,     SecondExtra)
VALUES    ('MYTAG_FREE_PROMOTION',         'Amount',     'ARGTYPE_IDENTITY',         '-1',            NULL,     NULL)  ,
('MYTAG_FREE_PROMOTION_PLAYER',         'ModifierId',     'ARGTYPE_IDENTITY',         'MYTAG_FREE_PROMOTION',            NULL,     NULL)  ;
    
INSERT INTO TraitModifiers
    (TraitType,             ModifierID)
VALUES    ('TRAIT_LEADER_MEDITERRANEAN',    'MYTAG_FREE_PROMOTION_PLAYER') ;


You can replace TRAIT_LEADER_MEDITERRANEAN with the custom trait you create for your new leader. MYTAG_ should be replaced with your personal tag code. This is whatever you choose to use. I personally use QUO_, JFD uses JFD_, the CQUI group uses CQUI_, etc. Its just a good habit to be in.
 
Last edited:
I didn't test this code, but here is close to what I would start with if I were doing this for Cleopatra:


Code:
INSERT INTO Modifiers
    (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES    ('MYTAG_FREE_PROMOTION', 'MODIFIER_PLAYER_UNIT_ADJUST_GRANT_EXPERIENCE', 0, 0, NULL, NULL) ,
('MYTAG_FREE_PROMOTION_PLAYER', 'MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER', 0, 0, NULL, NULL) ;
   
INSERT INTO ModifierArguments
    (ModifierId,             Name,         Type,             Value,             Extra,     SecondExtra)
VALUES    ('MYTAG_FREE_PROMOTION',         'Amount',     'ARGTYPE_IDENTITY',         '-1',            NULL,     NULL)  ,
('MYTAG_FREE_PROMOTION_PLAYER',         'ModifierId',     'ARGTYPE_IDENTITY',         'MYTAG_FREE_PROMOTION',            NULL,     NULL)  ;
   
INSERT INTO TraitModifiers
    (TraitType,             ModifierID)
VALUES    ('TRAIT_LEADER_MEDITERRANEAN',    'MYTAG_FREE_PROMOTION_PLAYER') ;


You can replace TRAIT_LEADER_MEDITERRANEAN with the custom trait you create for your new leader. MYTAG_ should be replaced with your personal tag code. This is whatever you choose to use. I personally use QUO_, JFD uses JFD_, the CQUI group uses CQUI_, etc. Its just a good habit to be in.
thank you so much. helped me a ton.
 
Back
Top Bottom