LuaEntity placed by

Things that already exist in the current mod API
Post Reply
Simcra
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Wed Apr 06, 2016 6:05 am
Contact:

LuaEntity placed by

Post by Simcra »

I understand that LuaEntityPrototype contains items_to_place_this, sometimes this is incredibly useful and sometimes it is not. If each LuaEntity contained the player index (if placed by a player, or nil otherwise) as well as the item prototype used to place it, entities could be reverted to their exact item used for placement and inserted into the players inventory with much less work.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13235
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaEntity placed by

Post by Rseding91 »

If each LuaEntity contained the player index (if placed by a player, or nil otherwise) as well as the item prototype used to place it, entities could be reverted to their exact item used for placement and inserted into the players inventory with much less work
In 0.13 entities with a force contain the player_index that built them if any. The item that was used is irrelevant as the mineable properties determine what an entity mines to not what was used to build it.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Already exists”