Problem changing production bonus to a unit promotion class

Mettpawwz

Chieftain
Joined
Feb 4, 2017
Messages
73
I'm trying to give the policy "Survey" an additional bonus 90% production towards scouts, and the code below creates entries in the PolicyModifiers, Modifiers, and ModifierArguments table (I've checked that it does it correctly in SQLite). It follows the formatting of other policies such as "Agoge" perfectly, yet does nothing in game for some reason.

Does anyone know why it doesn't work?

Code:
    --50% Production towards Recon Units.
       --Ancient
       -- PolicyModifiers Table entry
       INSERT INTO PolicyModifiers    (PolicyType, ModifierId)
       VALUES                            ('POLICY_SURVEY', 'SURVEY_ANCIENT_RECON_PRODUCTION');

       -- Modifiers Table entry
       INSERT INTO Modifiers    (ModifierId, ModifierType)
       VALUES                    ('SURVEY_ANCIENT_RECON_PRODUCTION', 'MODIFIER_PLAYER_CITIES_ADJUST_UNIT_TAG_ERA_PRODUCTION');

       -- ModifierArguments Table entries
       INSERT INTO ModifierArguments    (ModifierId, Name, Value, Extra)
       VALUES                            ('SURVEY_ANCIENT_RECON_PRODUCTION', 'UnitPromotionClass', 'PROMOTION_CLASS_RECON', '-1');
       INSERT INTO ModifierArguments    (ModifierId, Name, Value, Extra)
       VALUES                            ('SURVEY_ANCIENT_RECON_PRODUCTION', 'EraType', 'ERA_ANCIENT', '-1');
       INSERT INTO ModifierArguments    (ModifierId, Name, Value, Extra)
       VALUES                            ('SURVEY_ANCIENT_RECON_PRODUCTION', 'Amount', '90', '-1');
 
Last edited:
'90' and '-1' will be interpretted as text rather than integer. in SQL you don't need ' around integer values. Try that first. Otherwise I cannot see anything you are missing from comparing to Agoge's effect on Melee Unit Production.
 
Thanks for the tip, I think there's something wrong with the actual MODIFIER_PLAYER_CITIES_ADJUST_UNIT_TAG_ERA_PRODUCTION ModifierType though. I tried that but it didn't work. Then I tried just running the following statement on its own:

Code:
UPDATE ModifierArguments SET Value=100000 where ModifierId='AGOGE_ANCIENT_MELEE_PRODUCTION' AND Name='Amount';

And after some testing it still only increases production towards warriors by 50%. For a new modifier like I made for Scouts (from Survey) it just stays at 0 no matter what you put in and what gets displayed in the ModifierArguments table. It definitely is writing into the ModifierArguments table though, since this is what it looks like in SQLite after a game:

http://imgur.com/a/R8v2j
 
Back
Top Bottom