[2.0.x] How to copy logistics network state of an inserter

User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 140
Joined: Tue Feb 06, 2024 5:18 am
Contact:

[2.0.x] How to copy logistics network state of an inserter

Post by hgschmie »

I have an inserter and I can read its state by requesting its LuaInserterControlBehavior calling 'entity.get_or_create_control_behavior()'.

Most of the fields are RW, with the exception of logistic_condition and connect_to_logistic_network. How do I set that state on a new inserter?

I am currently trying to just copy old.logistic_condition.condition into new.logistic_condition (thus bypassing the read-only new.logistic_condition.

For connect_to_logistic_network I found no workaround. One can not assign the logistic_network attribute in the inserter entity ("Entity is not a Logistic or Construction Robot" - crash)

Is it possible to duplicate the state of an inserter? In 1.x, those fields were RW.
curiosity
Filter Inserter
Filter Inserter
Posts: 690
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [2.0.x] How to copy logistics network state of an inserter

Post by curiosity »

Documentation issue.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16107
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.x] How to copy logistics network state of an inserter

Post by Rseding91 »

You should l be able to write those values, I don’t know why the docs say they are read only.
If you want to get ahold of me I'm almost always on Discord.
Bilka
Factorio Staff
Factorio Staff
Posts: 3636
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [2.0.x] How to copy logistics network state of an inserter

Post by Bilka »

Looks like the doc got fixed at some point, connect_to_logistic_network and logistic_condition are now correctly marked as read write.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Requests”