Transport Drones

by Klonan

Adds transport drones and transport depots

Content
11 months ago
0.18 - 1.1
77.4K
Logistics

i Road network reader: increase slots count

1 year, 5 months ago
(updated 1 year, 5 months ago)

Transport_Drones_1.0.14/data/entities/transport_depot/transport_depot.lua

...
local reader = util.copy(data.raw["constant-combinator"]["constant-combinator"])
...
reader.item_slot_count = 100

Transport_Drones_1.0.14/script/depots/network_reader.lua

function network_reader:update()
  local behavior = self.entity.get_control_behavior()
  if not behavior then return end

  for i = 1, behavior.signals_count do

    local signal = behavior.get_signal(i)
    local name = signal.signal and signal.signal.name
    if not name then 
        goto for_behavior_continue 
    end

    local supply = self.road_network.get_network_item_supply(self.network_id)
    if not supply then 
        goto for_behavior_continue 
    end

    local sum = 0
    local counts = supply[name]
    if counts then 
      for depot, count in pairs (counts) do
        sum = sum + count
      end
    end

    signal.count = sum
    behavior.set_signal(i, signal)

    ::for_behavior_continue::
  end
end

New response