Quantum Resource Distribution

by eliont

Special chest can send placed items to ship quantum storage unit and retrieve from it. Also works for player inventory (optional). It's make resource management more like RTS for playing combat-oriented settings/mods. Compatible with multi-surface mods like Space Exploration - item transportation works on surface, but not between them. Should be UPS-friendly because using events to track entities, not find_entities_filtered.

Content
2 months ago
1.1
859
Logistics Logistic network Circuit network Storage

i more "factorio" style display numbers in short

2 months ago

I tried to modify the function to be more similar to factorio's. feel free to use or not.

function number_to_short_notation(number)
  if number == nil then
    return 0
  elseif number < 1e3 and number > -1e3 then
    return number
  end
  for _, v in ipairs({"k", "M", "G"}) do
    number = number / 1e3
    if number < 10 and number > -10 then
      local trunc = math.modf(number * 10);
      return string.format("%.1f%s", trunc / 10, v)
    elseif number < 1000 and number > -1000 then
      local trunc = math.modf(number);
      return string.format("%.0f%s", trunc, v)
    end
  end
  -- factorio number should be up to 2.1G, but failsafe
  return string.format("%.0fG", number)
end

pros: fits to more narrow space, consistent with factorio's.
cons: I didn't notice by myself, but maybe a bit slower because it has more conditions.

New response