Space Engineers

Space Engineers

Not enough ratings
TBF - production and power manager
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
51.686 KB
21 Feb, 2018 @ 11:41am
21 Jan, 2020 @ 8:32am
4 Change Notes ( view )

Subscribe to download
TBF - production and power manager

Description
Teladi's Best Friend - production and power manager.

Highlights of the main features
  • Does power production and consumption analysis grouped by structures (i.e. grids)
  • Gives component amount summary with change trend and history (currently shows prev value and diff during last hour)
  • Gives assemblers orders to produce components based on configured amounts
  • Moves inventory contents to containers marked by mask
  • Supports dynamic plug-in of stacked panels and rolling logger
  • Can resupply docked welding drone with components based on config (experimental, not survival-tested yet)
  • Configured via PB custom data or commands, config fully decoupled from code

It does not control anything regarded to power, like battery charging or solar panel alignment.


I want to share this code which has proven very useful for me in survival.
I haven't found ready solution lightweight and practical enough to suit my needs, so I've written my own (probably 1000th on workshop) script of this kind.

The code serves 3 main purposes.
1. View inventory object amounts and their change dynamics
- useful on drilling ship to know when to stop
- useful on production to understand your production capacity and predict any material shortages
- useful for feeling good about your powerful unstoppable Teladi profit-making industrial-grade machine
2. Control assemblers to produce certain components when they fall below limit
- useful for not worrying for grabbing components from your storage - everything will be replenished automatically
3. Understand the power consumption of your grids better
- it will give a breakdown of your required power inputs for every consumer class in each connected grid
- it will give a breakdown of your power producers grouped by type
4. Move certain types of objects to tagged inventories. Examples:
- tag cargo box with [axo.drain=Ore,Ingot] to get all ores and ingots into that container
- tag cargo box with [axo.drain=Component] to get all components into that container
- tag cargo box with [axo.drain=SteelPlate] to get all steelplates into that container
- tag cargo box with [axo.ignore] to "protect" that container from the script
- default scope is construct-wide, i.e grids composed into singe unit (by rotors or pistons)

Features output to 2 types of lcd wrappers - realtime and rolling logger, both are combined from any number of vertically-aligned panels.
I prefer using stack of 3 for realtime output (lists of stuff) and stack of 2 for logger.

Realtime lcd wrapper has several modes (can be switched on the fly).

Setup:
1. Copy the component amounts config* part to Custom Data field of your Programmable Block, tune the numbers.

2. Set up your lcd panels. They must have specific parts in their names (used in CustomData init, see below).

3. Set up button panels or whatever you want to switch axo-panel's mode (components breakdown or power breakdown).
a. Action Run PB with argument:
command:cycle-feedback-tag

4? For advanced dudes - Tune the style configurator and line limits at the bottom of the script

* Copy to Custom Data field (replace panel names with yours)

command:add-multipanel:LCD panel axo 1
command:add-multipanel:LCD panel axo 2
command:add-multipanel:LCD panel axo 3

CDATA Format=CSV
SteelPlate, SteelPlate, 6000, 3
Construction, ConstructionComponent, 4000, 2
PowerCell, PowerCell, 0, 45
Computer, ComputerComponent, 2000, 1
LargeTube, LargeTube, 1000, 38
Motor, MotorComponent, 3000, 8
Display, Display, 500, 6
MetalGrid, MetalGrid, 500, 15
InteriorPlate, InteriorPlate, 4000, 5
SmallTube, SmallTube, 3000, 2
RadioCommunication, RadioCommunicationComponent, 0, 140
BulletproofGlass, BulletproofGlass, 200, 8
Girder, GirderComponent, 1000, 2
Explosives, ExplosivesComponent, 0, 2
Detector, DetectorComponent, 0, 6
Medical, MedicalComponent, 0, 160
GravityGenerator, GravityGeneratorComponent, 0, 200
Superconductor, Superconductor, 0, 666
Thrust, ThrustComponent, 0, 10
Reactor, ReactorComponent, 0, 8
SolarCell, SolarCell, 0, 50
1 Comments
heero_yuy_052004 21 Feb, 2018 @ 12:09pm 
will will use this in one of my builds that i have done and i will tell you if it works great