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

[BTS MODCOMP] Building City Size Prereq 2016-10-05

[BTS MODCOMP] Building City Size Prereq

  1. Shqype
    Building City Size Prereq SDK Mod Component
    For BTS 3.13, made with Bhruic's unofficial patch 1.11

    This was something that Civ 4 should have had in it, and I'm fairly certain it was either in Civ 3 or Civ 2 (I remember it being used somewhere). In any case, we need it for TAM, and I'm sure others have use for it since it could add some more depth to the game (at least in regards to city building and city diversity).

    What it does: This mod allows you to set a city size prerequisite for a building so that your cities cannot construct those buildings unless you've reached the minimum population required. It's unrealistic for a city of size 3 to have its own airport, for example. With this mod component you just use the new tag I created, <iCitySizePrereq>, and set its value to 14, so only cities of size 14 or larger can construct airports. Public transportation system? Not for a village. Now only cities with a population to support it can construct such a building based on whatever city size you determine it requires.

    As an example I have set the barracks to require a city size of at least 4 before it can be constructed:



    To see what I changed in the source code, just search for "Shqype," as I have commented all my additions with either "Shqype Start" and "Shqype End" for multi-line additions, or "Shqype Add" for one-line additions. The new schema is also included, and conveniently the new tag I added is not required for the XML to load properly, so you can only apply it to the buildings you want to set city size prerequisites for.

    I'd like to thank Seven05 for his help and explanation of classes, objects, pointers, and the like. Please let me know what you guys think of it and if there are any bugs you may encounter. Enjoy!


    The original discussion thread is here: http://forums.civfanatics.com/showthread.php?t=267724

    Images

    1. barrackscityviewsize4_VVc.jpg