Space Engineers

Space Engineers

Warship Manager
 This topic has been pinned, so it's probably important
ZerothAngel  [developer] 15 May, 2016 @ 1:10pm
Inventory Stock Manager
This is a group-based inventory manager that maintains a minimum number of certain item(s) in certain blocks.

For example, I use this to maintain at least 10 missiles in every missile turret & rocket launcher, 10 ammo containers in every gatling turret, along with 5 steel plates/interior plates/construction components in every welder.

This helps alleviate some bugs self-repairing ships run into in survival mode.

Usage

First, select all cargo blocks and create a block group around them named StockSource. The script will only pull items from these blocks.

Next, select the blocks you want to manage inventory for. For example, missile turrets & rocket launchers. Then create a block group around them with the name:

Stock<subtypeId>:<count>

Where <subtypeId> is a normal inventory item subtype ID. Some common ones:
  • Missile200mm
  • NATO_25x184mm
  • NATO_5p56x45mm
  • BulletproofGlass
  • Computer
  • Construction
  • Detector
  • Display
  • Explosives
  • Girder
  • GravityGenerator
  • InteriorPlate
  • LargeTube
  • Medical
  • MetalGrid
  • Motor
  • PowerCell
  • RadioCommunication
  • Reactor
  • SmallTube
  • SolarCell
  • SteelPlate
  • Superconductor
  • Thrust
So using the missile example, StockMissile200mm:10 would maintain 10 missiles in the missile turrets & rocket launchers.

Note that while the word "Stock" can be any letter case, the <subtypeId> must match the letter case above exactly.

And that's it. Create as many groups as you want for as many subtype IDs as you want. This module runs every 2 seconds and is fairly optimized, i.e. does nothing if you have no StockSource group defined, skips scanning inventory if all blocks have their minimum number, etc.
Last edited by ZerothAngel; 16 May, 2016 @ 12:00pm