MODDING CIV6 - how to add a production to a district

GG5

Chieftain
Joined
Feb 18, 2025
Messages
4
Hi, I create a mod for play a custom leader and I want to modify the campus for product science and gold. I modding in sql and I not find nothing who explain how can I do that. Anybody can help me ?
 
In your situation I would take inspiration from the base game, how are the bonuses implemented in .xml files. (xml and sql can do the same actions)
For example, take the Mbanza - unique district which yields 2 food and 4 gold. All of these bonuses are contained in the Districts.xml file in base game. Create similar structure for your leader.
If you mean adjacency yields, examples are also within the same file, perhaps easier to apply.
 
I try but it's didn t work. Do you have any other example ? In xml or sql ?
 
I try but it's didn t work.
That happens. In that case I am out there debugging and searching how it could work. If you come back to forums, show what doesnt work. There may be multiple issues that the game doesnt let you process.
 
That is my code, I use the MC Master template, it's for that the civ name is olmec I gonna change that later.

SQL:
INSERT INTO Kinds
        (Kind                )
VALUES    ('KIND_DISTRICT'    );

INSERT INTO Types
        (Types,                                            Kind)
VALUES    ('DISTRICT_FEDERAL_SCHOOL',                        'KIND_DISTRICT'),  
        ('TRAIT_CIVILIZATION_SWISS_FEDERAL_SCHOOL',        'KIND_TRAIT');

INSERT INTO Traits
        (TraitType,                                        Name)
VALUES    ('TRAIT_CIVILIZATION_SWISS_FEDERAL_SCHOOL',        'LOC_TRAIT_CIVILIZATION_SWISS_FEDERAL_SCHOOL_NAME');    -- locate trait's name

INSERT INTO CivilizationTraits
        (CivilizationType,                TraitType)
VALUES    ('CIVILIZATION_MC_OLMEC',        'TRAIT_CIVILIZATION_SWISS_FEDERAL_SCHOOL');    -- insert trait into the civilization

INSERT INTO DistrictReplaces
        (CivUniqueDistrictType,        ReplacesDistrictType)
VALUES    ('DISTRICT_FEDERAL_SCHOOL',    'DISTRICT_CAMPUS');        -- replace the district

INSERT INTO District
        (DistrictType,                Name,                        Description,                        PrereqTech,            PlunderType,        PlunderAmount,            AdvisorType,            Cost,            CostProgressionModel,                CostProgressionParam1,        RequiresPlacement,        RequiresPopulation,        OnePerCity,            Aqueduct        NoAdjacentCity,        InternalOnly,        ZOC,        CaptureRemovesBuildings,        CaptureRemovesCityDefenses,        MilitaryDomain,        Housing,    CityStrengthModifier,    TraitType)
VALUES    ('DISTRICT_FEDERAL_SCHOOL',    'LOC_FEDERAL_SCHOOL_NAME',    'LOC_FEDERAL_SCHOOLL_DESCRIPTION',    'TECH_WRITING',        'PLUNDER_GOLD',        '20',                    'ADVISOR_GENERIC',        '27',            'COST_PROGRESSION_GAME_PROGRESS',    '1000',                        1,                        0,                        1,                    0,                0,                    0,                    1,            0,                                0,                                'NO_DOMAIN',        5,            2,                        'TRAIT_CIVILIZATION_SWISS_FEDERAL_SCHOOL');


INSERT INTO DistrictModifiers
               (DistrictType,                    ModifierId)
VALUES    ('DISTRICT_FEDERAL_SCHOOL',        'CAMPUS_GIVE_MONEY'),           -- create the modifier for money
             ('DISTRICT_FEDERAL_SCHOOL',        'CAMPUS_GIVE_SCIENCE');        -- same for science

INSERT INTO Modifiers
        (ModifierId,        ModifierType)
VALUES    ('CAMPUS_GIVE_MONEY',    'MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE'),    -- change yield
        ('CAMPUS_GIVE_SCIENCE',    'MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE');

INSERT INTO ModifierArguments
        (ModifierId,            Name,            Value)
VALUES    ('CAMPUS_GIVE_MONEY',    'Amount',        '50')            -- insert value
        ('CAMPUS_GIVE_MONEY',    'YieldType',    'YIELD_GOLD'),    -- insert yield
        ('CAMPUS_GIVE_SCIENCE',    'Amount',        '100'),
        ('CAMPUS_GIVE_SCIENCE',    'YieldType',    'YIELD_SCIENCE');

If you see what is wrong :(
 
Thanks for the code, it seems okay. My only problem is with the insert of KIND_DISTRICT to Kinds table. That entry already exists. Often if there is only one such issue, the game just doesnt load the mod and doesnt give error.
 
I tried to delete this part and it's still doesn't work.
The problem is maybe in the district table ? I copy some code I find in internet but I maybe make a mistake
 
Back
Top Bottom