Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
You're better off using the group based renaming one linked in the description.
How odd. I was using it myself quite recently. I will have a look.
And to the best of my knowledge you can't grab the name of a ship.
It was made before you could run scripts with arguments, or use Echo but that is a good idea for an upgrade.
Just getting the ship name in this case would give me a page full of"Large Cargo Freighter ..." entries, and I wouldn't see the full name until I clicked on the block.
I'd say you could just make it use a string from the argument box, and that would work fine.
If you wanted the full ship name, you'd only have to type it in once, and you wouldn't need to open up the script editor, just change the text in the argument box.
I then made a few more tweaks to generally update and clean up the code, but I didn't touch the core logic of it.
I replaced line 9 with this:
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
GridTerminalSystem.GetBlocksOfType<IMyTerminalBlock>(blocks);
After that, I changed the list index variable to " i " instead of " j " because " i " for index makes more sense to me.
Finally, I replaced the call to "Print()" with "Echo()", and deleted the code defining "Print()".
The Echo function actually works better here because it prints out text directly to the programmable block's menu, and because it's a default function you don't need to define it, saving program space.
Oh yeah, I also re-whitespaced the whole thing, as I prefer al my curly brakets to be on their own lines.
This script is a bit outdated. I use a group based renaming script now.
By using a group based renaming system you can run the same script on any programable block and set a group to decide what to rename target blocks connected to that grid so no editing of the script is needed.