Maybe a lua misunderstanding from me but this what I face.
The function is defined as
Code: Select all
regenerate_entity(entities, chunks)
Regenerate autoplacement of some entities on this surface. This can be used to autoplace newly-added entities.
Parameters
entities :: string or array of string (optional): Prototype names of entity or entities to autoplace.
chunks :: array of ChunkPosition (optional): The chunk positions to regenerate the entities on. If not given all chunks are regenerated. Note chunks with status < entities are ignored.
Note: All specified entity prototypes must be autoplacable. If nothing is given all entities are generated on all chunks.
So : parameter entities -> not given
parameter chunks -> given
According to my lua knowledge & searching this should be done with f.e.
Code: Select all
game.player.surface.regenerate_entity(chunks = ...)
Code: Select all
/c
local ca = {}
ca[1] = {82,17}
game.player.surface.regenerate_entity(chunks = ca)
Running
Code: Select all
/c
local ca = {}
ca[1] = {82,17}
game.player.surface.regenerate_entity("tree-02", ca)
What syntax should I use ?