[R&F] Cant seem to make Encampments give production

Question

King
Joined
Mar 12, 2008
Messages
950
Im trying to make Encampments give production. I was able to make city centers give production/gold so I simply used the same steps, but it does not work. Database.log shows no errors, but ingame, encampments just do not give any yields at all.

I tried doing it via xml and SQL, neither works. What am I missing? The weird thing is that it obviously works for the MBANZA...and im using the same format...

Code:
    <Row>
           <DistrictType>DISTRICT_ENCAMPMENT</DistrictType>
           <ModifierId>ENCAMPMENT_PRODUCTION</ModifierId>
       </Row>

    <Row>
           <ModifierId>ENCAMPMENT_PRODUCTION</ModifierId>
           <ModifierType>MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE</ModifierType>
       </Row>

<Row>
           <ModifierId>ENCAMPMENT_PRODUCTION</ModifierId>
           <Name>Amount</Name>
           <Value>2</Value>
       </Row>
    <Row>
           <ModifierId>ENCAMPMENT_PRODUCTION</ModifierId>
           <Name>YieldType</Name>
           <Value>YIELD_PRODUCTION</Value>
       </Row>

Code:
INSERT OR REPLACE INTO DistrictModifiers (DistrictType, ModifierId)
VALUES    ('DISTRICT_ENCAMPMENT', 'ENCAMPMENT_PRODUCTION');

INSERT OR REPLACE INTO Modifiers (ModifierId, ModifierType)
VALUES    ('ENCAMPMENT_PRODUCTION', 'MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE');

INSERT OR REPLACE INTO ModifierArguments (ModifierId, Name, Value)
VALUES    ('ENCAMPMENT_PRODUCTION', 'Amount', '2');

INSERT OR REPLACE INTO ModifierArguments (ModifierId, Name, Value)
VALUES    ('ENCAMPMENT_PRODUCTION', 'YieldType', 'YIELD_PRODUCTION');
 
The game knows because im modifying DIstrictModifiers. There are no requirements needed....the MBANZA doesnt have any.

DISTRICT_ENCAMPMENT -> ENCAMPMENT_PRODUCTION->modifies base yield->yield_production->amount : 2

Everything as far as i can see is clearly defined but the game does not give encampments two production the way MBANZA have food/gold.
 
Does anyone have any idea why this will not work for encampments or aerodrome, but works for all other districts?
 
Does anyone have any idea why this will not work for encampments or aerodrome, but works for all other districts?

Hey, I was able to add +10 Production to all Encampments with the following:
Code:
INSERT INTO Modifiers
        (ModifierId, ModifierType)
VALUES ('MODIFIER_ENCAMPMENT_PRODUCTION','MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE');


INSERT INTO ModifierArguments
        (ModifierId, Name, Value)
VALUES    ('MODIFIER_ENCAMPMENT_PRODUCTION','Amount', '10'), -- For testing
        ('MODIFIER_ENCAMPMENT_PRODUCTION','YieldType', 'YIELD_PRODUCTION');

        
INSERT INTO DistrictModifiers
        (DistrictType,     ModifierId)
VALUES    ('DISTRICT_ENCAMPMENT','MODIFIER_ENCAMPMENT_PRODUCTION');

Result:



Keep in mind it doesn't add the bonus to the District tooltip or Civilopedia, but then again when I tried this with the Campus district it alszo didn't display it.
 
Try organizing "INSERT INTO DistrictModifiers..." after "INSERT INTO Modifiers..." and "INSERT INTO ModifierArguments..."?
 
I copied and pasted in the order you did, so its Modifiers -> ModifierArguments -> DistrictModifiers. No errors in database.log other than it complaining about LocalizedText...but encampments still have no production bonus.
 
I copied and pasted in the order you did, so its Modifiers -> ModifierArguments -> DistrictModifiers. No errors in database.log other than it complaining about LocalizedText...but encampments still have no production bonus.

You are loading your .sql in In-Game Actions? I've made that mistake a few times.
 
Uh, yea, the modinfo is set to load the SQL in In-Game Actions.

Theres a difference? Where else am I supposed to do that?
 
Use a tool like SQLite Studio to run a report and see where your values are going. I do this ritually. It's a very important step in the QA process.

A query like this will show you all of the data you're attaching:

Code:
SELECT * FROM DistrictModifiers
LEFT JOIN Modifiers USING(ModifierId)
LEFT JOIN ModifierArguments USING (ModifierId)
WHERE DistrictType LIKE "%ENCAMP%" ;

Really you should rarely have to fiddle around in the game world wondering whether your values are being applied without looking first at the database to see if the data is getting there. If the data is there after running the report and it still doesn't work in game, at least you've eliminated many of the possible issues.
 
Code:
DISTRICT_ENCAMPMENT   LOC_DISTRICT_ENCAMPMENT_NAME   TECH_BRONZE_WORKING       0   LOC_DISTRICT_ENCAMPMENT_DESCRIPTION   54   1   1   1   0   0   0   1   0   100   1   0   NO_PLUNDER   0   0   DOMAIN_LAND   COST_PROGRESSION_NUM_UNDER_AVG_PLUS_TECH   20       -1   0   0   1   0   1   0       -1   2   0   0   ADVISOR_CONQUEST   0   -1   DISTRICT_ENCAMPMENT   MODIFIER_ENCAMPMENT_PRODUCTION   MODIFIER_ENCAMPMENT_PRODUCTION   MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE   0   0   0                   MODIFIER_ENCAMPMENT_PRODUCTION   Amount   ARGTYPE_IDENTITY   2      
DISTRICT_ENCAMPMENT   LOC_DISTRICT_ENCAMPMENT_NAME   TECH_BRONZE_WORKING       0   LOC_DISTRICT_ENCAMPMENT_DESCRIPTION   54   1   1   1   0   0   0   1   0   100   1   0   NO_PLUNDER   0   0   DOMAIN_LAND   COST_PROGRESSION_NUM_UNDER_AVG_PLUS_TECH   20       -1   0   0   1   0   1   0       -1   2   0   0   ADVISOR_CONQUEST   0   -1   DISTRICT_ENCAMPMENT   MODIFIER_ENCAMPMENT_PRODUCTION   MODIFIER_ENCAMPMENT_PRODUCTION   MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE   0   0   0                   MODIFIER_ENCAMPMENT_PRODUCTION   YieldType   ARGTYPE_IDENTITY   YIELD_PRODUCTION

Seems to be working but i do not see it in civlopedia, the way i see it for the mbanza...

Could you post your mod info file please so that i can compare it with mine?
 
The SQL code from the 1st post works fine.
You won't see +2 prod in city panel because modifiers are not shown there, only straight db values.
 

Attachments

  • 20180322211758_1.jpg
    20180322211758_1.jpg
    555.8 KB · Views: 35
Top Bottom