Change Where Districts Can Be Built

Spedwards

Chieftain
Joined
Jan 11, 2016
Messages
38
I'm making a new civilization and I want to change where some districts can be built, similar to how Cleopatra can build hers on Floodplains.

I've looked through the files but can't seem to find where this is. I'll admit I may have missed it as I was looking for Cleopatra/Floodplains for an example. Does anyone know which file this is (and could possibly provide an example if not clear in file).

Thanks.
 
Try districts in the steam/civ 6/base/assets/data folder (I'm not on the computer but I think that's it )
 
Here is a list of attributes you can modify in the Table "Districts". You have to try and error to find what you are looking for:

"DistrictType" TEXT NOT NULL,
"Name" TEXT NOT NULL,
"PrereqTech" TEXT,
"PrereqCivic" TEXT,
"Coast" BOOLEAN,
"Description" TEXT,
"Cost" INTEGER,
"RequiresPlacement" BOOLEAN,
"RequiresPopulation" BOOLEAN,
"NoAdjacentCity" BOOLEAN,
"CityCenter" BOOLEAN,
"Aqueduct" BOOLEAN,
"InternalOnly" BOOLEAN,
"ZOC" BOOLEAN,
"FreeEmbark" BOOLEAN,
"HitPoints" INTEGER,
"CaptureRemovesBuildings" BOOLEAN,
"CaptureRemovesCityDefenses" BOOLEAN,
"PlunderType" TEXT,
"PlunderAmount" INTEGER,
"TradeRouteCapacity" INTEGER,
"TradeEmbark" BOOLEAN,
"MilitaryDomain" TEXT,
"CostProgressionModel" TEXT,
"CostProgressionParam1" INTEGER,
"TraitType" TEXT,
"Appeal" INTEGER,
"Housing" INTEGER,
"Entertainment" INTEGER,
"OnePerCity" BOOLEAN,
"AllowsHolyCity" BOOLEAN,
"Maintenance" INTEGER,
"AirSlots" INTEGER,
"CitizenSlots" INTEGER,
"TravelTime" INTEGER,
"CityStrengthModifier" INTEGER,
"AdjacentToLand" BOOLEAN,
"CanAttack" BOOLEAN,
"AdvisorType" TEXT,
 
Does anyone have an idea how to just allow workers to remove flood Plains ?

features table has RemoveTech and Removable attributes. floodplain is feature in game
Spoiler :
Code:
<Features>
        "FeatureType" TEXT NOT NULL,
        "Name" TEXT NOT NULL,
        "Description" TEXT UNIQUE,
        "Quote" TEXT UNIQUE,
        "Coast" BOOLEAN NOT NULL CHECK (Coast IN (0,1)) DEFAULT 0,
        "NoCoast" BOOLEAN NOT NULL CHECK (NoCoast IN (0,1)) DEFAULT 0,
        "NoRiver" BOOLEAN NOT NULL CHECK (NoRiver IN (0,1)) DEFAULT 0,
        "NoAdjacentFeatures" BOOLEAN NOT NULL CHECK (NoAdjacentFeatures IN (0,1)) DEFAULT 0,
        "RequiresRiver" BOOLEAN NOT NULL CHECK (RequiresRiver IN (0,1)) DEFAULT 0,
        "MovementChange" INTEGER NOT NULL DEFAULT 0,
        "SightThroughModifier" INTEGER NOT NULL DEFAULT 0,
        "Impassable" BOOLEAN NOT NULL CHECK (Impassable IN (0,1)) DEFAULT 0,
        "NaturalWonder" BOOLEAN NOT NULL CHECK (NaturalWonder IN (0,1)) DEFAULT 0,
        "RemoveTech" TEXT,
        "Removable" BOOLEAN NOT NULL CHECK (Removable IN (0,1)) DEFAULT 0,
        "AddCivic" TEXT,
        "DefenseModifier" INTEGER NOT NULL DEFAULT 0,
        "AddsFreshWater" BOOLEAN NOT NULL CHECK (AddsFreshWater IN (0,1)) DEFAULT 0,
        "Appeal" INTEGER NOT NULL DEFAULT 0,
        "MinDistanceLand" INTEGER NOT NULL DEFAULT 0,
        "MaxDistanceLand" INTEGER NOT NULL DEFAULT 0,
        "NotNearFeature" BOOLEAN NOT NULL CHECK (NotNearFeature IN (0,1)) DEFAULT 0,
        "Lake" BOOLEAN NOT NULL CHECK (Lake IN (0,1)) DEFAULT 0,
        "Tiles" INTEGER NOT NULL DEFAULT 1,
        "Adjacent" BOOLEAN NOT NULL CHECK (Adjacent IN (0,1)) DEFAULT 1,
        "NoResource" BOOLEAN NOT NULL CHECK (NoResource IN (0,1)) DEFAULT 0,
        "DoubleAdjacentTerrainYield" BOOLEAN NOT NULL CHECK (DoubleAdjacentTerrainYield IN (0,1)) DEFAULT 0,
        "NotCliff" BOOLEAN NOT NULL CHECK (NotCliff IN (0,1)) DEFAULT 0,
        "MinDistanceNW" INTEGER NOT NULL DEFAULT -1,
        "CustomPlacement" TEXT,
        "Forest" BOOLEAN NOT NULL CHECK (Forest IN (0,1)) DEFAULT 0,
        "AntiquityPriority" INTEGER NOT NULL DEFAULT 0,
        "QuoteAudio" TEXT,
        "Settlement" BOOLEAN NOT NULL CHECK (Settlement IN (0,1)) DEFAULT 1,
        PRIMARY KEY(FeatureType),
        FOREIGN KEY (RemoveTech) REFERENCES Technologies(TechnologyType) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT,
        FOREIGN KEY (AddCivic) REFERENCES Civics(CivicType) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT);
 
So can I just cut and paste that in to overwrite something ?

All that programing language confuses me ! :(
 
All that programing language confuses me ! :(
original data is at Assets/Base/GamePlay/Data/Features.xml
Code:
<Features>
        <Row FeatureType="FEATURE_FLOODPLAINS" Name="LOC_FEATURE_FLOODPLAINS_NAME" RequiresRiver="true" DefenseModifier="-2" Appeal="-1" AntiquityPriority="1"/>


you can just modify files, instead, I think making a mod is better without changing main game files
at mod, you can update(change) the row by sql or xml/sql.
download any simple mod and change .xml file like below
Code:
<GameInfo>
    <Features>
        <Update>
            <WHERE FeatureType='FEATURE_FLOODPLAINS'/>
            <SET RemoveTech='TECH_BRONZE_WORKING' Removable='true'/>
        </Update>
    </Features>
</GameInfo>
or .sql file then,
Code:
 UPDATE Features SET RemoveTech='TECH_BRONZE_WORKING' Removable='true' WHERE FeatureType='FEATURE_FLOODPLAINS'


then, applied result in game would be
Code:
<Features>
        <Row FeatureType="FEATURE_FLOODPLAINS" Name="LOC_FEATURE_FLOODPLAINS_NAME" RemoveTech="TECH_BRONZE_WORKING" Removable="true" RequiresRiver="true" DefenseModifier="-2" Appeal="-1" AntiquityPriority="1"/>

U'd better work if u learn about database, schema, sql
 
Last edited:
Thank you ! Very much appreciated . . I tried to do it myself but I screwed it up !
 
So I had got it working by changing the base files, but I tried hijacking an xml that changed the great wall a little, now I tried to add in maintenance cost +1 for warriors and slingers, as well as adding in for builders to be able to remove flood plains with irrigation. I know there's something I'm missing but I'm not sure what!
 

Attachments

  • Kierons Changes.rar
    1.1 KB · Views: 83
Gah!! Now I've been trying to add multiple styles that I can see if other xml's, but still no luck!! :\


<?xml version="1.0" encoding="utf-8"?>
<GameInfo>

<Improvements>
<Update>
<Where ImprovementType="IMPROVEMENT_GREAT_WALL"/>
<Set BuildInLine="true" BuildOnFrontier="false" CanBuildOutsideTerritory="true"/>
</Update>
</Improvements>

<Improvement_ValidFeatures>
<Row ImprovementType="IMPROVEMENT_GREAT_WALL" FeatureType="FEATURE_FLOODPLAINS"/>
</Improvement_ValidFeatures>

<Units>
<Update>
<WHERE UnitType="UNIT_WARRIOR"/>
<SET Maintenance="1"/>
</Update>

<Update>
<Row UnitType="UNIT_WARRIOR" Maintenance="1"/>
</Update>

<Update>
<WHERE UnitType="UNIT_SLINGER"/>
<SET Maintenance="1"/>
</Update>
</Units>

<Features>
<Update>
<WHERE FeatureType="FEATURE_FLOODPLAINS"/>
<SET RemoveTech="TECH_IRRIGATION" Removable="true"/>
</Update>

<Update>
<Row FeatureType="FEATURE_FLOODPLAINS" RemoveTech="TECH_IRRIGATION" Removable="true"/>
</Update>

</Features>

</GameInfo>
 
Maybe it's early, and my brains not working yet, but do you need the second updates:

Spoiler :
<WHERE UnitType="UNIT_WARRIOR"/>
<SET Maintenance="1"/>
</Update>

<Update>
<Row UnitType="UNIT_WARRIOR" Maintenance="1"/>
</Update>
and

<Update>
<WHERE FeatureType="FEATURE_FLOODPLAINS"/>
<SET RemoveTech="TECH_IRRIGATION" Removable="true"/>
</Update>

<Update>
<Row FeatureType="FEATURE_FLOODPLAINS" RemoveTech="TECH_IRRIGATION" Removable="true"/>
</Update>
 
I'm still not getting either the maintanence or the removal of flood plains :( :( Gdamnit I've been at this for hours!!


<?xml version="1.0" encoding="utf-8"?>
<GameInfo>

<Improvements>
<Update>
<Where ImprovementType="IMPROVEMENT_GREAT_WALL"/>
<Set BuildInLine="true" BuildOnFrontier="false" CanBuildOutsideTerritory="true"/>
</Update>
</Improvements>

<Improvement_ValidFeatures>
<Row ImprovementType="IMPROVEMENT_GREAT_WALL" FeatureType="FEATURE_FLOODPLAINS"/>
</Improvement_ValidFeatures>

<Units>
<Update>
<WHERE UnitType="UNIT_WARRIOR" Maintenance="1"/>
</Update>
</Units>

<Units>
<Update>
<WHERE UnitType="UNIT_SLINGER" Maintenance="1"/>
</Update>
</Units>

<Features>
<Update>
<Row FeatureType="FEATURE_FLOODPLAINS" RemoveTech="TECH_IRRIGATION" Removable="true"/>
</Update>
</Features>


</GameInfo>
 
Yeah I've changed the files around since I first posted.. I'll repost what I had before punching in what you said
 
Now I've made a few changes to the modinfo as well (But even when just making changes to the original improvement.xml file that I redownloaded to make sure it was nothing I had done to the one I downloaded hours ago), I still was having no luck with this
 

Attachments

  • Kierons Changes.rar
    1 KB · Views: 72
I was getting this error while updating units:

Gameplay] ERROR: Database::XMLSerializer (Improvements.xml): <Update> element requires a child <Set> element

I changed code to:
<Units>
<Row UnitType="UNIT_WARRIOR" Maintenance="1"/>
<Row UnitType="UNIT_SLINGER" Maintenance="1"/>


</Units>
and maintenance worked, then got same error for features, so try changing just to similar format and see if works
 
Where are people getting these errors from?? Is there a program you can run that tests them?? I've been having to load into game every time!!! :(

From looking at other peoples mods I thought there would have to be an update before and after each entry


<Units>
<Update>
<WHERE UnitType="UNIT_WARRIOR"/>
<SET Maintenance="1"/>
</Update>
<Update>
<WHERE UnitType="UNIT_SLINGER"/>
<SET Maintenance="1"/>
</Update>
</Units>

But yeah, I wasn't sure if SET was the right command as it's something I wanted to add in.. And I'd tried doing <ROW etc..>, but still no luck
 
Please ignore my earlier post, my brain definitely had not had enough coffee, I had forgot to clear cache so results were wrong.
You do update those files I had misread.

code like this worked for me:

Code:
<GameInfo>

    <Improvements>
        <Update>
            <Where ImprovementType="IMPROVEMENT_GREAT_WALL"/>
            <Set BuildInLine="true" BuildOnFrontier="false" CanBuildOutsideTerritory="true"/>
        </Update>
    </Improvements>
    
    <Improvement_ValidFeatures>
        <Row ImprovementType="IMPROVEMENT_GREAT_WALL" FeatureType="FEATURE_FLOODPLAINS"/>
    </Improvement_ValidFeatures>
    
    <Units>
      
    <Update>
            <Where UnitType="UNIT_WARRIOR"/>
            <Set  Maintenance="1"/>
            
        </Update>
        <Update>
            <Where UnitType="UNIT_SLINGER"/>
            <Set  Maintenance="1"/>
            
        </Update>
    </Units>
        
    <Features>
        <Update>
            <Where FeatureType="FEATURE_FLOODPLAINS"/>
            <Set RemoveTech="TECH_IRRIGATION" Removable="true"/>
        </Update>
    </Features>   
    
</GameInfo>
I will test again just to make sure and let you know
 
Top Bottom