Space Engineers

Space Engineers

Not enough ratings
Production Inventory Manager (PIM) Version 1.0
By BelaOkuma
Guide for the Production and Inventory Manager.
Formerly it was integrated into the SMS Script, but with version 1.3 I had to outsource it due to space constraints.
   
Award
Favorite
Favorited
Unfavorite
Disclaimer
It is really just a simple sorter, there are more extensive scripts.
But for the little space engineer it might be quite useful for a start.

It was removed from the script SMS from version 1.3 on, because otherwise I would have reached the 100k character limit for scripts.

The two scripts exchange information with each other and can therefore run side by side.

install
Load the script into a programmable block using the "Edit" button.
It does not need a timer to run.
Where to sort?
The PIM sorts all grids that are connected to the grid of the programmable block via motors and pistons. Ships docked via connectors are not sorted.
What is sorted?
All containers and connectors that will have a "(sms)" in their name
and sorted the items into the corresponding containers. If no
container has been set up for "ammo", for example, or it is full
the ammunition remains in these inventories. Acquisition of new containers is not automatic.

To set up simply put in brackets
after the names of the containers:

... (sms)
the items in this container/connector are sorted.
For example, this could be a small freight container that is only used to access the inventory,
but should otherwise remain empty.
... (sms,ore)
for ores
... (sms,ingot)
for ingots
... (sms,tools)
for hand tools and weapons
... (sms,ammo)
for ammo
... (sms,h-bottles)
for hydrogenbottles
... (sms,o-bottles)
for oxygenbottles
... (sms,component)
for components
... (sms,ice)
for ice
... (sms,kits)
for power and medkits
... (sms,datapads)
for datapads
... (sms,cash)
for spacecredits
... (sms,stone)
for stone.
... (sms,gravel)
for gravel.
... (sms,armory)
for weapons and ammo.

Combinations are possible.

... (sms,tools,o-bottles,h-bottles)

When the following options are set to true in the script
it sorts the corresponding items from all containers, connectors and cockpits as well as from cryochambers into the boxes marked "... (sms,...)" in the inventories.

bool collect_all_Ore=true; bool collect_all_Ingot=true; bool collect_all_Component=true;
If you don't want that, set the options to false.

You can also define containers for single ores or ingots.

For example:
... (sms,ore uranium)
... (sms,ingot iron)

You can also define a separate container for each component.
The keywords are:

keyword
component
steelplate
steelplate
metalgrid
metalgrid
interiorplate
interiorplate
smalltube
steeltube small
largetube
steeltube large
glass
bulletproof glass
gravity
gravity componnets
radio
communication components
solar
solarcell
power
powercell
zonechip
zonechips
motor
motors
display
displays
construction
construction components
girder
girder
computer
computer
reactor
reaktor components
thrust
thruster components
medical
medical components
detector
sensor components
explosives
explosives
canvas
canvas

For example:
... (sms,steelplate)
for steelplates
control of the refineries
prerequisites:
  • Containers must be defined for ores and ingots.
  • These must be connected to the refineries via the conveyor network.
  • The ores for processing must be in a container for ores.
What is controlled:
  • all refineries (including modified ones) whose names "... (sms)".
  • filling of refineries with ores from containers
  • Transport of the ingots into the containers
  • Switch off the refineries when production is finished ***
***
The autooff function can be turned off for all assemblers or refiners in the script itself. Or you can disable it for each block individually in the name ("...(sms,nooff)")

The Scrpit "calculates" the priority of the individual ores used for the
processing are available (1-100). These can be displayed
via the command "oreprio" of my script SMS. There are for
each type of refinery has its own priolist (Refinerys,Arc Furnace,...).

You can override this list and enter prio values greater than 100.
Just do it in CustomData of a refinery,
for whose kind you want to have a certain ore priority:

oreprio:ore=priority

For example:

You want the arc furnaces to always process stone first?
Then write in CustomData of any arc furnace:

oreprio:stone=1000

You always want the refineries to process stone last?
Then write in CustomData of any refinery:

oreprio:stone=1

Or refineries shouldn't process stone at all?

oreprio:stone=0

control of the assemblers
prerequisites:
  • Containers must be defined for components.
  • There must be sufficient ingots in containers.
  • These must be connected to the assemblers via the conveyor network.
What is controlled:
  • all assemblers (including modified ones) whose names "... (sms)".
  • Assemblers take the required ingots for themselves
  • Transport of the ingots or components into the containers
  • Switch off the assemblers when production is finished ***
***
The autooff function can be turned off for all assemblers or refiners in the script itself. Or you can disable it for each block individually in the name ("...(sms,nooff)")

Autocrafting
After the first start of the script a list in CustomData of the Programmable Block contains all producible items.

An example list for a LargeGrid with a SurvivalKit:
@AutocraftDefinitions_begin @Autocrafting_threshold;80 @Mod: Vanilla 0;HandDrill;P 0;AngleGrinder;P 0;Welder;P 0;Datapad;D 0;SolarCell;C 0;ComputerComponent;C 0;Display;C 0;MotorComponent;C 0;GirderComponent;C 0;SteelPlate;C 0;InteriorPlate;C 0;ConstructionComponent;C @AutocraftDefinitions_end;14

If you then build a BasicAssembler or a Big Assembler the list is extended. Also some mods are supported:
  • Daily Needs Survival Mod
  • Paintgun Mod
  • Azimuth Truster Mod
  • Stargate Mod
  • Deuterium Reaktor Mod
  • Defense Shield Mod
The script automatically recognizes which items can be produced from which mod and adds to the list in CustomData. They are sorted by mods.

The number at the top of each line defines the maximum amount of the corresponding item, 0 means no autocrafting. If the threshold value (default 80%) of this item is fallen below, orders are generated to reach the maximum quantity again.

Here is an example:

We have 12300 steel plates on the grid. We enter 10000 in the list.
10000;SteelPlate;C
If the number drops below 8000 (80% of 10000) due to welding or removal, about 2000 are ordered. The quantity is subject to a certain tollerance and will not be exactly 10000 in the end.
PIM and Daily Needs Survival Mod
PIM can also handle the blocks of the DNSK mod.

To collect the items of this mod in a container write:

... (sms,food)
Generally for food.
... (sms,water)
For water
... (sms,greywater)
For "dirty" water.
... (sms,organic)
For organic.
... (sms,waste)
For organic and greywater.

The Food Resequencer and the Soil Tray Crop Grower as well as both Hydroponics Farms can be controlled by Autocrafting. Also the Waterrecycler which can only produce water from ice or Greywater.

Special features by Autocrafting:

In this mod there are three blocks that are by definition a refinery, but are controlled from the script via autocrafting.
  • Water Recycler
  • Open Hydroponics Farm
  • Enclosed Hydroponics Farm
4 Comments
Superawesome4141 19 Feb, 2022 @ 3:26am 
Thanks!
BelaOkuma  [author] 18 Feb, 2022 @ 8:16am 
yes, that is possible.
for example to store ores and ingots in a container name the container with:
'... (sms,ore,ingot)'.
or gold ore and gold ingots:
'... (sms,ore gold,ingot gold)'.
or steel plates and uranium ingots:
'... (sms,steelplate,ingot uranium)'.
Superawesome4141 17 Feb, 2022 @ 1:11pm 
is it possible to have a single container contain multiple groups? (For instance ores and ingots will be sorted into a single cargo container)
Antharann Fireblade 12 Oct, 2021 @ 6:40am 
Great Script so far, sadly its not compatible with Industrial overhaul yet, any chance it will be made compatible with it/we get an alternativ version of this script for it?