Space Engineers

Space Engineers

Not enough ratings
Docking Detector Power Control
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
2.950 KB
5 Jul, 2019 @ 9:06am
17 Jul, 2019 @ 6:49pm
2 Change Notes ( view )

Subscribe to download
Docking Detector Power Control

Description
FIXES: Fixed missing status before docking and exiting control for the first time, fixed issue where script might ignore other connectors after one is connected.
In-game Script for Programmable Block.

This script can take control of batteries and hydrogen engines, to control their respective charge state and enabled state when docked to a pre-defined connector, and getting in and out of the main control cockpit/seat/remote control. It requires at least one control block set to Main.

Batteries that are switched off when the script is compiled/first run, will be ignored, this allows the inclusion of emergency batteries on the vehicle, that will not be controlled by this script.

Requires vehicle to be "undocked", and Hydrogen Engines to be enabled (if control is enabled for them in script) when script is first run if not docked

Control of Hydrogen Engines and Batteries, and the DOCK connector name can be set near the top of the script under the instructions.

If the grid loses power, the script/Programmable Block will need to be recompiled.

When set up correctly, you can dock up, jump out, and your batteries will be set to recharge and any hydrogen engines switched off. when you get back in, batteries are set back to auto and hydrogen engines get switched back on.

Important Wall of Text

When a connector on this vehicle is connected to the named connector below, it is considered DOCKED.
Connection to any other connector WILL NOT be considered DOCKED.

When DOCKED and the MAIN control block (cockpit/seat/remote control) is NOT CONTROLLED (no one in the seat or controlling the remote control), the batteries charge mode will be set to RECHARGE, and all Hydrogen Engines will be turned OFF so they will not supply power to the other grid.

When DOCKED and the MAIN control block (cockpit/seat/remote control) is CONTROLLED (someone in the seat or controlling the remote control) the batteries charge mode will be set back to AUTO, and all Hydrogen Engines will be turned ON.
As this script turns the Hydrogen Engines off once docked, and back on while still docked, this can be used with a vehicle that is powered ONLY by Hydrogen Engines.
3 Comments
Nikolas March  [author] 17 Jul, 2019 @ 3:13pm 
code seems like it should do as i mentioned :)
Nikolas March  [author] 17 Jul, 2019 @ 2:50pm 
it should do those too, a modded engine that is a power generator from gas has to have the TypeID as a "HydrogenEngine" for it to work. i will have a quick look over the code though to make sure
unlucky lucksman sniper 16 Jul, 2019 @ 9:39pm 
can you change it to turn on and off other types of engines?