Now I have to maintain a table to save all the extra info for each tiles in lua.
In the on_chunk_generated, I added the new chunk to the container. Inside the container, I wrote a container like table. In this way, I can easily iterate all the existing tiles of a surface.
The code is like
container = {}
container[chunk_x][chunk_y][in_chunk_x+32* in_chunk_y]
This is clear and actually works. But array in lua is slow. If staff would like to make some container in cpp and register into lua, we could keep track of water level, temperature, humidity, or any customized info for each tile. And it should be way faster than what I've done.
Data container for each chunk of tiles.
-
- Fast Inserter
- Posts: 152
- Joined: Sun Jun 16, 2019 4:04 pm
- Contact:
Re: Data container for each chunk of tiles.
[Koub] Moved to modding interface requests.
Koub - Please consider English is not my native language.