Save/restore a single entity settings

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
mickael9
Fast Inserter
Fast Inserter
Posts: 112
Joined: Mon Mar 14, 2016 4:04 am
Contact:

Save/restore a single entity settings

Post by mickael9 »

Right now, if you have an entity that you want to copy somewhere, you need the original entity to exist to be able to copy it (copy_settings require the source LuaEntity) or you need to manually deep copy the entity's properties to manually copy them (assuming they're exposed) as some aren't introspectable (eg LuaControlBehavior).

A way to save these all the settings as a plain table and restore them later when the orignal entity is gone would be very useful.
This could be achieved by providing two export_settings and import_settings methods on LuaEntity.

The format of the saved settings would be the same as the blueprint entity format so that we can also copy settings from a blueprint or basically replicate blueprint functionality without actually using blueprints

Post Reply

Return to “Modding interface requests”