Space Engineers

Space Engineers

32 ratings
Ship Manager
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
469.750 KB
4 Jul, 2015 @ 1:15am
23 Jun, 2022 @ 12:10am
22 Change Notes ( view )

Subscribe to download
Ship Manager

Description
2017-11-17 Update: No longer needs a timer block. If you had one before, I recommend you "disconnect" it from the prog block (remove all its actions) to reduce surprises.

Also, due to 1.185, it is no longer possible to read oxygen levels from disabled vents. I worked around this, but the air vent manager is no longer compatible with the complex airlock controller. You can only use one or the other.

ZerothAngel's Ship Manager

This is a multi-feature script which I run on all my large ships and stations. Each feature can be enabled/disabled independently.

The major features are:
  • Automatic door closing. Closest doors after a defined amount of time. Easy group-based configuration that lets you define multiple sets of doors with different timeouts.

  • Simple airlocks. I define a simple airlock as 2 (or more) doors with no involved air vent where only 1 door can be open at a time. It uses groups, so it is very flexible. Sorry, airtight hangar doors are not supported.

  • Complex airlocks. I define these as airlocks that involve air vents. This is a work-in-progress, but is very much functional. There just aren't any bells and whistles (e.g. flashing lights or sound triggers) and certain failsafes are missing (like if an airlock fails to pressurize or depressurize). Configuration is also, unfortunately, very complex. This is because I wanted it to support really complicated layouts. Also, airtight hangar doors are supported (but all airtight hangar doors assigned to an airlock are treated as a single door).

  • A simple oxygen manager. It will shut off oxygen production when the average oxygen tank level rises above a certain number (by default 90%) and will re-start oxygen production once it falls below another (70%). If it falls below another threshold (50%), it will start an optional timer block named "Low Oxygen". I needed something like this because it's hard to depressurize airlocks when all tanks are at 100%.

  • A simple air vent manager. Air vents consume a lot of power when running (and nowadays, also produce an annoying hissing sound). The air vent manager aims to only enable air vents when room pressure drops below a certain percentage and then disables them when pressure is near 100%.

  • A refinery balancer This module implements a very simplified version of Guran's Refinery Manager. It's simplified in the fact that it only rebalances 1 refinery per run (e.g. 1 per second).

  • A production manager for large assembler arrays This feature is most like rockyjvec's Auto Assembler (but was written from scratch and heavily optimized). Also has an auto-setup function to automatically rename your assemblers appropriately, with somewhat reasonable item counts.

  • A simple redundancy manager This ensures that a certain number of blocks in a block group are enabled at all times (for example, in the face of damage or accidental disabling).

  • Simple docking actions Turns blocks on/off depending on the state of an associated connector.
Each of these features can be enabled/disabled by editing some options at the top of the script.

Now on using each feature...

Auto door closing

If enabled, there are two ways to use this feature:
  • Do nothing. All doors on the same grid (excluding vanilla Airtight Hangar Doors and doors with "[Excluded]" in their name) will be closed after 3 seconds (configurable by editing DEFAULT_DOOR_OPEN_DURATION)

  • Create one or more block groups around doors with the name "AutoClose<whatever>" or "AutoClose<whatever>:<duration>"

    Letter case doesn't matter and <whatever> can be anything, even empty. <duration> is the number of seconds to allow the door to stay open -- if omitted, it will default to DEFAULT_DOOR_OPEN_DURATION (3 seconds). Some examples: AutoCloseAirlock, AutoClose:10, or even just AutoClose.

    You can change the group prefix by editing DOOR_AUTO_CLOSER_PREFIX.
Simple airlocks

Simply group 2 or more doors into a group named "SimpleAirlock<whatever>", for example, "SimpleAirlock Starboard" or "SimpleAirlockBridge". If any door in the group is open, then all others are locked (hopefully they were locked closed :P). Very simple.

Complex airlocks

See this post.

Oxygen manager

Nothing to do, just edit the constants to your taste. Also, it will only touch oxygen generators and oxygen farms on the same ship, but it will consider oxygen tanks from all connected ships. Ignores oxygen tanks with "[Excluded]" in the name (should be used for anything not on the main conveyor network).

Unfortunately, hydrogen tanks are also counted by default, so keep this in mind.

Any air vents tagged with "[Intake]" will be controlled as if they are oxygen farms, i.e. disabled at above 90% capacity. It's assumed this type of air vent is outside the ship and used to pull in oxygen from planets.

One final note: If you don't have both oxygen and hydrogen tanks, it is better to disable the oxygen manager. Otherwise, refilling hydrogen from medical rooms will be a little difficult.

Air vent manager

Similar to the oxygen manager, simply edit the constants to taste. Air vents with "[Excluded]" in their name are never touched.

Note that while anything above 50% is considered "high" pressure, any extreme difference between rooms will cause the typical "whoosh" effect when you open a door between them. So keep the constants relatively high if you want to avoid this (I am currently experimenting with 90%/95%).

Refinery manager

If some refineries are working while some are idle, it will take half of the ore from the refinery with the most and transfer it to an idle refinery.

By default, it works on all refineries on the same grid.

If you have a mix of blast furnaces and regular refineries or refineries on different conveyor networks, you should group your refineries/furnaces. Simply create a block group around all refineries/furnaces that should be balanced together with the name "Refineries<whatever>" where <whatever> can be whatever you like. For example, "RefineriesMain" or "Refineries Furnaces". Each group with the "Refineries" prefix is balanced independently from one another.

Production manager

Don't have enough room to explain this feature, see Auto Assembler's docs. :P Containers don't need a {storage} tag and only containers on the same ship are considered. Items are not auto-moved, so use a sorter block.

Redundancy manager

See this post.

Docking actions

Just set up groups as described in the standalone version of the script.
63 Comments
Random 25 Sep, 2022 @ 4:41pm 
damage control is in the script but not documented here
kn-heal 17 Sep, 2021 @ 8:09pm 
update plz
Thaleosaurus 8 Feb, 2020 @ 10:38am 
Hey.
This is one of my mandatory scripts on all larger ships I make. Love the work you've done.
Are you still willing to update it, there are some things I'd like to se if is possible,

for instance: even when excluded the script turns power back on for doors with [excluded]
jackik 28 Sep, 2018 @ 10:14pm 
Perhaps even tags for backup systems (could be almost achieved right now via the redundancy manager, but not in the same functionality) that only activate in dire situations and main reactors that are online most of the time unless the system is essentially sated.
jackik 28 Sep, 2018 @ 10:14pm 
Well, but vanilla batteries don't take other factors in mind, such as reactor output and solar power.
Ideally reactors would only be drawn from if all other factors won't be able to fully supply enough energy for a certain amount of time. Using Uranium when it's not necessary is a waste and having a centralized system for management is better than having a dozen PBs for each component, that's why i asked.
Actually, is it possible to sort blocks by powerdrawn? If the script were able to detect when the power wouldn't be enough for more than X minutes (with reactors) and would then try to deactivate the most demanding block (then trying again to check if it's enough (and perhaps with possible arguments)) that would make it a lot more resilient energywise.
Anubis 28 Sep, 2018 @ 8:47pm 
any chance you might add an autolevel feature for large ship bases?
ZerothAngel  [author] 18 Aug, 2018 @ 12:11pm 
What sort of battery management features did you have in mind?

This script did used to have a battery management module, but with changes to the power API along with "smart" batteries (i.e. leaving all battery option unchecked), I decided to remove that module.

I haven't checked things lately though...
jackik 10 Aug, 2018 @ 3:55pm 
Have you thought about adding a battery-reactor management feature? That would make it perfect for me. Though i can always use another script in additon.
paulhamm 21 Jul, 2018 @ 7:46am 
I only tested the vent O2 system as that is all I am using atm.
paulhamm 21 Jul, 2018 @ 7:43am 
SubtypeName is depreciated the fix is to manually change Line 762 of the script.
change this
var subtypeName = item.Content.SubtypeName;
to this
var subtypeName = item.Content.SubtypeId.ToString();

and the script works.

There are several scripts that need this change.
Content.SubtypeName with Content.SubtypeId.ToString()