Chunk edges visable after changing tiles in on_chunk_generated

Place to get help with not working mods / modding interface.
Post Reply
BicycleEater
Fast Inserter
Fast Inserter
Posts: 153
Joined: Sun Jul 26, 2020 4:05 pm
Contact:

Chunk edges visable after changing tiles in on_chunk_generated

Post by BicycleEater »

My mod changes the water tiles in a chunk to something else while generating certain chunks, but what it changes the water tiles into varies greatly based on what kind of water was generated there - I'm trying to create a dried out lakebed look by replacing it all with special tiles.

The map generator seems to try and smooth the edge between the changed tiles and the deep water, by putting normal water along the edge of the chunk, this results in big 'ridges' along chunk generation boarders when the next chunk gets the script run on it.
The tile I am replacing the water with with is already in the 'water_tile_type_names'

How do I prevent this from being a problem - I can try and identify these conditions and remove them, but that seems difficult and error prone...

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Chunk edges visable after changing tiles in on_chunk_generated

Post by eradicator »

LuaSurface.set_tiles(tiles, correct_tiles) has a correct_tiles parameter, have you tried turning that on/off? Another method would be to change map gen settings so that the game handles it for you. But those are a bit underdocumented and can be difficult to get right.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

BicycleEater
Fast Inserter
Fast Inserter
Posts: 153
Joined: Sun Jul 26, 2020 4:05 pm
Contact:

Re: Chunk edges visable after changing tiles in on_chunk_generated

Post by BicycleEater »

Found the problem:
The deepwater tiles have

Code: Select all

    allowed_neighbors = { "water" }
so simply appending to that array in my data.lua worked fine

Post Reply

Return to “Modding help”