Space Engineers

Space Engineers

194 ratings
Supply Lines
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
752.346 KB
1 Oct, 2022 @ 8:34am
22 Nov, 2022 @ 10:02am
4 Change Notes ( view )

Subscribe to download
Supply Lines

Description
-= Supply Lines =-
Build smaller, more efficient, automated bases that are easier to maintain!
  • Stops the offloading of miners to prevent overfill of ores
  • Especially useful for processing centers you want to mostly fully automate
  • Automate the flow of supplies with remote bases, mining outposts, etc.
  • Balance need and eliminate excess ore and ingots filling Containers and Refineries
  • Eliminate the ‘overflow’ and associated problems of miners overfilling your base
This script controls the flow of ores by automatically adjusting Conveyor Sorter white/black lists to control what ores (or ingots / materials) are pulled from a docked ship or direct connection (such as a Pipeline, etc.).

HOW IT WORKS
Supply Lines works by automatically controlling the Conveyor Sorters white/black lists to allow/restrict the flow of a particular Ore/Ingot.

You can send a ship/connect a pipe/whatever to any Sorter in the group controlled by the script and ores and ingots will be pulled only if the base needs it to fill the percent quotas you have set. Everything is done automatically by the script according to your configuration!

All you need to do is set up your base with Conveyor Sorters pointing toward your Containers (i.e., an Incoming Sorter) and connect a 'Supply' (Connector, Pipeline, Collector, etc.) to insure a steady flow of any particular Ore (Ores are most common, though if you have a supply of Ingots from another facility, that works too!).
https://youtu.be/BcTMkFlmz6g

USING MINERS and/or SHUTTLES with Incoming Conveyor Sorters
  1. Set up an LCD to read out the data (see SETTING UP LCDS below)
  2. Install a Programming Block (PB) with the Supply Lines script running on it. Note that the LCD starts showing data automatically.
  3. In the Custom Data (CD) of the PB, set the MIN and MAX for each item (Ore/Ingot) that you want to allow/restrict via Supply Lines (see SETTING UP YOUR SUPPLY LINE LIMITS) - the script will then take care of the rest, seting notification colors/numbers and blocking the item when the MAX is reached, giving you an INSTANT view of the status of the Ores and Ingots in your base, while controlling the flow and eliminating 'glut'!
SETTING UP LCDS
Enter the tag 'SL-Line' (no quotes required - can also be [SL-Line] if you like, etc.) in the Name or the Custom Data of the LCD

NOTE: MUST be a WIDE LCD!!!
Displays the list of Ores and/or Ingots you want for MIN and MAX as well as Current and a Status (for quick monitoring of your system)

Getting the most out of Supply Lines
Here is what you need to do to make a nice Supply Line for your base.
  1. Create your base with Containers, O2 Generators, etc. as you like. Basically, get your base up and running before installing SL (i.e., there are no special requirements other than the Conveyor Sorters that Supply Lines will control and though you may want to plan for that space-wise, they can be added at any time).
  2. Set up Ore 'supply lines'. NOTE: though not required, it is strongly recommended to ONLY collect Iron OR Cobalt OR Gold, etc. per Connector (use various methods available in SE like mining bases with separate containers for storing ore before transport to the main base, miners that eject non-wanted ores, etc.) because of the way Sorters, Connectors, Containers, etc. fill up with no regard to the ore in them (which is why you need this script!)
  3. On the main base, set up a connection (Connector, Pipeline, Collector, etc.) that then connects to a Conveyor Sorter (that points INTO the base). This will be used to 'filter' the ores.
  4. Once you have a connection/ConveyorSorter set up for each ore, select all of the ConveyorSorters and put them in a group named "SL-Direct" {you can change that name, see instructions in the script configuration section}
SETTING UP YOUR SUPPLY LINE LIMITS
- the MAGIC of the Supply Lines script!

When you load the script into the PB, it will automatically generate a list of Ores and Ingots in the CD of the PB - all with 0 defaults (allowing NOTHING to pass). To access the list, open the Terminal (highlight the screen on the PB and type K on your keyboard for easy access) scroll down the list and click on Custom Data.

Set up the numbers to restrict the Ores and Ingots according to your needs:

Ores will only be 'whitelisted' when both the Ore limit AND the associated Ingot limit allow it.

Note that the numbers follow a strict format

ORENAME ORETYPE=X+Y

Where:
ORENAME is the OFFICIAL name of the ore (like "Gold", "Silver", etc. - see https://github.com/malware-dev/MDK-SE/wiki/Type-Definition-Listing)
ORETYPE is the OFFICIAL name of the ore type
= (Note that there are NO SPACES here!)
Least amount that you want in the system without warnings - will trigger the red letters and URGENT so you have a sort of todo list when below this limit (0 will always show "OPEN" as long as the 'Maximum' is not 0 - see below)
+
Maximum amount you want in the system - controls the ConveyorSorters to ALLOW/STOP the particular ore/ingot from passing (anywhere in the "SL-Direct" Group).

IMPORTANT: 'Least' and 'Maximum' numbers are in PERCENTAGE OF TOTAL STORAGE CONTAINERS attached to the same grid as the PB (i.e., not attached ships, rotors/hinges/pistons, etc.)

SUGGESTED SETTINGS FOR ORES AND INGOTS
(Settings are found in the Custom Data of the Programming Block where Supply Lines is running - adjust up/down for your needs, though pay attention to the overall use of your system!)

[SupplyLines]
Cobalt Ingot=0.4+0.75
Gold Ingot=0.2+0.5
Gravel=0+0
Iron Ingot=10+12.5
Magnesium Powder=1+1.5
Nickel Ingot=0.8+1.25
Old Scrap Metal=0+0.5
Platinum Ingot=0+0.25
Silicon Wafer=0.1+0.25
Silver Ingot=0.1+0.25
Uranium Ingot=0.5+0.75
Cobalt Ore=0.1+0.8
Gold Ore=1+2
Ice=1+9
Iron Ore=4+8
Magnesium Ore=0.1+2
Nickel Ore=0.6+1
Organic=0+0
Platinum Ore=0+0.2
Scrap Metal=0+0
Silicon Ore=0+1
Silver Ore=0+0.5
Stone=0+0
Uranium Ore=0+0.5

COMMANDS

You can use the following commands in the Argument of the Programming Block (PB) to control the flow of an ore/ingot (the item MUST have 0+0 in the configuration to be controlled manually!)
Command
Required Argument
Optional Argument
STOP
OREINGOTNAME
OPTIONALTYPE
ALLOW
OREINGOTNAME
OPTIONALTYPE
Where 'OREINGOTNAME' is the OFFICIAL name of the Ore or Ingot and OPTIONALTYPE is the OFFICIAL name of the type (like "Ore", "Ingot", "Powder", etc.)
(Note that Ores are GENERALLY "Ore" and Ingots are GENERALLY "Ingot", but not always!)
OPTIONALTYPE is, as the name says, optional. The default (if you do not include this) is "Ore" (which means commands of "STOP Iron" will work great)

Special Notes, Considerations
CRITICAL NOTE!!! SE scripts work on a 'tic' method and are only allowed to work a very small amount of time.
What this means to Supply Lines is that even if you (or the script) will ALLOW and then STOP a certain Ore/Ingot,
the amount stored in your Containers will be somewhat larger than the MAX number you have in the settings (i.e., it is not instantaneous cutoff)
This number may be 2-5% MORE than you wanted - you need to allow for that in your settings!

IF YOU ARE USING ISY's INVENTORY MANAGER you must change the name of the Connector AND the ConveyorSorter to include "Locked [No IIM]" to keep the 'warnings' from saying "No route".

Join my Discord for discussions, first-look scripts and more - https://discord.gg/eFJ9vNQ7ET

Thanks for subscribing and all the 'Favorite', 'thumbs up' markings and Steam Points!
37 Comments
[-SL-] Apophis 11 Jan @ 3:24am 
Hey TechCoder (and you may be interested norto22),

I have made a small change to the script that allows filtering the storage containers by some configuration in the Custom Data of the programmable block. Do you have this on GitHub (or other version control) where I may open a Pull Request so other may benefit?
norto22 24 Mar, 2024 @ 4:52am 
Yeah, sorry - I probably explained it rather poorly initially. Anything like that which you could add would be very appreciated, if at all possible.

On another note, I absolutely love SL so thankyou for bringing this into the game!
TechCoder  [author] 24 Mar, 2024 @ 4:32am 
I do now understand better what you are asking and like the idea - at the surface - though the challenge is that IIM _often_ reallocates containers - and often uses Ores and Ingots in the same one. I haven't used IIM in quite some time (too many bugs there for awhile and too complex IMHO...) The complexity of configuration complicates any program trying to work in conjunction - adding a lot of 'overhead' to just to 'reverse engineer' the IIM algorithm and break it down to "oh, this/these container(s)...".

I don't like the idea of adding all that 'bulk' - though, perhaps adding a config in SL to designate container(s) is not a bad idea....
norto22 23 Mar, 2024 @ 6:13pm 
Well, then the percentage would be for that container - not the entire storage on the grid so I could set it so I want 15% of my Ore container storage to be Iron ore, 5% Silver ore and so on.

Allows more accurate allocation of resources to specific containers rather than the entire grid storage
TechCoder  [author] 23 Mar, 2024 @ 2:32pm 
Not sure how that would "be really good" - nor any different result than we have now. We look in all Containers for the data.
norto22 21 Mar, 2024 @ 9:38pm 
Is there a way to make this look in certain containers? I'm using Isy's Inv Manager and it would be really good if I could set the ore count to look in just the ore container that's set by IIM, and same for ingots.
kinngrimm 24 Feb, 2024 @ 7:15pm 
" must be 'smooth' "
:) yes
TechCoder  [author] 23 Jan, 2024 @ 10:10am 
I've worked on doing 'components' quite a bit and even the current workshop version _can_ do it, but it takes quite a bit of work to set up the parts (not a script issue, but in the way they are named in the code). There is a 'v2' version I have on my game and it does components (which the script doesn't care if it is for a building or a gun - whatever) and much of what you have described, however, with all the 'gotchas' of the clunky way the game handles it, I haven't published it because it would look like the script is the issue (probably why nobody has done anything like this before.... - just a lot of UGLY stuff to go through in the code....)

I may take it up again but the end result must be 'smooth', or I won't release it, and the components going on the list certainly don't make that simple!
kinngrimm 20 Jan, 2024 @ 8:51pm 
besides munition, components would be the next big topic. Have them shoved on docking welder ships, removed from grinder ships. Put onto a transporter restocking a carrier, unloading the carrier.
kinngrimm 20 Jan, 2024 @ 8:48pm 
Simplified this works like an inverted pressure valve, right? Not enough, open the valve, too much close it.

Does the script only manage sorters on the same grid where the PB is or also connected grids/subgrids?

Does this work with munition? Say i have a container on a ship i want to keep filled up with 1/3 each of 3 types of munition? Would i need to have an additional script running on that ship? Does it have to be incoming sorters or could it be outgoing sorters in those cases?