Space Engineers

Space Engineers

Drone/Utility Ship Manager
This topic has been locked
ZerothAngel  [developer] 8 Feb, 2016 @ 11:30am
Safe Mode
The Safe Mode feature is a module that primarily ensures the ship doesn't fly off unattended.

Firstly, if the pilot is ever disconnected (either an on-board pilot or a remote pilot) and inertia dampeners are disengaged, it will re-engage dampeners. Then it will perform the "Safe Mode sequence" (described below).

If the abandonment feature is enabled, and a pilot has not touched the ship after some configurable amount of time (again, either sat in a cockpit/station or taken remote control), the Safe Mode sequence is started.

Lastly, if it ever detects that there are no longer any functional ship controller blocks (cockpits, stations, remotes) on the ship (e.g. because of damage), it will perform the Safe Mode sequence.

Safe Mode sequence

The Safe Mode sequence starts with "starting" an optional timer block specifically named "Safe Mode"

This timer block can do whatever you want, but it should do anything necessary to ensure the ship doesn't fly off, such as disabling gravity drives or turning off cruise control.

After 1 second of triggering the "Safe Mode" timer block (whether the block was actually present or not), the script will analyze the current state of thrusters and ascertain whether the ship can actually stop.

First it will look for enabled non-overridden thrusters on each facing. Any overridden thrusters will be turned off (to preserve your override setting).

If a facing lacks thrusters, it will zero-out the override on any overidden thrusters and enable any disabled thrusters.

If a facing still lacks thrusters (i.e. it has no thrusters or nothing but damaged thrusters), the script will perform an emergency stop maneuver.

Emergency Stop maneuver

The "Emergency Stop maneuver" is performed if the ship is still moving.

First, the script will disable all thrusters (to prevent dampeners from altering the current trajectory).

Then it will pick the first functioning facing: rear, forward, bottom, left, right, top. It will then re-orient the ship to put that facing against the current direction of motion.

Finally, it will re-enable thrusters and let the dampeners slow the ship down and hopefully, bring it to a halt.
Last edited by ZerothAngel; 14 Feb, 2016 @ 2:32am