Space Engineers

Space Engineers

Not enough ratings
Basic Ship Status report and Airlock
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
18.014 MB
9 Dec, 2020 @ 9:18am
24 Feb, 2023 @ 12:34am
39 Change Notes ( view )

Subscribe to download
Basic Ship Status report and Airlock

Description
Space Engineers Ship Status Script

A configurable ship status display which renders sprites to different surfaces using a very flexible templating engine.
Includes auto door closing and airlock grouping.
Reads from CustomData (see Malware's MDK[github.com]), parsing a template and a display target section. Easily allows for customization and extension to render awesome screens.

Makes use of the following to draw sprites:
template engine (workshop)
graphics (workshop)

Examples
For a list of examples with images, see the example page[github.com] (wouldn't fit here).
The readme.md there will contain more info, examples (character limit here is too low).

Pasting this into the CustomData of the programmable block would configure the cockpit of a ship to look like the last image above:
[global] config=size=0.5;bgColour=15,15,10;colour=200,200,200 [Cockpit <0>] output= |Cargo: {cargo.fullString} |{cargo.bar} |Reactors: {power.reactors}, Batteries: {power.batteries} |{power.batteryBar} |Output: {power.reactorOutputMW} MW @ ({power.reactorUr} Ur) |Energy IO: {power.ioString} |{power.ioBar} |{power.ioLegend} [Cockpit <2>] output= |Ship status: {health.status} |{health.blocks} [Cockpit <1>] output= |{cargo.items}

Api listing
Global config settings:
setting
value type
description
default
airlock
true/false
Toggle program airlock
false
production
true/false
Toggle program production
auto (if in template)
cargo
true/false
Toggle program cargo
auto (if in template)
power
true/false
Toggle program power
auto (if in template)
health
true/false
Toggle program health
auto (if in template)
airlockOpenTime
integer
Set airlock auto-close time (ms)
750
airlockAllDoors
true/false
Toggle auto door closing for non-airlock doors
false
airlockDoorMatch
string
Door pattern to match (regex)
Door(.*)
airlockDoorExclude
string
Door pattern to exclude
Hangar
healthIgnore
string
Pattern to ignore (eg Thrust,Wheel)
none
healthOnHud
true/false
Enable "Show on HUD" for damaged blocks
false
theme
string
Configure all displays to use a theme (see config template var below)
none

Some template vars (full list on github) available by default are:

template var
options
description
config
font: set the font
size: set the font size
textPadding: set the padding
colour: set the text colour
bgColour: set the background colour
Configure the display (only runs once)
cargo.bar
none
A coloured fill bar which goes from green to red based on % full
cargo.cap
none
The cargo volume capacity
cargo.fullString
none
A nicely formatted `<current> / <max> L` volume string
cargo.items
none
A list of all items in cargo. Will split into 2 columns if display is wide enough
cargo.item
name: name of the item to select (as shown in cargo.items)
The count of a particular item
cargo.stored
none
Current cargo volume
health.blocks
none
A list of all damaged blocks and their percent health
health.status
none
A message saying whether damage is detected or not
power.batteries
none
Count of batteries
power.batteryBar
Coloured bar showing discharge / recharge rate and time remaining
power.engineOutputMax
none
Max H2 engine output (MW).
power.engineOutputMW
none
Current H2 engine output (MW).
power.ioString
none
Formatted energy IO: net output / max output (utilization %).
power.ioBar
none
Bar showing contribution to total power by block. Reactors are blue, H2 engines red, betteries green, turbines yellow, solars cyan. If blocks are disabled, they are shown in a darker colour.
power.ioLegend
none
Shows a coloured legend for the io bar.
power.jumpBar
default bar options[github.com], text: string, pct: float
Jump drive charge status. Text and percent override the default bar contents.
power.jumpDrives
none
Jump drive count.
power.jumpMax
none
Jump drive max charge (MW).
power.reactors
none
Reactor count.
power.reactorString
text: string
Formatted reactor string: &lt;text or Reactors: >&lt;count>, Output: &lt;output> MW, Ur: &lt;uranium> kg"
power.reactors
none
Reactor count
power.reactorUr
none
Reactor uranium in kg.
power.solarOutputMax
none
Max solar output.
power.solarOutputMW
none
Current solar output.
power.solars
none
Solar panel count.
power.turbines
none
Wind turbine count.
production.blocks
none
List of assemblers and refineries, with a status icon and their queue (if any).
production.status
none
Overall production status (power saving, enabled, halted). The production class will turn on / off production blocks if they idle for a long time, then check every 4 minutes to see if they need to start up again.
gas.o2FillPct
none
O2 tank fill pct.
gas.o2Tanks
none
Listing of O2 tanks names and volume (current/cap and %).
gas.o2Bar
O2 tank filled percent bar.
gas.generationEnabled
txtDisabled: text to show when disabled, txtEnabled: text to show when enabled
Text for O2 generators enabled or disabled.
gas.h2FillPct
none
H2 tank fill pct.
gas.h2Tanks
none
Listing of H2 tanks names and volume (current/cap and %).
gas.h2Bar
H2 tank filled percent bar.
32 Comments
initech  [author] 25 Feb, 2023 @ 11:44am 
Totally, my code isnt great but I've seen worse :D

Next release will be properly minified just to get the limit under, but I'll keep the unminified version as well in github.

https://github.com/p-mcgowan/se-scripts/blob/master/ShipStatus/Unminified.cs
https://github.com/p-mcgowan/se-scripts/blob/master/ShipStatus/Script.cs
Thorn Blackwell 24 Feb, 2023 @ 10:22pm 
The sad thing is there so many people with horrible looking code, making it nearly impossible to follow or trouble shoot. Making it ugly shouldn't be encouraged, and for people like me who really like when a programmer leaves remarks so I can follow the process it's actually instructive. The artificial limit really bothers me, even though I understand the need. So, I am kinda glad the final version was too big so I could save a copy and learn from it. :)
initech  [author] 24 Feb, 2023 @ 12:36am 
Ah, I must have undone the last publish - I just re-published the minified version so you should be able to load it without editing. It's definitely ugly, but it works.
initech  [author] 24 Feb, 2023 @ 12:31am 
Yeah I noticed it's too big now, I had to delete all the leading spaces so I left the un-"minified" version in there as well. Was looking into a proper minifier since it will probably not be enough again in the future.

I thought the version that's loaded from the store would work out of the box, but if not I'll have to change it again - most people won't want to use it if it doesn't work when downloading / subscribing.
Thorn Blackwell 22 Feb, 2023 @ 9:51am 
I managed to get it to work by removing the comments in the beginning, and then reducing the number of spaces at the beginning of each line so it is less than 100,000 chars in length. I also added the h2/o2 Generator to the list of containers for Ice. Works great! I did save a copy of the original code ... I hate messing up the formatting. :sefacepalm: Thank you so much. :steamhappy:
initech  [author] 11 Feb, 2023 @ 12:04pm 
Yeah the default scripts are not great, but gives us the motivation to create our own at least :)
Thorn Blackwell 11 Feb, 2023 @ 11:45am 
Awesome ... thank you so much. I really wish the devs had thought of better scripts for displaying on LCD. The power and hydrogen screen is barely useful.
initech  [author] 11 Feb, 2023 @ 6:20am 
Ok all done.

Added gas template utils (should be pretty self explanatory but there are examples in the github readme too):
gas.o2CurrentVolume, gas.h2CurrentVolume, gas.o2MaxVolume, gas.h2MaxVolume, gas.o2FillPct, gas.h2FillPct, gas.o2Tanks, gas.h2Tanks, gas.generationEnabled, gas.o2Bar, gas.h2Bar

Added single-item cargo count:
cargo.item:name=Ice

So for your question before, total hydro volume is {gas.h2CurrentVolume}, total uranium is either {cargo.item:name=Uranium Ingot} or {cargo.item:name=Uranium Ore} or {power.reactorUr}.

reactorUr is the uranium ingots inside reactors, cargo.item:name=Uranium Ingot is the count of ingots in storage - so you may have 600 ingots in the reactors but 0 in storage.

Hope that helps!
initech  [author] 11 Feb, 2023 @ 2:21am 
I don't have anything up for o2 or h2, but that would be a cool idea to add in.
I ended up building something for o2 in another script, but maybe I'll add it in here soon (https://github.com/p-mcgowan/se-scripts/tree/master/oxygen-monitor) . It ties into the templating functionality, and toggles o2 generators on/off depending on fill amount to not vent o2 through airlocks.

Same for ice, I think I'll add a selector for specific items, not sure though would have to look into it.

For Uranium, you can user {power.reactorUr} to get uranium in kg.
Thorn Blackwell 3 Feb, 2023 @ 12:30pm 
Is there a way to display how full the hydrogen tanks are? I'd really like to have a single bar that displays the total volume of hydrogen in all tanks. It would also be nice to be able to display the amount of all ice or uranium on board (not as a bar, but total mass). Just critical items, you can of course list a full inventory already.