Space Engineers

Space Engineers

Stu's Connector Docking Status
9 条留言
Stollie 2024 年 1 月 12 日 下午 6:28 
Hey mate,

Added some more :D

I use Spug's docking script so renaming the connectors breaks things for me.

bool FEATURE_RENAME_CONNECTORS = false; // Set to false to disable the connector renaming feature

void setName(IMyShipConnector connector, String status)
{

// Check if the feature is enabled before updating connector names
if (!FEATURE_RENAME_CONNECTORS)
return;

String name = getStrippedName(connector);
if (status != "")
{
name = name + " - " + status;
}
connector.CustomName = name;
}
StubieDubie  [作者] 2023 年 12 月 22 日 下午 7:28 
@Stollie Good idea. I added it and credited you.
Stollie 2023 年 12 月 22 日 上午 6:41 
Hey mate, I wanted the connectors sorted aphabetically so I updated the code to do this: -

//
// Find all connectors containing the text defined in CONNECTOR_BASE_NAME
//
List<IMyTerminalBlock> connectorBlockList = new List<IMyTerminalBlock>();
GridTerminalSystem.SearchBlocksOfName(CONNECTOR_BASE_NAME, connectorBlockList, b => b is IMyShipConnector && b.IsSameConstructAs(Me));
_connectorList.Clear();

// Sort connectors alphabetically by name
connectorBlockList.Sort((a, b) => string.Compare(a.CustomName, b.CustomName, StringComparison.OrdinalIgnoreCase));

foreach(var block in connectorBlockList)
{
IMyShipConnector connector = block as IMyShipConnector;
_connectorList.Add(connector);
}
Echo(String.Format("Found {0} connectors", _connectorList.Count()));
StubieDubie  [作者] 2023 年 4 月 27 日 下午 6:56 
Cheers!
Bednar12 2023 年 4 月 27 日 下午 12:15 
It works on the newest Automatons update (as of 27.04.2023)

THANK YOU GOOD SIR!

(also, Event Controller = dogshite, wasted 5hrs on trying to make the connector lights work, then gave up and looked for a script, and whaddya know, it exists, and is a thousand times better and easier to use than the Event Controller)
StubieDubie  [作者] 2023 年 3 月 20 日 上午 10:48 
<bows in gratitude>
Doruaraebe_ 2023 年 3 月 20 日 上午 8:00 
Absolutely amazing script. Nice and simple, definitely worth it if it's what your looking for :steamhappy:
StubieDubie  [作者] 2022 年 10 月 18 日 下午 3:41 
Glad to help!
♥♥♥♥♥♥♥♥ Prime 2022 年 10 月 16 日 上午 6:47 
If everything is setup correctly, it's one of the best docking status scripts out there. Thank you so much for updating this gem!