Access to tile elevation value

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Access to tile elevation value

Post by Impatient »

In 0.14 existed the function LuaSurface::get_tileproperties(x, y) → TileProperties and the struct TileProperties::elevation. The function was removed in 0.15 . TileProperties and its elevation property still exist in the 0.17 API documentation. Though it seems not possible to access it for a given tile.

Does a tiles elevation value still exist in 0.17 after chunk generation? If so, would it be possible to implement a read access to it? That is my main request, as this would allow to work with the heightmap/the elevation values generated during chunk generation.

As an additional, would it also be possible to implement write access? Changing that value would make the engine change the tiles LuaTilePrototype to one that would have been used during chunk generation for that elevation. This additional request would enable modders to easily change water to land and vice versa and to switch between different LuaTilePrototypes for water (water/deepwater).

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Access to tile elevation value

Post by Rseding91 »

If it even exists (which I don't know) write access definitely will never be added. Even back in 0.15/previous it was not a stored property anywhere - it was always calculated based off the position and map seed. The only thing stored is the result tile at a given x/y.
If you want to get ahold of me I'm almost always on Discord.

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Access to tile elevation value

Post by Boodals »

I took a look at reimplementing this when I got source access, and from what I could see: if it's possible at all, it won't be easy. Features aren't typically taken out lightly, so the terrain generation rewrite probably made it impossible or too difficult to do.

Post Reply

Return to “Modding interface requests”