Instal Steam
login
|
bahasa
简体中文 (Tionghoa Sederhana)
繁體中文 (Tionghoa Tradisional)
日本語 (Bahasa Jepang)
한국어 (Bahasa Korea)
ไทย (Bahasa Thai)
Български (Bahasa Bulgaria)
Čeština (Bahasa Ceko)
Dansk (Bahasa Denmark)
Deutsch (Bahasa Jerman)
English (Bahasa Inggris)
Español - España (Bahasa Spanyol - Spanyol)
Español - Latinoamérica (Bahasa Spanyol - Amerika Latin)
Ελληνικά (Bahasa Yunani)
Français (Bahasa Prancis)
Italiano (Bahasa Italia)
Magyar (Bahasa Hungaria)
Nederlands (Bahasa Belanda)
Norsk (Bahasa Norwegia)
Polski (Bahasa Polandia)
Português (Portugis - Portugal)
Português-Brasil (Bahasa Portugis-Brasil)
Română (Bahasa Rumania)
Русский (Bahasa Rusia)
Suomi (Bahasa Finlandia)
Svenska (Bahasa Swedia)
Türkçe (Bahasa Turki)
Tiếng Việt (Bahasa Vietnam)
Українська (Bahasa Ukraina)
Laporkan kesalahan penerjemahan
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.