Changing ground colour with an override

I’ve looked around the game files a few times but I couldn’t find which file decides the terrain colour. I found this file: stonehearth/renderers/terrain/terrain_renderer.json, which contained colours for different terrains, but when I overrided it, nothing changed. Does anyone know which file I should override instead?

even though it seems obvious, and just to confirm you have the right file, try directly manipulating one or more colors in the file… making a backup first, of course… :wink:

I tried this and it looks like I’ve got the wrong file.

But… I’ve found another file that looks promising:
stonehearth\data\terrain\terrain_blocks.json seems to contain the same information about colours.

I believe is deprecated, now stonehearth\data\terrain\terrain_blocks.json is being used

stonehearth/stonehearth_server.luac calls radiant.terrain.set_config_file(‘stonehearth:terrain_block_config’)

stonehearth:terrain_block_config is a specified alias for stonehearth\data\terrain\terrain_blocks.json in the stonehearth manifest.json

following the call radiant.terrain.set_config_file(‘stonehearth:terrain_block_config’)

radiant/modules/terrain.luac

 function Terrain._initialize_block_types(config_file)
    local config=radiant.resources.load_json(config_file)

you can see the json is being load. so our data is set at this point.

My biggest advice when trying to solve problems

  • don’t forget about radaint.smod
  • try to figure out the flow of data, data must come from somewhere and be specified, sometimes it’s better to find where data comes from rather than the file that uses it.

Edit:
I was typing this and didn’t see your post that you has already solved it ;), I leave this here anyway I guess.

6 Likes

Thanks anyway! And thank you for the tips, I don’t think I’ve ever looked in radiant.smod.

Edit: I had my overrides the wrong way round as well. That would have made me super confused.

Corruption Biome? Corruption Biome!

:persevere: I had the answer for this, but I was at work…

So yes, right now the terrain colors can be changed by overriding terrain_blocks.json. I think colors for the embark map are set with css in the ui files…