LuaEntity.copy_settings returns objects ?

Place to post guides, observations, things related to modding that are not mods themselves.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

LuaEntity.copy_settings returns objects ?

Post by binbinhfr »

Hi,

in http://lua-api.factorio.com/0.13.11/Lua ... y_settings
it is specified that the function returns objects
Return value : Any items removed from this entity as a result of copying the settings.
I wonder what kind of objects it can return, because it seems that this function does not copy modules (which I can understand).

But, it seems that it does not copy circuit settings either, which could nice, no ?

Infact it copies filters, requests, hash bar.
My mods on the Factorio Mod Portal :geek:
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: LuaEntity.copy_settings returns objects ?

Post by Klonan »

binbinhfr wrote:Hi,

in http://lua-api.factorio.com/0.13.11/Lua ... y_settings
it is specified that the function returns objects
Return value : Any items removed from this entity as a result of copying the settings.
I wonder what kind of objects it can return, because it seems that this function does not copy modules (which I can understand).

But, it seems that it does not copy circuit settings either, which could nice, no ?

Infact it copies filters, requests, hash bar.

If you copy a recipe onto an assembling machine for instance, and it has items inside already, it will return those to you
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: LuaEntity.copy_settings returns objects ?

Post by binbinhfr »

Ok, thx Klonan.

To precise the documentation, the return is a dictionary of counts indexed by name of items.
(and not a list of ItemStacks or whatever)

By the way, do you have an idea on this one :
viewtopic.php?f=34&t=30150
My mods on the Factorio Mod Portal :geek:
Post Reply

Return to “Modding discussion”