• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Cobaltate

Recruit
17 Badges
Jul 13, 2016
4
0
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris
  • Surviving Mars
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
I'm thinking of making a tiny mod just to see how it works. TL;DR: Is it possible to have conditional tile adjacency effects on a building?

My intent is to make it so upgraded planetary capitals (planetary administration, planetary capital, empire capital complex) boost science in addition to the resources which they already boost. The intent is to make it so that tiles adjacent to certain colony capitals can gain the same effect that other resources types get.

I made a simple proof-of-concept mod that gave a flat increase to the science resources for adjacent buildings, much like the tomb world tile blockers do for the vanilla game. While that certainly works, that's not exactly balanced. The bonus of the tomb world tile blockers is offset by their relative rarity and time before the player can exploit them. Giving the player the option to create a 2/2/2 basic science lab adjacent to a planetary administration building would ensure that players would only place labs around their capitals.

I would think a more balanced way of executing this idea is to have the adjacency bonus enhance only one of the three science resources at a time, at the same magnitude of the other resources. However, to actually implement this, I would need to write conditional tile adjacency effects and I know of no examples of this in the vanilla game. I don't even know if it's possible.

Pseudocode of what I'd like to implement:
Code:
if (the adjacent tile has a +science bonus)
then
    if (the adjacent tile has a +physics bonus)
    then
        increase physics research granted by +1/+2/+3
    fi
    if (the adjacent tile has a +society bonus)
    then
        increase society research granted by +1/+2/+3
    fi
    if (the adjacent tile has a +engineering bonus)
    then
        increase engineering research granted by +1/+2/+3
    fi
else (the adjacent tile doesn't have a +science bonus)
    if (the adjacent tile has a physics lab of any upgrade tier)
    then
        increase physics research granted by +1/+2/+3
    fi
    if (the adjacent tile has a biolab of any upgrade tier)
    then
        increase society research granted by +1/+2/+3
    fi
    if (the adjacent tile has an engineering lab of any upgrade tier)
    then
        increase engineering research granted by +1/+2/+3
    fi
fi

Thanks in advance.
 
Since tile adjacency is a scope and you have has_building and has_deposit, if you can figure out if there's a modifier to increase resource output of a tile (standard adjacency bonus won't cut it here) then theoretically, yes.
 
If balance is what you're concerned with you could restrict it to a +1 adjacency to all areas at max lvl of the capital building, alternatively perhaps you could look into random_neighboring_tile to restrict the bonus to a single tile instead, but I'm not sure if when you do that it'll actually show a tooltip for the added resource, so that'll take some experimenting