Page 1 of 1

[Solved] Accessing logistic network

Posted: Thu Nov 08, 2018 2:13 pm
by Delzur
Hi there,

Noob here, I'm trying to make a small mod that would give a better view of the current status of logistic requests.

Plan is simple:
  • get all requested items
  • get items from inventory
  • get items on their way
  • get available items from logistic network
  • do basic maths
  • show something somewhere on the UI
Nothing complicated as you can see, however I'm stuck with getting the logistic network.
LuaEntity provides something that looked perfect: https://lua-api.factorio.com/latest/Lua ... ic_network

It does work fine... Unless the player wears personal roboports. Indeed, when it's the case, I get the "personal" logistic network, which I don't care about :cry:

I've dug through logistic points, neighbours, various events and whatever else, to no avail.

So the question is:
How does one get access to the "real" logistic network the player's in? Or, how to get a list of existing networks so I can iterate through them and check if the player's in it?

Re: Accessing logistic network

Posted: Thu Nov 08, 2018 2:36 pm
by Klonan
Or, how to get a list of existing networks so I can iterate through them and check if the player's in it?
This is the one you want:

https://lua-api.factorio.com/latest/Lua ... c_networks

Re: Accessing logistic network

Posted: Thu Nov 08, 2018 3:17 pm
by Delzur
Holy crap.

Since the beginning I assumed that LuaForce was a class representing entity movements and therefore never checked it :cry:

Thank you very much :lol: