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
I tweaked a fix by the following code.
[code]
public int getLoN( int cnt ) {
int lon = 0;
if( GI_LoN <= 0 ) { lon = cnt.ToString().Length;
//lon = 2;
//while( cnt / (1f+(10f*lon)) >= 1 ) {
// lon++;
//}
} else {
lon = GI_LoN;
}
return lon;
} [/code]
Should be close to that anyway, it's been awhile since I've played, but in short, it's all in how you name the group.
I did basic testing but that doesn't mean I didn't mess up somewhere.
Also added $CLEAR while I was at it whould should do language safe restoration to default name.
That could be worth adding.
I shall look into it when I have a moment.
/* Used to place a tag on a block name with another tag */
public void ReplaceTagGroup( List<IMyTerminalBlock> blocks, string tag ) {
GROUPS += 1;
var tparsed = tag.Split( '|' );
var otag = tparsed[0];
var ntag = tparsed[1] ;
string name = null;
for( int e = 0; e < blocks.Count; e++ ) {
ACTIONS += 1;
name = blocks[e].CustomName;
if( name.Contains( otag ) ) {
name = name.Replace( " " , " " ).Replace( otag , ntag );
blocks[e].SetCustomName( name.Trim() );
}
}
}
and add these lines in somewhere... ( I put them right before the Display Method ):
/* Used to remove a tag from a block name */
public void RemoveTagGroup( List<IMyTerminalBlock> blocks, string tag ) {
GROUPS += 1;
string name = null;
for( int e = 0; e < blocks.Count; e++ ) {
ACTIONS += 1;
name = blocks[e].CustomName;
if( name.Contains( tag ) ) {
name = name.Replace( " " , " " ).Replace( tag , "" );
blocks[e].SetCustomName( name.Trim() );
}
}
}
Cobbled together a removetag and replacetag method for this extremely helpful script..
replace:
AddPrefixGroup( blocks, name, true );
}
}
}
}
with:
AddPrefixGroup( blocks, name, true );
} else if( act.Equals( "$REMOVETAG" ) ) {
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
groups[e].GetBlocks( blocks );
RemoveTagGroup( blocks, name );
} else if( act.Equals( "$REPLACETAG" ) ) {
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
groups[e].GetBlocks( blocks );
ReplaceTagGroup( blocks, name );
}
}
}
}
@Xeo: Could you post those methods for removing and replacing tags, or show me where it's stored?
Works on my own local save, but not on the dedicated server that I play on.
Secondly, I added both a $REPLACETAG and a $REMOVETAG methods for my personal use. As I can see such functions have been requested in previous comments, I'd happily give you access to my modified version of the script if you want to save yourself the small hassle of coding them yourself.
Keep up the good work !
As I use this script a lot myself It would be useful to me as well.
Just give me a bit.
I just LOVE this btw, use it on a daily basis, So thanks for sparing my countless of crashes due to Copypaste text crashing my game =)
I can make a script that gets the entire local grid so it can identify blocks that are on the same grid as the programable block, ignoring anything on the other side of connectors, pistors or rotors, buit merge blocks make a two grids into one grid, but when it comes to merge blocks the only way I can see for it to know the grids are split is to check the size of the grid and run renaming on individual blocks based on that. But that could be triggered by other ships unmerging, damage, or deconstruction.
FROM: blocks[e].SetCustomName( name );
TO: blocks[e].SetCustomName( name + " " + (e+1));
in order to add sequential numbers? Could also be a 4th "$RENAME#" subfunction, to preserve the identical name capability this provides.
Should be working again now.
Made a few changes, took advantage of echo and updated for the GridTerminalSystem changes
Let me know if you still have issue.
It's a nice script.
like say i have one ship... i build a merge block on it and a programmer block... than i have another ship... (not owned by me) and i add a merge block on to it... and the programming block converts the ship owner to me?
I'm happy to produce new scripts.