Space Engineers

Space Engineers

Whip's Block Renamer
201 Comments
FarNiche 1 Aug @ 6:30pm 
Finally got it to work...
The Block Group is named:
replace "FNAD" with "FNAD-0"
which contains the Control Panel Grid blocks that were selected to make up that group.
Then:
Run the PB with the Argument using the same name AS the block group, i.e.:
replace "FNAD" with "FNAD-0"
Result: the phrase in the first quote is replaced with the phrase in the second quote.
Very nice, thank you. It makes a carrier of Attack Drones easily distinguishable from one another.
Whiplash141  [author] 6 Jan @ 7:12pm 
Read the description above @Duke3D
Duke3D 6 Jan @ 6:10pm 
who work ? pls a example
SioxerNikita 1 Nov, 2024 @ 4:58pm 
As long as it just numbers them appropriately, I wouldn't even mind not having a "direction" parameter, and instead your script just arbitrarily uses a default direction.
Whiplash141  [author] 1 Nov, 2024 @ 4:22pm 
That is non trivial to do because a players conception of direction is entirely arbitrary.
SioxerNikita 31 Oct, 2024 @ 10:16am 
There is actually one feature I noticed missing for arrays of stuff. Walls of welders, grinders, etc.

Could be nice to have where if you have the group, it'll choose one corner as offset (perhaps with a modifier to choose which, like T/BL/RF/B (Top/Bottom, Left/Right, Front/Back ex. TLF for top left front) start that block as 00 (or what ever leading zeroes) and then if all the blocks are in a single plane, it just starts naming them 00 to Whatever based on the offset from the first "origin" block, and if there is 2D plane of them, they'll be named based on offset in 2D (00-00->00-01->01-00->01-01) and in 3D, add one more. If there is multiple blocks in between, it'll just "skip" the numbers, so if I had arranged like
X0X
XXX
X0X (Xs being my renamed blocks)

They'd be named, if I start top left, they'd be named:
0-0, 0-1, 0-2
1-0, , 1-2
2-0, 2-1, 2-2

Orientation could be based on main cockpit.

This one feels like it has genuine use cases outside of preference
Whiplash141  [author] 25 Oct, 2024 @ 6:37pm 
"Would be nice to number blocks"
It does. You can configure that in custom data
Into 25 Oct, 2024 @ 5:22am 
Would be nice to number blocks
StikShift4Life 10 Sep, 2024 @ 1:07am 
Could you add a feature to append a number sequentially in hexadecimal?
Whiplash141  [author] 18 Dec, 2023 @ 6:10pm 
@Brusura:

It's because I was dumb and wasn't reading config when prefixing with a custom prefix and not default or grid name. Fixed in v7.1.2, thanks for the report.
Caspatio 18 Dec, 2023 @ 5:35pm 
Step 2 isn't clear.
"2.Group blocks that you want to rename with the GROUP RENAME TAGS in the section below"
Where exactly? How?
Provide an example of a working model.
Brusura 18 Dec, 2023 @ 2:07pm 
Hi, I did set no space in the custom data, recompiled but when I do prefix myprefix it keeps adding space, what am I doing wrong?
DarkShadow 2 Aug, 2023 @ 2:58pm 
Works like a charm on pc! Was searching for sth like this, thank you very much
Whiplash141  [author] 1 Aug, 2023 @ 12:20pm 
if you prefix or suffix name blocks with grid names before you merge, those names will persist
Arlan_77 1 Aug, 2023 @ 12:00pm 
can this keep the name of your grid after merging with another grid?
Whiplash141  [author] 23 May, 2023 @ 6:23pm 
"DOES not work after PS4 update"

It absolutely does still work.
SugerGlider 22 May, 2023 @ 8:36am 
DOES not work after PS4 update
AwesomeCronk 27 Mar, 2023 @ 5:14am 
Ok, thanks
Whiplash141  [author] 6 Mar, 2023 @ 10:34am 
Not possible via the programmable block
AwesomeCronk 6 Mar, 2023 @ 9:16am 
Does this support renaming groups?
OneGreyWolfe 20 Feb, 2023 @ 8:59pm 
Thank you for the speedy reply! That is exactly what I intend. As I add a car to the consist of the train/spaceship rename it based on its location in the vehicle to keep track of what is where to make inventory management easier.
Whiplash141  [author] 20 Feb, 2023 @ 7:36pm 
if "Car 8" is the grid name, then "grid prefix" will do that yeah
OneGreyWolfe 20 Feb, 2023 @ 5:53pm 
I am designing a modular hauler (think container ship) that I hope this will help with. Am I understanding correctly that running this would allow me to rename all the components on a given subgrid to identify them (ex: "Oxygen Tank L1" becoming "Car 8 - Oxygen Tank L1")
kinngrimm 19 Feb, 2023 @ 1:59pm 
Hi there, i was looking for this, just one more feature =) if you would look into if this could be made usable by the plugin loader. There is one script which does this similarly and is in the plugin loader just without the counter which would be the cream on top the cake.
Whiplash141  [author] 6 Jan, 2023 @ 3:47pm 
big oof dude lol
Bentayga 5 Jan, 2023 @ 5:19pm 
I just finished renaming every single light and button on my 220k PCU space station.

Right after that, of course, I find this.
Veni Vidi Vpici 5 Nov, 2022 @ 5:38am 
Why after two days Im reading it as it is. My bad, it is about lists under 10, yeah.
Whiplash141  [author] 4 Nov, 2022 @ 11:05pm 
I literally already prefix 2 as 02.if there are 10 or more blocks of that type. If there are 100 or more, 2 becomes 002. If there are 1000, 2 becomes 0002.
Veni Vidi Vpici 4 Nov, 2022 @ 1:00pm 
It might be worth mentioning in the possibility somewhere as it makes the numbers less of a pain to find your drill #2
Veni Vidi Vpici 4 Nov, 2022 @ 12:58pm 
@Whiplash141 it is a big difference tho, since the game can't handle it's own numbering and sorts numbers from first number, instead from last.
Whiplash141  [author] 4 Nov, 2022 @ 12:52pm 
By default, if you have more than 2 digits, single digit numbers will already be automatically prefixed with a zero. The below suggested change would enforce that 2 digits are always written at minimum. I'm not the biggest fan of that because it is kinda arbitrary.
Veni Vidi Vpici 4 Nov, 2022 @ 5:33am 
@Vrayl actually I love that change, I will do that to mine too, because I HATE LOOKING FOR NUMBER 3 BETWEEN 20s and 30s!
Vrayl 26 Oct, 2022 @ 8:42pm 
Hey Whip, just started using this script. Love it! Thank you!

I made one change so that I could have preceding zeros on lists shorter than 10. If you like, maybe make this a config option? I did this because of those lists shorter than 10 it would number then 1, 2, 3 instead of 01, 02, 03 and it mixed them up in other lists like 08, 09, 1, 10, 11, etc. Yep, I got OCD! lol


string GetNumberFormat(int number)
{
string numStr = number.ToString();
int length = numStr.Length;
if (length < 2)
length = 2;

return new string('0', length);
}
jaknivek 19 Oct, 2022 @ 6:58pm 
I got it to work now thank you very much
Whiplash141  [author] 19 Oct, 2022 @ 9:31am 
prefixing group naming should look like the following:

prefix My Cool Prefix

The above would prefix all blocks in that group with that prefix
jaknivek 19 Oct, 2022 @ 6:34am 
thank you, yes scripts are enabled i have other scripts running i am definitely missing something im trying to put a prefix on all the blocks on a grid i have created a group containing all the blocks i want to put a prefix on, and i put the prefix name between the <> in the (prefix<desired prefix>) is this correct and what is the next step can you help me? where do i put the group name that i want to add the prefix too?
Whiplash141  [author] 18 Oct, 2022 @ 10:43am 
It is not broken.

Make sure you have scripts enabled on world settings
jaknivek 18 Oct, 2022 @ 8:54am 
Help i used to use this script and never had any trouble with it now it does nothing, ive tried everything i can think of and it just doesn't do anything is it broke?
DragonDuck24 27 Aug, 2022 @ 4:11pm 
i think i fixed it, i ran the script before turning the numbering off, and it just doesnt change the ones that already have a number, but if i delete the number, then it renames it fine.
DragonDuck24 27 Aug, 2022 @ 4:07pm 
i have done that, and it still doesnt work
Whiplash141  [author] 27 Aug, 2022 @ 4:05pm 
"i cannot get it to not number the blocks, no matter what i do it always numbers them."

Disable numbering in custom data.
DragonDuck24 27 Aug, 2022 @ 4:04pm 
i cannot get it to not number the blocks, no matter what i do it always numbers them.
subbob 16 Jul, 2022 @ 6:15am 
This Q is beyond the scope of your script's functionality and more of a "how can I do something in code." I am asking here as others may have same Q or desire.

I like to add directional suffixes to my thrusters so that I can distinguish them when not in the cockpit. It also helps, for example, with output of Damage command from AutoLCDs script.

So instead of seeing H2 Thruster (80/100%) I see H2 Thruster [UP] (80/100%) on the LCD.

How would one determine the directionally within the script? Would one need to be seated when running it, or can the script determine it from the ship's controller?
Qwuille 14 Jul, 2022 @ 8:29am 
"Grid Rename, would be nice to have", For renaming the grid from "Large Grid XXXX" to what one would want, only applicable when playing alot with merging/unmerging.

But again, only a pure creature comfort, would rather wish for the accompanying function for Turret Slaving :D
Whiplash141  [author] 14 Jul, 2022 @ 6:24am 
"Grid Rename, would be nice to have"

Idk what this means. This script has grid name prefixing and suffixing
Qwuille 14 Jul, 2022 @ 6:01am 
Been using this script alot, but missing one thing that another script has and i am missing one other thing that i can not find anyone else has.

Grid Rename, would be nice to have, but not neccessary.

One thing that would be awesome and could ease setup for your Turret AI Slaving script! :D
Let's say you got a Base rotor, either TAG it or group it and it would be able to rename/prefix/suffix a text to all blocks after this rotor, then it would be a breeze to fix all the Turret Groups when having a lot of PMW's :D
Whiplash141  [author] 7 Jun, 2022 @ 11:50pm 
:)
Jackalope 7 Jun, 2022 @ 9:58pm 
Wow this is awesome
TallestDan 21 Apr, 2022 @ 1:21pm 
Yeah that was what I was doing originally, doesnt take too long to do it that way. Just would be nice if I wanted to make something quickly ya know.
Whiplash141  [author] 21 Apr, 2022 @ 9:25am 
That is a tricky one!

To do that, you'd need to make a bunch of groups like the following:

"rename CB-V - Corner Light -"

And then the numbering would be applied after the dash.

I'll see if adding a configurable delimiter for numbers is feasible