Is it possible to add district adjacency bonus with specific resources (or resource classes)?

kaspergm

Deity
Joined
Aug 19, 2012
Messages
5,828
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
 
Hansa does that.
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.
 
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)
 
Interesting, thanx, this is really helpful, this will be something I'll try to play with when I have more time. :thumbsup:
 
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.
 
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.
 
Back
Top Bottom