Space Engineers

Space Engineers

Isy's Block Renaming Script
185 Comments
azfalt 13 Oct, 2024 @ 2:57pm 
Would have been nice with a warning before using this, like: "don't use this script if your grid and subgrids exedes ex amount of blocks in use."

Making this script useless imo.
BooseOG 28 Sep, 2024 @ 11:02am 
I don;t know if its possible as a feature but would it ne possible to add a command that added a prefix that you can set to all block in the grid?

So if I build a ship it can easily be identified when docking.
Isy  [author] 24 Jul, 2024 @ 10:20pm 
To conclude: it's complicated ;)
Isy  [author] 24 Jul, 2024 @ 10:20pm 
Sort by location isn't a trivial thing. The way, my script sorts blocks is by using the game's block getter, that spits out lists of blocks. The way, these are ordered doesn't have anything to do with the order, the objects were built. When building in SE, everything gets assigned a random number blockID and on script level, I get lists sorted by this blockID. Here an oversimplified example:

Refinery 1 gets blockID: 28
Refinery 2 gets 76
Refinery 3 gets 17

My script will now get the list of refineries in the order:
Refinery 3, Refinery 1, Refinery 2

And will rename them like that:
Refinery 3 -> Refinery 1
Refinery 1 -> Refinery 2
Refinery 2 -> Refinery 3

The only thing I could do to avoid that, would be a world position distance calculation, which would be very slow and ressource heavy and would also probably spit out wrong results because the distance would be calculated in a circle around a starting block - for example the programmable block running the script.
sportplusmode 22 Jul, 2024 @ 9:19pm 
Hey Isy, another lover of your (multiple) SE scripts here. Question here.

Like user @Merii inquired on 09-27-23: The ability to autosort number by block location on the grid (like top-to-bottom, left-to-right), which could be very helpful to speed repairs by location, I know you have not implemented this feature.

However. As a good-enough workaround, I'm trying to see if there's an option in the script to autosort number by *existing* block number. In other words, an option for the script that would sort blocks 3, 7, and 20 as 1, 2, and 3, specifically in that same ascending order (but now also contiguous).

This solution would solve the bigger problem of numbering "by location" because users could just re-add blocks in Creative in the right order, existing numbering regardless. Then run the script with this option enabled. That make sense? If so, do you know if there's an option in the existing script to handle such a flag? I'm still trying to tell from the documentation.
Katarina [WolfCraft Industries] 13 Jul, 2024 @ 7:04am 
there is a way to reset all names to their default name. for that read the guide, section > default name
TK_Over50 13 Jul, 2024 @ 6:42am 
This is cool, but I need something to translate+rename the blocks from Russian to English. Is this capable of that, or do you know of something that is?
kinngrimm 6 Feb, 2024 @ 5:35pm 
the nomenclature of the syntax in the pictures on top seems not the same as what is described in the guide and used in the script, maybe from an older version
Isy  [author] 19 Nov, 2023 @ 6:34pm 
You're welcome :P
bobblehead 19 Nov, 2023 @ 4:32pm 
@Isy Thank you, that is much clearer for me to understand. I really appreciate your taking the time to dumb this down for me. As I've said before, this script is awesome. Now that I have a better idea how to use it, it will indeed save me a huge amount of headaches. Thank you again.
Isy  [author] 19 Nov, 2023 @ 3:01pm 
Also, regarding your hangar door problem, you could create temporary groups as well and use them in the rename command:

rename,OLDNAME,NEWNAME[,FILTER][,GRID]

To only affect the group, use:

rename,Warfare Hangar Door,Inner Wall Hangar Door,G:Inner Wall Hangar Doors

(this implies, that you grouped all inner wall hangar doors in the mentioned group: Inner Wall Hangar Doors - maybe just temporary for the rename to go through)

Parameters can also be skipped with the asterisc symbol * to affect all blocks that match the FILTER, in this case the group:

rename,*,Inner Wall Hangar Door,G:Inner Wall Hangar Doors

And to sort them right away, use the !sort modifier directly:

rename,*,Inner Wall Hangar Door,G:Inner Wall Hangar Doors,!sort
Isy  [author] 19 Nov, 2023 @ 2:52pm 
The command should be:

addfront,your prefix,Camera,First word of Grid

The "G:" modifier is a group modifier used in the [FILTER] part of addfront:

addfront,STRING[,FILTER][,GRID]

For example if you have a group of cameras:

addfront,your prefix,G:My Camera Group,First word of Grid
bobblehead 18 Nov, 2023 @ 9:50pm 
Sorry to be a bother. This argument: addfront,texttoadd,partialblockname,G:partialgridname,!test
where "texttoadd" = my prefix, "partialblockname" = Camera, and "partialgridname" = just the first word in the current Grid Name, doesn't seem to do anything, at all. Not even an error. Just gives me a blank area where the instructions or renamed report would otherwise show up. Also, if I leave off the "!test" and take the risk, it still doesn't seem to do anything. Nothing gets added to any of the block names and nothing at all ever shows up in the PB's text area. If I remove the argument and hit "run" again then your instructions show up again just fine.

I'm sure it's just me, kinda tend to break things I use it seems. This comment was mainly just me thinking out loud while typing. Again, sorry for the bother.
bobblehead 18 Nov, 2023 @ 9:19pm 
It became complicated. I even tried renaming one block at a time by simply putting an extra character in the name of each block for one of the sets so I could simply rename that group with the longer name change using the script, however because all the blocks still had "Warfare" in the name the script renamed ALL the blocks with the new name I selected - even though I put this in as my argument: "rename,iWarfare Hangar Door,Innerwall Hangar Door" (did this without quotes) notice the single character "i" at the beginning? Even so the script renamed ALL blocks containing "Warfare Hangar Door" with the new name as if they were all the same before. It seemed to discard the extra character I had manually placed before each of the blocks I wanted to provide a range for.

Even so, I was able to work around it and am extremely happy with this script because it does a great job for what it was designed to do so many thanks to Isy for another great script!
bobblehead 18 Nov, 2023 @ 9:19pm 
Love this script, though it has it's limits (unless I'm missing something). I just went through a very long "rename" session the other night and started looking for something to would make this soooo much easier to do - This script is (almost) exactly what I was looking for! AWESOME! One limitation (again, unless I've missed something) is not being able to select a specific range of blocks on a single grid. What I mean: I have two area's on my base with a set of Warefare Hangar Doors. Each set contains about 26 blocks (number of doors to make up the set divided by 2, that is 13 door blocks on each side of the opening to make the "Hangar Door" the size I need it to be. I wanted to rename the set on the outside of my base something like "Outerwall Hangar Door" and the inner set (on another wall of my base deeper inside) "Innerwall Hangar Door" however since I am not able to define a specific range of blocks (all of these are on the same grid)
Merii 27 Sep, 2023 @ 3:08pm 
I would love that, thank you! I use this script on every build I do, thanks so much for it.
Isy  [author] 27 Sep, 2023 @ 1:48pm 
That is definitely possible but the script is currently not able to do that.. I'll note that down to maybe implement it in a future update.
Merii 27 Sep, 2023 @ 11:28am 
Is there a way or a script to rename by position on the grid? I'd love to start numbering from the front-top-left-most of an item (e.g. a battery) and have the highest number be the rear-bottom-right-most item - it helps a ton with damage control and replacement of blocks.
-------------- 2 Sep, 2023 @ 4:14am 
You have the best scripts! Love it. Especially inventory manager.
Isy  [author] 8 May, 2023 @ 3:55pm 
Thank you - I'm glad you like it!
Cantos 6 May, 2023 @ 6:41am 
Absolutely insane, thank you to heaven. This just needs to be a default feature.
Tidauph 22 Oct, 2022 @ 3:47am 
Ok thank you Isy for these explanations.. I'll try that !
Digital_Samurai 20 Sep, 2022 @ 11:05am 
Thanks Isy.
Isy  [author] 19 Sep, 2022 @ 11:08pm 
Theoretically yes, but it's still tedious.. You'd have to rename each block(-group) individually.. For example:

rename,Refinery,Raffinerie
rename,Thruster,Schubdüse
...

(english to german)
Digital_Samurai 19 Sep, 2022 @ 9:55am 
Can this rename from one language to another?
Isy  [author] 14 Sep, 2022 @ 1:03am 
Already implemented:

addfront,|Base|

Or if you want to target a specific grid:

addfront,|Base|,*,Large Grid 12345

See guide topic "Add string" for more informations:

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2066808115#3535533
Tidauph 10 Sep, 2022 @ 5:00am 
Hello,
Thank you for your scripts they are very interesting...
For this script which renames the blocks, have you planned to be able to add a prefix for all the blocks of the same grid?
Let me explain: In fact, to distinguish my blocks in the different grids, I like to put an identical prefix in front of the name for each grid. Example: |Base|Rotor, |Base|Connector, |Jet|Connector, etc...

Thank you and good luck for the future ;)
Isy  [author] 10 Jun, 2022 @ 7:56am 
No
TuxRiley 9 Jun, 2022 @ 2:39pm 
who can i chance German ?
Isy  [author] 12 May, 2022 @ 2:01am 
Does work!
Miguel-Gunther 10 May, 2022 @ 2:24pm 
Does'nt work, need update
Isy  [author] 20 Feb, 2022 @ 12:27pm 
Update!
Version 1.6.3:

- Fixed: The deletedata no longer requires 3 parameters. This was an oversight and was pointed out by BoompaBlubbah ( https://steamhost.cn/steamcommunity_com/profiles/76561198168517424 ) - thanks buddy!
BoompaBlubbah 7 Feb, 2022 @ 4:26am 
Nice :)
Isy  [author] 7 Feb, 2022 @ 2:11am 
Oh whoopsie.. That must be an error in the required parameter count.. Maybe from lazy copying and pasting^^ I'll have a look at that!
BoompaBlubbah 5 Feb, 2022 @ 3:22pm 
Hello Isy, just wanted to let you know I am always using your scripts, they are awesome af! :D
Only little thing I wanted to make u aware of is that the delete customdata field function isn't functioning, or isn't functioning in the way all other functions are functioning (ok I actually managed to use ... nevermind). I give: deletedata,G:NAME but it will keep giving back that the command requires an additional parameter :|
Isy  [author] 1 Feb, 2022 @ 2:18am 
From the guide (big button above):

Remove a string from your blocknames.

remove,STRING[,FILTER][,GRID]

FILTER is optional and filters the possible blocks! All connected blocks that match STRING are renamed if it's missing!
Learn more about filters in the guide topic Filters

GRID is optional and filters the grid, blocks can be found! Partial gridnames are enabled, e.g.: 'Isy' will find 'Isy's welder ship'. All connected grids are searched if it's missing!

Hint: To skip parameters, use asterisk *
EDDO84 29 Jan, 2022 @ 5:04pm 
@Isy I would like to know if there is an option to remove a partiall bit of the name... sort of like you did with addfront,STRING[,FILTER][,GRID] only then remove the thing i added with this command. Greetings!

p.s. Nice set of script by the way specially the inventory one :)
EDDO84 29 Jan, 2022 @ 5:01pm 
@Parachuu No this is not caused by this script this is due to your gyro, it places it so you can move your ship with your mouse around etc.
Parachuu 28 Jan, 2022 @ 9:08am 
Can't seem to wrap my head around this, but every now and then all of my thrusters get text added to their names with the direction they are pointing.. I can't figure out if its this script causing it or what, but after leaving the terminal and coming back it's all gone. The text that shows up is in [Brackets] and not actually shown in the terminal for the block, only when looking at the list of blocks on the right hand side. been trying to duplicate this for the past hour and its not happening now.

Thanks!
tubular 6 Dec, 2021 @ 10:51pm 
@LT, nope, groups can't be renamed :/ Bug keen about it
Deadmeat 6 Dec, 2021 @ 10:49pm 
I am trying to rename "Block groups" that are found in the control panel, the scrip renames the blocks with no problems, and works great, but it does not seem to do the block groups. The block groups all start with a "*" and with "*" , Is there a command to do this, I have 25 block groups I want to change the string on the front ?

Thanks for any help
van Grunz 20 Oct, 2021 @ 1:55am 
DasPandaSyndikat XD Stelle mir gerade C64's BASIC auf deutsch vor...
Isy  [author] 20 Oct, 2021 @ 1:12am 
And guess what? That's on purpose.. In fact, I am german but in order to create scripts, that many people can understand, I write them in english.. And I know for a fact, that we learn english in german schools, so understanding the instructions shouldn't be too difficult..

Also: you write your question in english and your name is "ThePandaNetwork", so you're clearly able to at least read and write in english - should be enough for this script.. Otherwise, you should name yourself DasPandaNetzwerk :P
TuxRiley 19 Oct, 2021 @ 10:33am 
there is a chance that it will be translated into german ?

all scripts are always english
Stargateur 8 Jul, 2021 @ 2:06am 
a missed opportunity to fix the start by 1 indexing, I would like the index start at 0 and this would be perfect
Schmetterling 10 Mar, 2021 @ 1:19am 
Прекрасный скрипт, теперь постоянно им пользуюсь. Раньше приходилось все делать руками, это *** (не переводимая национальная игра слов). Благодарю вас, скрипт заслужил подписку и лайк на 100%.

Nice script, now I use it all the time. Previously, you had to do everything with your hands, this is :?"%;?% (non-translatable national pun). Thank you, the script has earned a 100% subscription and like.
(sorry for the translation, google)
Isy  [author] 26 Jan, 2021 @ 3:37pm 
Update!
Version 1.6.2:

- Added/Changed: The gridfilter was added to all available commands and also the existing syntax was unified. (this was suggested by voidpointer)
- Changed: The addfront and addback commands won't add another string if the string already exists. (this was also suggested by voidpointer)
- Fixed: Autosort, regular sort and remove numbers sometimes replaced the wrong number of the block name. This is now fixed. (thx to Tubular for reporting this issue)
- Removed: The addfrontgrid and addbackgrid commands were removed because they were redundand due to the recent changes.
- The steam workshop guide was updated to the newest changes.
Isy  [author] 26 May, 2020 @ 10:35pm 
It doesn't rename groups.. But that could be easily done by selecting a group, saving it under a new name and delete the old group..
Prawn Broth 21 May, 2020 @ 9:19pm 
Hi! Does this script work for renaming groups as well? I love it already but this would put me over the moon :)
tubular 27 Apr, 2020 @ 2:02pm 
<3