Space Engineers

Space Engineers

Not enough ratings
Life Support System
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
33.363 KB
Oct 8, 2017 @ 7:02am
Sep 13, 2019 @ 12:49pm
4 Change Notes ( view )

Subscribe to download
Life Support System

Description
Description

Life Support System (LSS) script pursues just two major goals.
First is saving power by turning OFF blocks like air vents n gas generators when they are not needed. For example, one large grid air vent consumes 100 kW of energy when it's ON, doesn't matter if the room is fully pressurized/depressurized. For comparison, one solar panel maximum output of power is 120 kW, and a wind turbine is 400 kW. But I'm sure even you run nuclear reactor and have plenty of uranium you would prefer to not waste it.
The second goal is to manage which oxygen source will use your ventilation network and keeping oxygen and hydrogen tanks at the desired fill ration.

Script features
  • Keeps gas tanks fill ratio between minimum and maximum limits, allowing rare refill cycles, and giving free space for depressurization.
  • Keeps room pressure over a specific level of oxygen.
  • Depressurization to desired oxygen level.
  • Keeps oxygen tanks from overfilling when hydrogen tanks refilling.
  • Outputs summary of working/malfunctioning/stand-by tanks and gas generators, remaining stock of ice, and oxygen level for every air vent.
Due to some limitations it's considered that all managed blocks connected to one the same conveyor system. Also, the script works better if there are at least one oxygen and one hydrogen tank.

Script prioritizes sources of oxygen: oxygen tanks > external vents (must be set to depressurize) > oxygen generators.
Example: let's say our conveyor net has O2 generator, O2 tank, H2 tank, external air vent set to depressurize, internal air vent to pressure room. The internal vent will pressure room with O2 from the tank if it has some. If the tank is empty then external vent will be engaged, of course, if this vent not damaged, and there is at least some oxygen in the environment. If refilling with external air vent not possible, the gas generator will be engaged. If gas generator damaged, or run out of ice, and not O2 source if found special message will be displayed on specified LCDs. For O2 tanks refill the script first will try to use external vents, then oxygen generators.
Note: the script does not transfer ice (and any items) across inventories. If a gas generator was run out of ice it will be considered malfunctioning, until the user manually, or using sorters, or using other scripts, or by any other means, will put ice in a said generator.

The script also keeps an eye on oxygen farms, but it's not considered a reliable source of oxygen. The script can turn them OFF if oxygen is not needed, keep them always ON, even if it may lead to O2 tanks overfill.

Custom settings

Script support custom settings for gas tanks and air vents. These custom settings set up in block's Custom Data property, written in INI format and will override global settings defined in the script.

Example for air vent:
[Vent] LowerPressureLimit = 0.9 LowerDepressureLimit = 0.2 Hide = true ---

  • [Vent] header indicating beginign of the settings. Mandartory
  • LowerPressureLimit sets level of oxygen for pressurisation. If room oxygention ration drops below this level the sript will start refilling process. Optional
  • LowerDepressureLimit sets level depressurisation. The script ill not epressure rooms below this value. Optional
  • Hide if set to true the script will not sho oxygen level for this vent in LCDs. Optional
  • --- separator. If you have some additional text, not related to INI format, separate it with a line containing these three dashes. Optional

Example for gas tanks (both H2 an O2):
[GasTank] LowerLimit= 0.1 UpperLimit= 0.2 ---

  • [GasTank] header indicating beginign of the settings. Mandartory
  • LowerLimit sets lower fill ratio level of gas. If tank ration below this level the sript will start refilling process. Optional
  • UpperLimit sets upper fill ratio level of gas. If tank ration above this level the sript will stop refilling process. Optional
  • --- separator. If you have some additional text, not related to INI format, separate it with a line containing these three dashes. Optional

Any block may be excluded from script control by placing in said block's Custom Data property keyword LSS_IGNORE.

Script setup

To setup script you only need Programmable Block. Put the script into PB, compile and save.

Text Panels and cockpit's LCDs
The LSS can output text data to LCD panels of Text Panel and cockpit blocks. For that, you need to put in Text Panel's or cockpit's Custom Data property LSS_display keyword and a numeric index of LCD in this block. For Text Panels, this index is always 0. For other blocks, it's from 0 to number of LCDs minus one.
For example, if the cockpit has this list of LCDs:
  • Top Center Screen
  • Top Left Screen
  • Top Right Screen
  • Keyboard
Then for center screen index is 0, for the left screen it's 1, for right one it's 2, and for the keyboard it's 3.
Also, it is recommended you set the font to monospace.

Programmable Block LCD
LSS's programmable block can output runtime info (one that could be seen in the terminal menu) in its LCD. For that in PB's terminal menu set the Content Type 'Text and image' for its main screen. Also, PB's Custom Data should be empty.

If you add or remove blocks don’t forget to recompile script in the programmable block.
16 Comments
SpartanS049 Nov 16, 2020 @ 12:35pm 
Thank you again for the help. Found what my problem was and fixed it. Forgot to recompile the program after I setup the LCD
SpartanS049 Nov 16, 2020 @ 12:05pm 
I might add that the script is working correctly and managing the O2 in my base. I like it, I just can't get the LCD to give me a readout. I've got a set of LCD's I'm using in my control room for quick info usage just with the basic LCD's. Thank you for getting back so quickly btw
SpartanS049 Nov 16, 2020 @ 11:57am 
Yes I am sure
Wanderer_308  [author] Nov 16, 2020 @ 10:57am 
@SpartanS049, are you sure there is no typos in LCD's Custom Data? It shoul be just
LSS_display 0
SpartanS049 Nov 15, 2020 @ 10:18pm 
Hey, I can't figure out how to use the LCD's. I got it to work on the programmable block, but nothing I do will make it show up on any LCD's
Wanderer_308  [author] Jan 16, 2020 @ 12:09pm 
No, unfortunately, there is no such functionality. You only can change the number of rows displayed per page.
SalazarWindriver Jan 15, 2020 @ 3:09pm 
Is there a way to span this across multiple screens? I have a large base and some of the text goes off screen.
Wanderer_308  [author] Sep 13, 2019 @ 3:01pm 
New 2.0 version is up. Enjoy.
Tetz Sep 7, 2019 @ 7:20pm 
Aweseme. I look forward to it. Thank you.
Wanderer_308  [author] Sep 7, 2019 @ 2:15pm 
Yeah, i will fix that. In fact, it almost done, a complete rewrite of the script, just need to cut some stuff out because it not working as i thought. Once i find enough time i ill finish it.