Space Engineers

Space Engineers

Not enough ratings
Connector Occupation Status
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
358.850 KB
1 Jan, 2015 @ 8:56am
1 Change Note ( view )

Subscribe to download
Connector Occupation Status

Description
A simple script that will look through all connectors on the grid and set their name to "Occupied" or "Unoccupied", useful for finding a quick parking space on a busy station.

Best paired with the Show on HUD option on for connections and a timer block running the script in set intervals.
11 Comments
jarhead 26 Feb, 2015 @ 7:35pm 
is it possible to get this script to change the image on an lcd instead?

example you have "image 1" set for "unoccupied" and "image 2" for "occupied"

then you can have it done so the connectors are named "dock #" and the lcd that recieves dock statuse is named "lcd #" so it matches the dock it is for (this is just to start)

then later may be able to have another lcd setup so it will show list of docks and their status in text format so you can have a list of available docks (if you have more than 1 hanger then you can have "docks # - #" as the name so it only shows the status of the docks from # to # in the list).

# = the number of dock, lcd screen
Archaeopteryx 17 Feb, 2015 @ 6:28pm 
Hey guys, how do you write a script to disconnect a connector?
Nuros 1 Jan, 2015 @ 5:59pm 
I made a similiar script but i like to show only one connector on my HUD.
I think it´s to much at 3 connectors or more
and it don´t change your custom name of the connector, it only adds occupied/unoccupied at the end of it

http://steamproxy.net/sharedfiles/filedetails/?id=367187987
D_Sang 1 Jan, 2015 @ 2:54pm 
@Simon The links to pastebin is right idea ^^ Thanks i can be a dummie :/

@Wasp Thanks ^^ I made a another version because i think it's not necessary to show occupied connector and because i think erase the source name is a bad idea. It's here [pastebin.com]. But it's difficult to see what's is your code and what's is mine now :/
Simon 1 Jan, 2015 @ 12:16pm 
@_WASP_ well.. obviously but we all know about paste bin right?

http://pastebin.com/

This is the only sain way to share code ussually, because of formating issues within comment sections and descriptions.

Also i really don't feel like turning space engineers on, it heats up my pc, stops me from seeing youtube videos, negates my ability to google search.

Theres a reason that even KOS (KSP scripting mod) tells you to script out of game.
Simon 1 Jan, 2015 @ 12:06pm 
can you guys just post your code in the description it would seriously make this easier......
Chihayafuru  [author] 1 Jan, 2015 @ 11:49am 
@D_Sang That's actually a pretty good idea, mind if I add it to the source(with you cited obviously)
D_Sang 1 Jan, 2015 @ 11:15am 
I have modified your submission to shown automatically all connectors on HUD. Simply change the boolean to false to disable it.

bool forceShownOnHud=true;
void Main()
{
for (int i = 0; i < GridTerminalSystem.Blocks.Count; i++)
{
if(GridTerminalSystem.Blocks is IMyShipConnector)
{
if(((IMyShipConnector)GridTerminalSystem.Blocks ).IsLocked)
{
GridTerminalSystem.Blocks .SetCustomName("Occupied");
}
else
{
GridTerminalSystem.Blocks .SetCustomName("Unoccupied");
}
if(forceShownOnHud)
{
GridTerminalSystem.Blocks .RequestShowOnHUD(true);
}
}
}
}
Mazian 1 Jan, 2015 @ 9:17am 
PS, @WASP - you get a +1 from me on the script.
Mazian 1 Jan, 2015 @ 9:17am 
@Digi - no, not yet. http://steamproxy.net/sharedfiles/filedetails/?id=360966557 Can't detect cargo contents or %full state yet. Also can't move contents via scripting (a la automatic cargo sorting).

My wish is that the script was visible from the workshop, without having to load the game. It is, after all, just text.