[Solved] Accessing logistic network

Place to get help with not working mods / modding interface.
Post Reply
Delzur
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Aug 31, 2018 5:13 pm
Contact:

[Solved] Accessing logistic network

Post 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?
Last edited by Delzur on Thu Nov 08, 2018 3:17 pm, edited 1 time in total.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Accessing logistic network

Post 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

Delzur
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Aug 31, 2018 5:13 pm
Contact:

Re: Accessing logistic network

Post 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:

Post Reply

Return to “Modding help”