Page 1 of 1

LuaPlayer.logistic_network and LuaLogisticNetwork.active_construction_robots

Posted: Mon Sep 24, 2018 8:56 am
by mophydeen
LuaPlayer.logistic_network :: LuaLogisticNetwork [R] The personal logistic network of the player.

LuaLogisticNetwork.active_construction_robots :: array of LuaEntity [R] All entities that have active construction robots (type = construction-robot) in this network.

Re: LuaPlayer.logistic_network and LuaLogisticNetwork.active_construction_robots

Posted: Mon Sep 24, 2018 10:07 am
by eradicator
mophydeen wrote:
Mon Sep 24, 2018 8:56 am
LuaPlayer.logistic_network :: LuaLogisticNetwork [R] The personal logistic network of the player.

LuaLogisticNetwork.active_construction_robots :: array of LuaEntity [R] All entities that have active construction robots (type = construction-robot) in this network.
1) This should be LuaPlayer.character.logistic_network or LuaPlayer.character.logistic_cell.
2) I don't know. I can only see lists for robots that need charging in a LuaLogisticCell.

Re: LuaPlayer.logistic_network and LuaLogisticNetwork.active_construction_robots

Posted: Mon Sep 24, 2018 3:31 pm
by mophydeen
or

LuaLogisticNetwork.active_robots :: array of LuaEntity
or
LuaLogisticNetwork.robots :: array of LuaEntity

and LuaEntity.robot_status :: string (inventory, charging, to_construction, to_repair, to_chest, to_player, ..) - The location/direction/status of the robot

Code: Select all

if LuaEntity.robot_status ~= "inventory" then 

Re: LuaPlayer.logistic_network and LuaLogisticNetwork.active_construction_robots

Posted: Tue Sep 25, 2018 1:28 am
by Rseding91
I've added added LuaLogisticNetwork::robots, construction_robots, and logistic_robots read for 0.17.

Re: LuaPlayer.logistic_network and LuaLogisticNetwork.active_construction_robots

Posted: Tue Sep 25, 2018 10:20 am
by mophydeen
Rseding91 wrote:
Tue Sep 25, 2018 1:28 am
I've added added LuaLogisticNetwork::robots, construction_robots, and logistic_robots read for 0.17.
Thank you

How do you know to whom the network belongs to ?

Code: Select all

network.cells[1].owner.name == "player"
or
network.cells[1].owner.name == "roboport"
and not
network.cells[1].owner.name == "Rseding91"