3 LUA modding suggestions
Posted: Wed Mar 30, 2016 1:34 pm
Suggestion 1: Could it be possible for the get_tiles function to return nil if it can't find a tile at all?
I know this seems like something that won't get used often but I'm trying to work on something that involves tile checking in areas where there are no generated tiles yet and it throws up an LUA:Tile error since it can't find one.
My current alternative is to use can_place_entity to check if the space is available. While it does help detect if there is a space available there, it becomes extremely performance taxing when overused where a tile check wouldn't be as intense since it wouldn't require multiple collision checks per tick.
Suggestion 2: Either create completely empty surfaces* (or) disable/toggle surface chunk generation
One reason why I'm suggesting this is because I'm trying to create a new surface area but it's contents immediately replaced by the original surface template when chunks generate.
* by completely empty, I mean that it doesn't use the default generated surface made by the map generation.
Suggestion 3: set_tiles_area function?
I know that I could use for loops to do this but I thought maybe for a simple immediate area placement of tiles could be convenient, just a small extension on the set_tiles function where instead of just a position, it takes an area.
I know this seems like something that won't get used often but I'm trying to work on something that involves tile checking in areas where there are no generated tiles yet and it throws up an LUA:Tile error since it can't find one.
My current alternative is to use can_place_entity to check if the space is available. While it does help detect if there is a space available there, it becomes extremely performance taxing when overused where a tile check wouldn't be as intense since it wouldn't require multiple collision checks per tick.
Suggestion 2: Either create completely empty surfaces* (or) disable/toggle surface chunk generation
One reason why I'm suggesting this is because I'm trying to create a new surface area but it's contents immediately replaced by the original surface template when chunks generate.
* by completely empty, I mean that it doesn't use the default generated surface made by the map generation.
Suggestion 3: set_tiles_area function?
I know that I could use for loops to do this but I thought maybe for a simple immediate area placement of tiles could be convenient, just a small extension on the set_tiles function where instead of just a position, it takes an area.