Space Engineers

Space Engineers

Copy Private Text to Custom Data
24 Comments
Titan Nya 12 Oct, 2019 @ 3:17am 
Sorry to revive an old script, but it's the closest to what i'm searching...
Is there a possibility to make the script to copy custom data from 1 block to others?
I'm currently using a script using custom data for configuration and for the test i'm doing for proof of concept i have 8 with 1 config and 8 with another one and my last idea may add 3 other...
So changing 16 (19 if last idea is final) one by one for only 1 out of maybe 6 sub part is... tedious
So well i'm asking here... no idea if it'll come out positively or not...

If not possible don't worry i'll do it manually...
Golden Dragon 17 Dec, 2016 @ 10:25am 
Additional request.
Can you clear custom text and title after copy?
Kham 16 Dec, 2016 @ 6:42am 
Thanks again for this man. I was able to convert all 50+ LCDs over my ships and stations to the new custom data field. I was a little worried that I'd have to spend the next week looking through old screenshots while setting them all up again to make sure they were correct. This saved me so much time.
MMaster  [author] 16 Dec, 2016 @ 5:45am 
Visual Studio Intellisense helps a lot. Its as simple as accessing lcd.CustomData ;)
Sleeper 15 Dec, 2016 @ 10:49pm 
Ok it worked great for me idk what happened before :D MMaster I would love to pick your brain now about how to read and parse the customdata field seems to be no documentation on it yet if you know a place i would appreciate greatly a link for reference. Thanks for your time and mods.:steamhappy:
MMaster  [author] 15 Dec, 2016 @ 9:57pm 
Happy to help! Enjoy! :)
Golden Dragon 15 Dec, 2016 @ 9:51pm 
Work! You saved me :) thx a lot!
MMaster  [author] 15 Dec, 2016 @ 9:45pm 
I updated the script so it now also copies Private Title to Public Title.
Be careful as this will overwrite your public title with whatever was in the private title before unless it was empty.
Golden Dragon 15 Dec, 2016 @ 9:39pm 
Oh... My fault :( i really use private title before.
Sorry :(
MMaster  [author] 15 Dec, 2016 @ 9:37pm 
From what you've shown me so far you didn't use Private Text, but Title .. but until now I was not sure if it was Private Title or Public Title. I assume that you used Private Title.

It's hard to help if you tell me that you used Private Text when you used Private Title ;)
Let me update the script so it copies any Private Title to Public Title.
MMaster  [author] 15 Dec, 2016 @ 9:37pm 
I will try to summarize it here:
In the past each LCD had Public Title, Private Title, Public Text and Private Text. You could enter commands to Private or Public Title separated by ; or use command "UseTextCommands" and write your commands to Private Text.
1. If you used Public Title to enter commands then you will still see all the commands in the LCD control panel and the main script will be able to read them no problem.
2. If you used Private Title then you won't be able to see the commands in the Title of the LCD (because there is no Private Title in the LCD control panel) and this script doesn't copy Private Title commands so it will not help you (but I can modify it so it will if this is the case)
3. If you used UseTextCommands command you had to enter commands to Private Text of the LCD. This is also no longer available from game and that's what this script copies.
MMaster  [author] 15 Dec, 2016 @ 9:28pm 
If you already have commands in Title you don't need to do anything.
MMaster  [author] 15 Dec, 2016 @ 9:28pm 
Main script now uses Title and Custom Data to enter commands. This script copies Private Text to Custom Data. If you didn't use Private Text before then this script is useless to you.
Golden Dragon 15 Dec, 2016 @ 9:26pm 
Absolutely no "privatetext" in savegames...
Golden Dragon 15 Dec, 2016 @ 9:25pm 
Your main script read and uses this field completly...
But if i clear it, it says "enter command"
http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=819108958
MMaster  [author] 15 Dec, 2016 @ 9:19pm 
It says Title .. so its Title not Private Text.
Golden Dragon 15 Dec, 2016 @ 9:16pm 
I probe it on https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=811438134 work.
And maybe thix is not private text?

<MyObjectBuilder_CubeBlock xsi:type="MyObjectBuilder_TextPanel">
<SubtypeName>LargeLCDPanel</SubtypeName>
<EntityId>91487343096383315</EntityId>
<CustomName>[LCD] Panel</CustomName>
<ShowOnHUD>false</ShowOnHUD>
<Enabled>true</Enabled>
<Description />
<Title>echo;timeC;dateC;echo;echo;echo Room pressure;Oxygen {Vent - Down room};echo;echo Ladder pressure;Oxygen {Vent - Ladder Down};echo;echo External gateway pressure;Oxygen {Vent - Down gateway}</Title>
<PublicDescription>
20:41
12/15/2016
</PublicDescription>
Golden Dragon 15 Dec, 2016 @ 9:09pm 
Hm...
I have working text panels with private text inside and...
Your script say "no private text"
http://gtm.steamproxy.vip/id/0_GDragon_0/screenshot/112985497069060167
http://gtm.steamproxy.vip/id/0_GDragon_0/screenshot/112985497069060360
MMaster  [author] 15 Dec, 2016 @ 8:16pm 
I have updated the script so now when you run it it says in programmable block control panel number of LCDs it found matching the words you entered and it will list them all saying if the Private Text was copied or if it was empty.
MMaster  [author] 15 Dec, 2016 @ 8:10pm 
The Private Text on existing blocks is still there internally. It worked completely fine for me and I used this script to copy all Private Text to Custom Data in my worlds. I have just tested it again with stable and it still works correctly. As long as the LCDs have same ownership as the programmable block where you run this script it should work. Any LCD that contained Private Text will have it copied and the programmable block will say 'Copying Private Text: <name of the LCD>' for every LCD where Private Text is non-empty.
If LCD Private Text was empty, or if programmable block doesn't have access to it or if there are no blocks with specified name it will not do anything.

You can try to run it without any arguments in which case it will go through all LCDs on the ship.
Sleeper 15 Dec, 2016 @ 7:59pm 
Because the field is deprecated it does nothing. Pretty much have to reset all your lcds manually however I noticed the field is still being read somehow because it still shows correct data on the screens in question, with my LCD script that was using similar private text and title options.
Golden Dragon 15 Dec, 2016 @ 9:38am 
hm. it does nothing on me...
No messages and absolutely no changes...
Golden Dragon 14 Dec, 2016 @ 11:06pm 
BIg thx!