1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

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

Discussion in 'Mod Creation Help' started by Question, Mar 11, 2018.

  1. Question

    Question King

    Joined:
    Mar 12, 2008
    Messages:
    945
    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');
     
  2. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,676
    Gender:
    Male
    Location:
    Warsaw
  3. Question

    Question King

    Joined:
    Mar 12, 2008
    Messages:
    945
    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.
     
  4. Question

    Question King

    Joined:
    Mar 12, 2008
    Messages:
    945
    Does anyone have any idea why this will not work for encampments or aerodrome, but works for all other districts?
     
  5. TheLunarArmy

    TheLunarArmy Chieftain

    Joined:
    Jul 9, 2014
    Messages:
    59
    Gender:
    Male
    Location:
    South-Africa
    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.
     
  6. Question

    Question King

    Joined:
    Mar 12, 2008
    Messages:
    945
    Just tried it, but i dont see the bonus at all in the city details panel...
     
  7. TheLunarArmy

    TheLunarArmy Chieftain

    Joined:
    Jul 9, 2014
    Messages:
    59
    Gender:
    Male
    Location:
    South-Africa
    Try organizing "INSERT INTO DistrictModifiers..." after "INSERT INTO Modifiers..." and "INSERT INTO ModifierArguments..."?
     
  8. Question

    Question King

    Joined:
    Mar 12, 2008
    Messages:
    945
    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.
     
  9. TheLunarArmy

    TheLunarArmy Chieftain

    Joined:
    Jul 9, 2014
    Messages:
    59
    Gender:
    Male
    Location:
    South-Africa
    You are loading your .sql in In-Game Actions? I've made that mistake a few times.
     
  10. Question

    Question King

    Joined:
    Mar 12, 2008
    Messages:
    945
    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?
     
  11. isau

    isau Deity

    Joined:
    Jan 15, 2007
    Messages:
    3,068
    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.
     
  12. Question

    Question King

    Joined:
    Mar 12, 2008
    Messages:
    945
    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?
     
  13. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,676
    Gender:
    Male
    Location:
    Warsaw

Share This Page