Surface and Orbit Authority

TIM, automatic manufacturing, and modded ammo

Hi folks!

Several folks on the server use versions of Taleden’s Inventory Manager, a programmable block script that automatically organizes inventory, prioritizes refineries, and manages production of components and ammo. One of its features is automatically manufacturing items to meet quotas - a feature that’s very useful for keeping your guns loaded, given the extremely hostile NPCs and frequent meteors.

If you’ve used it, you’ve probably noticed that while TIM can automatically produce ammo for the built-in turrets, it can’t automate production of ammunition for weapons from the mods we have installed. This turns out to be due to questionable API design decisions inside of Space Engineers: there is no practical way for TIM to guess how to create modded items, so, while it can organize them, it can’t produce them.

However, while TIM can’t guess how to produce these items, you can configure it to know how.

At the top of the script is a large table, broken up into sections. These sections map items (things you can put in cargo containers) to default quotas, shorter names, and - importantly - to blueprints (things that assemblers can build). To enable automatic production of modded ammo, all you need to do is add lines to these tables for the items and blueprints you want to create. Conveniently, for the weapon mod we have, all the items have the same name as the blueprints, so this is very easy.

To enable automatic production of all modded ammo types we have installed at this time, replace

AmmoMagazine/
/Missile200mm
/NATO_25x184mm,,,,NATO_25x184mmMagazine
/NATO_5p56x45mm,,,,NATO_5p56x45mmMagazine

with

AmmoMagazine/
/Missile200mm
/NATO_25x184mm,,,,NATO_25x184mmMagazine
/NATO_5p56x45mm,,,,NATO_5p56x45mmMagazine
/300mmShell_HE
/300mmShell_AP
/900mmShell_HE
/900mmShell_AP
/Aden30x113
/Bofors40mm
/Vulcan20x102
/LittleDavid
/BigBertha

These item names are from the AmmoMagazine_*.sbc files from the Battle Cannons and Turrets mod. Because this mod uses the same names for both ammo magazines and ammo magazine blueprints, this is sufficient to enable automatic production: once you do this, if you set up a TIM inventory tag on your turrets for these ammo types, they’ll automatically be produced at TIM-managed assemblers, and automatically loaded into the guns.

1 Like