Does NearbyTerrainRequired TAG really work?

ambrox62

Emperor
Joined
Mar 24, 2005
Messages
1,294
I've seen SOLAR PLANT using:
<NearbyTerrainRequired>TERRAIN_DESERT</NearbyTerrainRequired>
but I never built it in my games, thus I'm not 100% sure that it really works

In my test, the following TAG doesn't work:
<NearbyTerrainRequired>TERRAIN_HILL</NearbyTerrainRequired>

I built a city on flat land but adjacent to a hill, thus I would expect the same effect as solar plant for my custom building. Unfortunately, it doesn't work for me.

Any clues?
Thanks
 
If I'm not mistaken, hills and mountains aren't treated as terrain types by the game. I can see that there is a tag for <Hill> which takes a boolean, but it isn't used in any of the default buildings. This might be what you are looking for, if it works. However, I'm not sure if it only requires an adjacent hill, or if the city itself has to be on a hill.
 
If I'm not mistaken, hills and mountains aren't treated as terrain types by the game.

Correct. Hills aren't actually a terrain type (note that a plot with a hill will still be labeled Grassland, Plains, Desert, etc.). They're a Plot type, although some of their benefits are filed under the "Feature" category. I know there's a TERRAIN_HILL in the Terrains file, but if you actually go into FireTuner and look up the contents of the TerrainTypes table, you'll see a discrepancy. This is why the TERRAIN_HILL entry has no yield modifiers; it's just an artwork placeholder to create a Civilopedia entry in the right place. (That's why there's a "GraphicalOnly=true" setting for TERRAIN_HILL and TERRAIN_MOUNTAIN.)
 
Thanks ;)

Therefore there is no way to set a building "on or next hills" :(
I'll try the <Hill> tag to test if a "on hill" condition works at least

EDIT
----
<Hill>true</Hill>

It works as "on hill" (only) condition. It doesn't work as "next to hill".
 
Would it be useful to look at the code for Observatory, or are mountains terrain in some way that hills aren't?
 
Would it be useful to look at the code for Observatory, or are mountains terrain in some way that hills aren't?
Observatory uses an XML tag specific to mountains (<Mountain>true</Mountain>), not the NearbyTerrainRequired tag. There is a similar one for hills, but it only checks the tile the city is built on.
 
Whatever Solar Plant does seems to work...

Again, Hills and Mountains aren't actually a Terrain type, they're a Plot type. Their entry in Terrains.xml is only for cosmetic purposes (which is why they have the "GraphicalOnly" entry). If you go into Lua and look at the TerrainTypes table, it won't include hills or mountains, but the PlotTypes table will.

So no, you can't just copy what the Solar Plant does, because Deserts are an actual Terrain type.
 
Again, Hills and Mountains aren't actually a Terrain type, they're a Plot type. Their entry in Terrains.xml is only for cosmetic purposes (which is why they have the "GraphicalOnly" entry). If you go into Lua and look at the TerrainTypes table, it won't include hills or mountains, but the PlotTypes table will.

So no, you can't just copy what the Solar Plant does, because Deserts are an actual Terrain type.
Bah. Got the question jumbled.

For 'real' terrain (desert, tundra, grass, plains) what Solar Plant does works. For mountains there's a special field, and there appears to be one for hills as well, but we don't know (per se) whether it works, or even that that's the intended function. I assume that forests wouldn't work with the general case, because they're not 'real' either, but I don't know that for sure.
 
Back
Top Bottom