FungeonKeeper
Chieftain
- Joined
- Apr 17, 2021
- Messages
- 7
I cannot figure out what the problem is.
What I'm trying to do is to make the barracks building give an anti-cavalry unit when built. So far, it hasn't worked. As in, I build a barracks and nothing happens.
Here's the code:
Thought process:
What I'm trying to do is to make the barracks building give an anti-cavalry unit when built. So far, it hasn't worked. As in, I build a barracks and nothing happens.
Here's the code:
Code:
INSERT INTO BuildingModifiers (BuildingType, ModifierId)
VALUES ('BUILDING_BARRACKS', 'BK_BARRACKS_CREATE_AC');
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent)
VALUES ('BK_BARRACKS_CREATE_AC', 'MODIFIER_PLAYER_CITIES_GRANT_UNIT_BY_CLASS', TRUE, TRUE);
INSERT INTO ModifierArguments (ModifierId, Name, Value)
VALUES ('BK_BARRACKS_CREATE_AC', 'UnitPromotionClassType', 'PROMOTION_CLASS_ANTI_CAVALRY'),
('BK_BARRACKS_CREATE_AC', 'Amount', '1');
Spoiler :
This code is mostly based on the free spy from the intelligence agency (Expansion1_Buildings.xml), but using the ModifierType from Victoria's free melee unit (Leaders.xml) with the Statue of Zeus's unit creation also as a reference (Byzantium_Gaul_Buildings.xml).
I don't know how RunOnce and Permanent work, so it's possible that's the problem, but I'm not sure what they should be set to. The GOV_ADD_SPY_UNIT only specifies that RunOnce is true, and TRAIT_FREE_MELEE_UNIT_NON_HOME_CONTINENT sets Permanent to true, but setting both to true in this case hasn't worked. I've tried a few combinations without success.
I don't know how RunOnce and Permanent work, so it's possible that's the problem, but I'm not sure what they should be set to. The GOV_ADD_SPY_UNIT only specifies that RunOnce is true, and TRAIT_FREE_MELEE_UNIT_NON_HOME_CONTINENT sets Permanent to true, but setting both to true in this case hasn't worked. I've tried a few combinations without success.