Method to clone/duplicate an entity
Posted: Fri May 12, 2017 5:34 pm
I would like for LuaEntity.clone() to exist or for LuaSurface.create_entity(LuaEntity) to create a copy of the entity in question or some other similar functionality.
That's unfortunate. That leaves a lot of un-copyable attributesRseding91 wrote:There exists no such logic in the game. The best you can get is to create an entity of the same name and then use copy_settings to copy the settings from the old entity.
That's how it works. The game never needs to clone things to that extent so we never built a system to do it. You'll need to build your own if you want such a thing.sparr wrote:That's unfortunate. That leaves a lot of un-copyable attributesRseding91 wrote:There exists no such logic in the game. The best you can get is to create an entity of the same name and then use copy_settings to copy the settings from the old entity.