What does regenerate_entity() actually do?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 181
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

What does regenerate_entity() actually do?

Post by moon69 »

What is LuaSurface.regenerate_entity() actually supposed to do?

I was hoping it would create "natural" patches of ore for me like at map generation time. Does it only work on un-revealed chunks?

I've run the following code dozens of times - the first two calls hang Factorio for a few seconds, but I can't see any changes to ore around me?

Code: Select all

local surface = player.surface
surface.regenerate_entity()
surface.regenerate_entity("iron-ore")
surface.regenerate_entity("uranium-ore", { { x = player.position.x / 32, y = player.position.y / 32} } )
The LuaSurface.regenerate_entity() documentation includes ...
chunks:: array[ChunkPosition]?
The chunk positions to regenerate the entities on. If not given all chunks are regenerated. Note chunks with status < entities are ignored.
What does "Note chunks with status < entities are ignored." mean!?

Post Reply

Return to “Modding help”