Space Engineers

Space Engineers

Not enough ratings
Drone/Utility Ship Manager
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
17.994 KB
25 Jun, 2015 @ 6:48pm
18 Mar, 2018 @ 10:02pm
17 Change Notes ( view )

Subscribe to download
Drone/Utility 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.

ZerothAngel's Drone/Utility Ship Manager (formerly Drone Controller)

This is the script I mainly use in my drones and other small/utility ships (i.e. ones that dock with a mothership). Whether the ship is remote-controlled or manned, this script should be of some use.

Features
  • A docking manager to enable/disable certain blocks upon docking or undocking.

  • A "safe mode" module that tries its best to prevent your ship from flying away unattended. This includes getting disconnected while inertia dampeners are disabled or leaving the ship/drone uncontrolled after some time (i.e. a dead man's switch).

  • A simple battery monitor that starts a timer block when the average charge level of all on-board batteries falls below a certain percent.

  • A smart undock module for semi-automated docking and undocking from a carrier/mobile mothership. (It's really simple, don't get your hopes up. ;)

  • A redundancy manager to ensure that a certain number of blocks in a block group are enabled at all times.
Setup

Required: Programmable block. To use additional features, up to 2 more timer blocks will be needed.
  1. By default, the script will only touch blocks on the same grid as the programmable block. For most uses, this is all you need and you can skip to step 2.

    However, if you have things that need to remain off while undocking (such as overridden thrusters for mining), you should create an explicit group. Select everything except for blocks that shoudn't be touched and create a group.

  2. Load script into programmable block. If you created a group, set the SHIP_NAME variable to the group's name.
Docking Manager feature

See this post.

Safe Mode feature

See this post.

Low Battery feature

Once the total remaining charge of all batteries on the drone drop below 20%, the script will "start" a timer block named "Low Battery".

The timer block is only started the first time the average battery charge falls below 20%. The battery monitor will reset itself if/once the average charge rises above 20%.

Smart Undock feature

See this post.

Redundancy Manager feature

See this post.

Configuration

There's a bunch of constants near the top of the script, feel free to change them. You can change things like the names of the special timer blocks and/or other special values/flags.

Source

For the bleeding edge, as well as a more readable and modular version of the script, go see GitHub[github.com]. I usually only update the workshop version when things break or major features are added.
6 Comments
richard.e.jenkins 8 Jun, 2017 @ 2:52pm 
Thanks for writing code. I love scripts, but can't code for crap. lol
ZerothAngel  [author] 10 Nov, 2016 @ 7:11pm 
They're just warnings, it's fine. It's because some script options are disabled.
pro100tv 10 Nov, 2016 @ 3:03pm 
I got error message while i`m trying to check the script:

Program(1366 ,21): Warning: Unreachable code detected
Program(1366 ,132): Warning: Unreachable code detected

I am playing in dev version
Raloris 6 Oct, 2016 @ 7:56am 
That's it, ya. Current build, so I would assume stable. I probably just didn't rename the timer block, in all fairness.
ZerothAngel  [author] 5 Oct, 2016 @ 8:21pm 
Are those the only messages? Warnings should be fine, the "unreachable code" is because there are features disabled in the script (namely TOUCH_LANTENNA and TOUCH_BEACON).

If there are no errors, then it should be running fine and I would look at the timer block.

Also, is this dev or stable?
Raloris 5 Oct, 2016 @ 2:57pm 
Getting "Program(1333, 26): Warning: Unreachable Code Detected" and "Program(1333,132): Warning: Unreachable Code Detected" when checking code in the programmable block, and it is unable to run. Any advice?