1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Is there a mod that makes it like it was before?

Discussion in 'Civ6 - Creation & Customization' started by ShakaKhan, Mar 19, 2017.

  1. ShakaKhan

    ShakaKhan Chieftain

    Joined:
    Jan 5, 2015
    Messages:
    728
    I miss both unique districts not counting towards the district/population cap and overlapping area effect buildings. Whether or not these were "overpowered" game elements is disputable, because your competition can take advantage of them as well. What's pretty much indisputable is that the Acropolis is a garbage "bonus" now. Take it or leave it, having these two changes makes for a different game, and I want to play the other one sometimes. It's so unfortunate that they addressed this as a patch, because that removes the option of playing the game the other way.
     
  2. Gleb Bazov

    Gleb Bazov Chieftain

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    The second part of your goal is relatively easy to achieve. In Districts.xml, every District entry contains a column RequiresPopulation.

    Code:
    <Row DistrictType="DISTRICT_ACROPOLIS"
    ( . . . )
    RequiresPopulation="true"
    Aqueduct="false"
    NoAdjacentCity="false"
    InternalOnly="false"
    ZOC="false"
    CaptureRemovesBuildings="false"
    CaptureRemovesCityDefenses="false"
    MilitaryDomain="NO_DOMAIN"
    Appeal="1"
    CityStrengthModifier="2"
    TraitType="TRAIT_CIVILIZATION_DISTRICT_ACROPOLIS"/>
    
    Changing the value to false removes the population requirement with respect to the specific district. The following SQL statement is relatively simple and you can incorporate it into one of your mainstay SQL-coded mods:

    UPDATE Districts SET RequiresPopulation=0 WHERE Districts.DistrictType='DISTRICT_ACROPOLIS';

    If you want to update all of the unique districts at once, use the following statement. It will use the unique districts listed in the DistrictReplaces table and cross-reference them with the Districts table to locate and update unique districts. Note, however, that this will also catch districts like Bath (Rome) and Mbanza (Kongo), but this should not be a problem, as they already do not require population.

    UPDATE Districts SET RequiresPopulation=0 WHERE DistrictType IN (SELECT CivUniqueDistrictType FROM DistrictReplaces) ;

    To ensure that Bath (Aqueduct) is excluded, try this:

    UPDATE Districts SET RequiresPopulation=0 WHERE Aqueduct=NULL AND DistrictType IN (SELECT CivUniqueDistrictType FROM DistrictReplaces) ;

    To also exclude Mbanza (but retain Royal Navy Dockyard), use this:

    UPDATE Districts SET RequiresPopulation=0 WHERE Aqueduct=NULL AND Housing<=3 AND DistrictType IN (SELECT CivUniqueDistrictType FROM DistrictReplaces) ;

    Depending on what your mods do, you may need additional conditions. Quo's Combined Tweaks, for instance, removes Royal Navy Dockyard from the DistrictReplaces table and CivUniqueDistrictType column. To address such a situation, you can include a condition to check TraitType. All unique districts are linked to a Trait that enables them. So, something like this would work:

    UPDATE Districts SET RequiresPopulation=0 WHERE TraitType IS NOT NULL AND Aqueduct=NULL AND Housing<=3 AND DistrictType IN (SELECT CivUniqueDistrictType FROM DistrictReplaces) ;

    All the values above are contingent on your mod environment, if any of your mods change the CivUniqueDistrictType column in DistrictReplaces or Housing values for any of the unique districts.

    As for your first request... I have a thought, but I have a feeling there is no feasible way to reinstate the overlapping area effect in XML. I'll give it some thought. Doing it in LUA may be doable, but that's more complicated. I'll let you know if I come up with anything. Off the top of my head, there is a Requirement that measures distance between a given plot and a specific district (REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES), but I haven't tested it and can't be sure it will allow more than one district of the specified type to be counted for Modifier function. Besides, I don't know of any Requirement that would also check for the presence of a specific building in a nearby district.

    NOTE: If you don't want to mess with code--and don't care that your files may be updated by a patch, requiring you to redo the work--you can simply go into Districts.xml and change the RequiresPopulation values to false for the districts you need. That would do the same thing. However, I recommend modding this in instead.
     
    ShakaKhan and NameArleadyUsed like this.
  3. ShakaKhan

    ShakaKhan Chieftain

    Joined:
    Jan 5, 2015
    Messages:
    728
    I appreciate the help, but I have no experience with modding or messing with the code. I am reluctant to do so because I'm afraid if I did, I'd mess something up and the game would just get confused and crash, and I wouldn't know how to fix it.
     
  4. Gleb Bazov

    Gleb Bazov Chieftain

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    Here you go, ShakaKhan, all packaged and ready to go. Simply unzip into your Mods directory under Documents/My Games/Civilization 6, then enable it in Additional Content in the Main Menu.

    Sorry, I went a bit overboard with the commentary in the SQL file, but it would be useful to read if you intend on doing some simple modding in the future. Also, there is space at the end of the SQL file for you to enter any other random tweaks and bits of code you may wish to incorporate into your game. Might come in handy. Note that the SQL file will not accept XML code, but you can easily add and XML component later (just make sure to include it in the MODINFO file). To update the Districts, I used the most complex UPDATE statement from above, but you can easily change this by opening the SQL file (even with the simplest Notepad-type editor and commenting/uncommenting as explained in the body of the file). Also, the SQL component will load last, ensuring that it applies to all unique districts that may be added by other mods, but you can also change this (see how by opening the MODINFO file in a text editor). There are a few tips in the SQL file and two web tutorial links.

    Good luck!
     

    Attached Files:

  5. ShakaKhan

    ShakaKhan Chieftain

    Joined:
    Jan 5, 2015
    Messages:
    728
    OMG Thank you so much! If I wasn't flat broke, I'd pay you for this.
     
    Gleb Bazov likes this.
  6. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,083
    Location:
    Illinois, USA
    column "Aqueduct" in table "Districts" is never NULL:
    Spoiler Table Districts Definition :
    Code:
    CREATE TABLE "Districts" (
    		"DistrictType" TEXT NOT NULL,
    		"Name" TEXT NOT NULL,
    		"PrereqTech" TEXT,
    		"PrereqCivic" TEXT,
    		"Coast" BOOLEAN NOT NULL CHECK (Coast IN (0,1)) DEFAULT 0,
    		"Description" TEXT,
    		"Cost" INTEGER NOT NULL DEFAULT 0,
    		"RequiresPlacement" BOOLEAN NOT NULL CHECK (RequiresPlacement IN (0,1)),
    		"RequiresPopulation" BOOLEAN NOT NULL CHECK (RequiresPopulation IN (0,1)) DEFAULT 1,
    		"NoAdjacentCity" BOOLEAN NOT NULL CHECK (NoAdjacentCity IN (0,1)),
    		"CityCenter" BOOLEAN NOT NULL CHECK (CityCenter IN (0,1)) DEFAULT 0,
    		"Aqueduct" BOOLEAN NOT NULL CHECK (Aqueduct IN (0,1)),
    		"InternalOnly" BOOLEAN NOT NULL CHECK (InternalOnly IN (0,1)),
    		"ZOC" BOOLEAN CHECK (ZOC IN (0,1)) DEFAULT 0,
    		"FreeEmbark" BOOLEAN NOT NULL CHECK (FreeEmbark IN (0,1)) DEFAULT 0,
    		"HitPoints" INTEGER DEFAULT 0,
    		"CaptureRemovesBuildings" BOOLEAN NOT NULL CHECK (CaptureRemovesBuildings IN (0,1)),
    		"CaptureRemovesCityDefenses" BOOLEAN NOT NULL CHECK (CaptureRemovesCityDefenses IN (0,1)),
    		"PlunderType" TEXT NOT NULL,
    		"PlunderAmount" INTEGER NOT NULL DEFAULT 0,
    		"TradeEmbark" BOOLEAN NOT NULL CHECK (TradeEmbark IN (0,1)) DEFAULT 0,
    		"MilitaryDomain" TEXT NOT NULL,
    		"CostProgressionModel" TEXT NOT NULL DEFAULT "NO_COST_PROGRESSION",
    		"CostProgressionParam1" INTEGER NOT NULL DEFAULT 0,
    		"TraitType" TEXT,
    		"Appeal" INTEGER NOT NULL DEFAULT 0,
    		"Housing" INTEGER NOT NULL DEFAULT 0,
    		"Entertainment" INTEGER NOT NULL DEFAULT 0,
    		"OnePerCity" BOOLEAN NOT NULL CHECK (OnePerCity IN (0,1)) DEFAULT 1,
    		"AllowsHolyCity" BOOLEAN NOT NULL CHECK (AllowsHolyCity IN (0,1)) DEFAULT 0,
    		"Maintenance" INTEGER NOT NULL DEFAULT 0,
    		"AirSlots" INTEGER NOT NULL DEFAULT 0,
    		"CitizenSlots" INTEGER,
    		"TravelTime" INTEGER NOT NULL DEFAULT -1,
    		"CityStrengthModifier" INTEGER NOT NULL DEFAULT 0,
    		"AdjacentToLand" BOOLEAN NOT NULL CHECK (AdjacentToLand IN (0,1)) DEFAULT 0,
    		"CanAttack" BOOLEAN NOT NULL CHECK (CanAttack IN (0,1)) DEFAULT 0,
    		"AdvisorType" TEXT,
    		PRIMARY KEY(DistrictType),
    		FOREIGN KEY (PrereqTech) REFERENCES Technologies(TechnologyType) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT,
    		FOREIGN KEY (PrereqCivic) REFERENCES Civics(CivicType) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT,
    		FOREIGN KEY (TraitType) REFERENCES Traits(TraitType) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT,
    		FOREIGN KEY (DistrictType) REFERENCES Types(Type) ON DELETE CASCADE ON UPDATE CASCADE);
    Inspecting the contents of table Districts in SQliteBrowser confirms it is always '0' or '1' in the database.
     
  7. Gleb Bazov

    Gleb Bazov Chieftain

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    Ah, but you are right, of course, as usual! :) Strangely, I got no errors when running the code and it works just fine. In any event, the criterion is superfluous, as Aqueducts never require population, but I will certainly amend the mod and repost. ShakaKhan, please wait for the next version :).

    Aaaand ... here it is.

    GB
     

    Attached Files:

  8. ShakaKhan

    ShakaKhan Chieftain

    Joined:
    Jan 5, 2015
    Messages:
    728
    You're awesome
     
    Gleb Bazov likes this.

Share This Page