Space Engineers

Space Engineers

评价数不足
Renamer
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
414.000 B
2017 年 9 月 14 日 上午 2:44
2017 年 9 月 14 日 上午 3:01
3 项改动说明 ( 查看 )

订阅以下载
Renamer

描述
This script used for build prefix at each block name. It is necessary for the distinction of the blocks when connecting different ships. Just replace "ShipName" string from "PL1_" to what ever you want. If you want to rename all block put to "Rename" variable string you want to rename and to "ShipName" new value.
4 条留言
CamariX 2023 年 6 月 17 日 上午 10:03 
[ i ] won't appear on my previous comment. all code without the problem

void Main(string argument)
{
String ShipName = "BASE - ";
String Rename = "LVLX - ";
String BlockName = "";
List<IMyTerminalBlock> Blocks = new List<IMyTerminalBlock>();
GridTerminalSystem.GetBlocks(Blocks);
for (int no = 0; no < Blocks.Count; x++)
{
BlockName = Blocks[no].CustomName;
if (Rename != "")
{
Blocks[no].CustomName = Blocks[no].CustomName.Replace(Rename, ShipName);
}
if (Blocks[no].CustomName.StartsWith(ShipName) == false)
{
Blocks[no].CustomName = ShipName + BlockName;
}
}
}
CamariX 2023 年 5 月 19 日 上午 10:37 
Back. This script has a small problem with renaming.
Just change line by :

if ( Blocks .CustomName.StartsWith(ShipName) == false)

Else the Shipname will be added to the actual name without renaming
CamariX 2023 年 5 月 17 日 下午 2:25 
Works fine ! Use it with programming block
Pote 2022 年 5 月 11 日 上午 7:22 
Works well