Space Engineers

Space Engineers

56 ratings
Connector Docking Status 1.5.3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
10.108 KB
17 Apr, 2015 @ 4:55am
15 Aug, 2020 @ 9:00am
13 Change Notes ( view )

Subscribe to download
Connector Docking Status 1.5.3

Description
Link to script[gist.github.com]


This is a script that sets the name of connectors according to the status, if they are occupied, unoccupied or disabled.
It can also change lights color and trigger timers depending on the status.
The script is based upon the usage of prefixes in the beginning of the block names to distinguish blocks from other ships/stations.
With the timer feature you can automate some docking/undocking stuff. eg locking/unlocking large landing gears holding your small ship onto a station/large ship

Images in description by Riverey

Example World:
Link



-- Show on hud (configurable, default is only when unoccupied)
! Currently not working due to game changes

-- Lights. Different color depending on status.
Unoccupied: Green
In Proximity: Yellow
Connected: Red
Disabled: Cyan (Option to turn the lights of if connector is disabled)
If you want to change colors you need to change them in the getColors method inside the script.
The programmable block didn't like it when I tried putting those arrays in the beginning.
Lights should have the same name as the connector but have the word "Light" at the end. (Configurable)
(You can also put other stuff after that if you want e.g. numbers)
All lights should work as long as they implements the "IMyLightingBlock" class. (Only interior lights tested)

-- LCD screens. Displays all connectors and their status.
Default name is "[Prefix] Connector LCD" (configurable, can put other stuff behind the name e.g. numbers)

-- Timer blocks. Timer blocks can be triggered upon status changes.
Name the timer block "CONNECTORNAME Timer STATUS"
Eg if you have a connector named "[Station] Connector 1 - STATUS" and name the timer block
"[Station] Connector 1 Timer Connected" it will trigger when you lock the connector.



Basic usage:
Option 1: (Does NOT require script editing)
1) Load the script into a programmable block.
2) Build an lcd and name it "PREFIX Connector LCD", one for each prefix you are using on the ship/station.
PREFIX should be the same as your prefix on the connectors.

Option 2: (Does require script editing)
1) Load the script into a programmable block.
2) Edit the PREFIXES list to include all the prefixes you are using on the ship/station.

Advanced usage:
(Optional, Require script editing)
1) Follow one of the options in basic usage
2) Edit the variables before the main method to suit your need.




(No script editing required in this case)
LCD: [Station] Connector LCD

Connector: [Station] Connector 1
Light: [Station] Connector 1 Light 1
Light: [Station] Connector 1 Light 2
Timer Block: [Station] Connector 1 Timer Connected
(Will trigger when Connector 1 is connected)
Timer Block: [Station] Connector 1 Timer Unoccupied
(Will trigger when Connector 1 becomes unoccupied)

Connector: [Station] Connector 2
Light: [Station] Connector 2 Light 1
Light: [Station] Connector 2 Light 2
Timer Block: [Station] Connector 2 Timer Connected
(Will trigger when Connector 2 is connected)
Timer Block: [Station] Connector 2 Timer Unoccupied
(Will trigger when Connector 2 becomes unoccupied)

Connector: [Station] Connector 3
Light: [Station] Connector 3 Light 1
Light: [Station] Connector 3 Light 2
Timer Block: [Station] Connector 3 Timer Connected
(Will trigger when Connector 3 is connected)
Timer Block: [Station] Connector 3 Timer Unoccupied
(Will trigger when Connector 3 becomes unoccupied)




* Version 1.5.3 - 15-08-2020
No longer needs a timer block to run

* Version 1.5.2 - 29-10-2015
Fixed errors.
Due to changes in the game, the way I changed the show on hud setting no longer work.

* Version 1.5.1 - 24-05-2015
Changed the name of the locked status to connected. (You can change back in the script if you want to)
Display some information in the programmable block.
Minor code changes.

* Version 1.5 - 23-05-2015
No need for language specific code anymore :)
You can now use both manual and automatic prefixes

* Older version history

Known Issues
*When the script first tries to append the status string to connectors it will remove the last character in the original
name.
Eg: Connector named "[Station] Connector 4" will become "[Station] Connector - Unoccupied"

* The list of prefixes in the programmable block control panel might not show up immediately
38 Comments
TekLest 16 Jun @ 3:41am 
script dont work getting a IMyTextPanel error maybe needs an update
Really like this script not played i a while but would love to have it work again
Captain Stubing 29 Jan, 2022 @ 7:46pm 
Great, thanks, my guilt is assuaged :) Thanks for doing the original.
Alton Vëonion  [author] 29 Jan, 2022 @ 4:55pm 
@Captain Stubing
That's ok, I rarlely play SE at the moment
Captain Stubing 22 Jan, 2022 @ 10:36pm 
@Alton I have published an update based on this script here . It updates the deprecated calls to get rid of the warnings and has other streamlining changes but the original idea/general-program-structure remains yours. I have credited and linked this script, but if you object I will take it down. Please let me know.
Alton Vëonion  [author] 8 Aug, 2020 @ 9:24am 
Sorry for the absence. It's been a long time since I played SE.
The script still works for me on version 1.196.012 without any changes.

You can test it out on this world
https://steamproxy.net/sharedfiles/filedetails/?id=2191288855
Tiger 19 Jan, 2020 @ 1:22am 
Completely broken in the current game version. Please rewrite/update.
MickeyTJR 6 May, 2017 @ 2:03pm 
The lights work, go back and check what you named the connector, when you first connect to a connector after starting this script it changes the name to - connected.
In my case, I had mine named Connector Wall 1 and it renamed the connector Connector Wall - Connected. So I changed the name to Connector 1 Wall and it works fine now.
Rusted Droid 12 Apr, 2017 @ 2:48pm 
Really nice work. Can you make extra script that user can chose actions based on status? Example i have ship and stroage boxes with batteries that are like module connected. Sometimes they lost connection durring filght and those boxes fall sometimes they survive but i cant find them always (in space). So after disconnection can your script enable beacon on that storage box powered grid?
coolfarmer 22 Jan, 2017 @ 8:50pm 
Samething here, all work good but light's doesn't! :( Someone can update the light's part of that scirpt?
Trozzo 5 Nov, 2016 @ 8:48am 
Hello I'm on the latest version of the develop branch (1.160), the script works but light's doesn't change color. The LCD monitor display and update exactly what's going on, but light's doesn't change from it's standard white.