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

[BNW] Improvement_ValidTerrains and ResourceMakesValid talking past each other?

Discussion in 'Civ5 - Creation & Customization' started by A_Wandering_Man, Dec 3, 2019 at 2:42 AM.

  1. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    6
    Gender:
    Male
    Location:
    Canada
    Hi all,
    Been working on adding a new improvement in one of my new mods (the Gorons from LoZ), and it appears to be working as intended, besides the fact that it's supposed to only be buildable on Hills. It is instead buildable on Hills and non-Hill tiles with the resources it is meant to improve.

    Is there a way to limit it to only Hill tiles, while still preserving its ability to improve certain resources?

    This is all that's in the valid terrains bit right now:
    Code:
    <Improvement_ValidTerrains>
       <Row>
          <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
          <TerrainType>TERRAIN_HILL</TerrainType>
       </Row>
     </Improvement_ValidTerrains>
    And resource types:
    Code:
      <Improvement_ResourceTypes>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_IRON</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_COAL</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_ALUMINUM</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_URANIUM</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_GEMS</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_GOLD</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_SILVER</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_COPPER</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_SALT</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_MARBLE</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
         <Row>
             <ImprovementType>IMPROVEMENT_NCLJ_BOMB_FLOWER_GARDEN</ImprovementType>
             <ResourceType>RESOURCE_STONE</ResourceType>
             <ResourceMakesValid>1</ResourceMakesValid>
             <ResourceTrade>1</ResourceTrade>
             <DiscoveryRand>0</DiscoveryRand>
             <QuantityRequirement>0</QuantityRequirement>
         </Row>
      </Improvement_ResourceTypes>
     
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,332
    Location:
    Illinois, USA
    <Improvement_ResourceTypes> will over-ride anything in the other "Valid" tables. If the specified resource can appear on a tile not listed as otherwise valid for the improvement, the presence of the resource will make the improvement valid for that plot. For example Iron can appear on flat grassland tiles, so a mine can be constructed on the flat grasslands plot containing the iron resource even though a mine cannot normally be placed on a flat grasslands plot.

    I don't know of any case in the Vanilla,, G&K, or BNW code where column "ResourceMakesValid" is set to Boolean false in table "Improvement_ResourceTypes" but you could set this column to false as an experiment to check whether this will cease making the over-ride work for plots that are not otherwise valid for the improvement. [deleted]
     
    Last edited: Dec 3, 2019 at 11:44 PM
  3. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    6
    Gender:
    Male
    Location:
    Canada
    I have just tested it, and even with the "ResourceMakesValid" set to false (0 -- would writing "false" be different?), I was still able to create the improvement on non-Hill tiles.

    EDIT: See below.
     
    Last edited: Dec 4, 2019 at 7:45 PM
  4. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,332
    Location:
    Illinois, USA
    "false" and "0" in xml files are treated the same.

    It would appear that the "ResourceMakesValid" column in table <Improvement_ResourceTypes> has no actual effect, then. It is the listing of the ImprovementType and ResourceType in the table that matters.
     
  5. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    6
    Gender:
    Male
    Location:
    Canada
    Just tested a little further after finding this thread where a similar problem was described and realized I was having the same issue (I had "BuildableOnResources" set to true, and could build it on any resource). Setting "ResourceMakesValid" to 0 for a particular resource does stop the improvement being built on that resource in flatland, but also on Hill resources (so it can't be built on that resource at all).

    So it does seem like "ResourceMakesValid" straight up overrides "Improvement_ValidTerrains", and the Boolean is just an on/off switch for it (i.e., it does not allow it to be built conditionally if the other validity conditions are met; in this case being on a Hill.)

    I am probably just going to limit the number of resources it can be built on (since I am already doing no-two-adjacent) and that should balance it sufficiently...
     

Share This Page