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 it possible to add district adjacency bonus with specific resources (or resource classes)?

Discussion in 'Mod Creation Help' started by kaspergm, Dec 2, 2017.

  1. kaspergm

    kaspergm Chieftain

    Joined:
    Aug 19, 2012
    Messages:
    3,832
    I'd like to add the following district adjacency bonuses to the game, but not sure if it's possible (with simple modding):

    • Encampment: +1 production for every adjacent strategic resource.
    • Commercial Hub: +1 gold for every luxury resource
     
  2. criZp

    criZp Chieftain

    Joined:
    Jul 19, 2013
    Messages:
    437
    Location:
    Nidaros, Norway
    Hansa does that.
     
  3. kaspergm

    kaspergm Chieftain

    Joined:
    Aug 19, 2012
    Messages:
    3,832
    Yes, Hansa does it, but not on specific resource classes. Hansa adds a bonus for any adjacent resource, and as far as I can see in the code, it doesn't have a list for resources that qualifies - it just checks if plot has a resource or not.
     
  4. criZp

    criZp Chieftain

    Joined:
    Jul 19, 2013
    Messages:
    437
    Location:
    Nidaros, Norway
    pic4.jpg

    You can try to make a copy of the row with ID = Resource_Production, where you change ID to StrategicResource_Production, and also change "AdjacentResource = true" to "AdjacentResourceClass = "RESOURCECLASS_STRATEGIC"

    Alternatively, change ID to StrategicResource_Production1, and change AdjacentResource = true" to AdjacentResource = "RESOURCE_ALUMINIUM". Then make a copy of the line for each other strategic resource. Remember to also change the ID number (StrategicResource_Production2 ... 3 ... etc)
     
  5. kaspergm

    kaspergm Chieftain

    Joined:
    Aug 19, 2012
    Messages:
    3,832
    Interesting, thanx, this is really helpful, this will be something I'll try to play with when I have more time. :thumbsup:
     
  6. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,140
    Location:
    Illinois, USA
    Code:
    "AdjacentResource" BOOLEAN NOT NULL CHECK (AdjacentResource IN (0,1)) DEFAULT 0,
    "AdjacentResourceClass" TEXT NOT NULL DEFAULT "NO_RESOURCECLASS",
    .....
    
    • "AdjacentResource" is a boolean: you cannot state anything except "true" or "false" ("1" and "0" for SQL)
    • "AdjacentResourceClass" wants the statement of a CLASS of resource, not an individual resource. It will take any text you enter, but GIGO probably applies at DLL level on the implementation of anything not understood by the game as a valid class of resource.
     
  7. sclera

    sclera Chieftain

    Joined:
    Nov 13, 2013
    Messages:
    25
    I tried to do this recently. Short answer: it's not possible. It's possible to change plot yields on a per-resource basis using modifiers, but I could not figure out a way to make specific resources give adjacency bonuses.
     

Share This Page