Space Engineers

Space Engineers

47 ratings
Block Naming Made Easy
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.719 KB
3 Feb, 2016 @ 4:23pm
14 Feb, 2017 @ 10:04am
4 Change Notes ( view )

Subscribe to download
Block Naming Made Easy

Description
This is a script to rename all of you ship's components. No longer will you have 4 thrusters numbered 5, 6 22 and 28. This will rename all elements, lets you select if you want to add a ship's name, lets you limit which grid the program runs on, and more.

Here is a full list of the variables you can edit and a basic description of each:
- addShipName: this setting lets you add a ship's name to the beginning of each item. Example: Enterprise - Large Thruster
- shipName: you can change the name of the ship, making it easier to tell your ships apart when connected.
- restrictToGrid: allows you to ONLY rename components which are part of an indicated grid. Extra step required, see instructions in code.
- numberBlocks: you can select if repeating items are numbered. Example: Small Thruster, Small Thruster 2 OR Small Thruster, Small Thruster.
- spacer: allows for you to change what comes between the shipName and the item's name. Example, ": " would yield Enterprise: Large Thruster.

Detailed instructions (and commenting) are included in the text of the code. As always, I have tested this code but I never know if a bug or two will slip through. If you find anything, leave me a comment so I can fix it for everyone. Thank you, and I hope you get as much use out of this as I intend to!

Please note, ownership of items will impact this script. Items all need to be set to "Nobody" or to yourself for this to work. Otherwise the programming block will not be able to edit the name of the block.

If you have more than 99 of a black type, you can change the number of leading 0s in the script. Search for "D2" in the script, that is how many digits it is using to format numbers. If you change it to "D3" it will do 002 instead of 02. My belief is most users will not have over 99 of a single type of part (even thrusters) but it is a very simple edit if that is the case. Sorry I am not currently able to make it automatically detect for this. If it is a feature you really would want, leave a comment and let me know.
36 Comments
Syhkane 4 Nov, 2021 @ 10:04pm 
OK not sure why this works at all, i literally spent 45 minutes just typing " 01" in places
but the bottom line (again i dont know what any of this means or does) i added + " 01" in that last bit and it renames all my blocks without numbers the way i wanted it to.

if (numberBlocks) {shipDictionary.Add(nameToWrite, 1);}
shipList .CustomName = nameToWrite + " 01";
Syhkane 4 Nov, 2021 @ 9:14pm 
what line is the exception I have to remove to rename the first item in a series 01? I dont know programing so I dont know how to identify it myself to remove it.
Atl3m 3 Feb, 2021 @ 6:24am 
is there a script naming a block using timer or button. like isys auto sorter you have the option to have locked in the connectors/container/blocks name to lock it from the script. i need a script that can toggle this name from connector to connector locked using timer/button/programblock
MrStump  [author] 16 Apr, 2020 @ 4:08am 
May be. Its very old and I haven't played Space Engineers since 1.0
troubled_offspring 15 Apr, 2020 @ 7:08pm 
is this broken? it does not appear to load into program blocks for me it always comes up blank
PyreStarite 27 Dec, 2018 @ 11:10pm 
Is it possible to implement custom names? Eg. Corner Light - Double to Double Corner Light or Hydrogen Thruster to Hydro Thruster or H Thruster.
MrStump  [author] 16 Dec, 2018 @ 6:44am 
Sorry, this is an old script and I haven't played in a while (waiting for survival rebalance). I used the old naming scheme from the game, which I think they updated. It is totally possible to call it Light 01, but I don't have the game installed to modify the code. If you poke around in it, you should see an exception I put in to AVOID numbering the first entry. Good luck
Dakroth 15 Dec, 2018 @ 2:49pm 
I was foing to ask the same thing as Extevious-V. Is that something that can be done, or are you only able to modify the numbering scheme for blocks that get numbered by default?
Extevious 10 Sep, 2018 @ 12:23am 
It should be renamed like this: Light 01, Light 02, Light 03, Light 04, etc.