Space Engineers

Space Engineers

GPS to LCD/Text Panel
21 Comments
Perox 16 Jun @ 6:27pm 
This one will run (even with a warning).
Stubie comment included,
WritePublicText changed to WriteText
last commands removed.
Oh and island, you should put it in a programmable bloc (with the button "modify"). ;)
Better late than never... ^^
https://postimg.cc/XZcFFF05
Perox 16 Jun @ 6:19pm 
[code]
// Change this to the LCD/Text panel's name
const string SCREEN_NAME="Name";
// (OPTIONAL) The block that you want to get GPS coord. from
// If empty, use the lcd's position
const string CENTER_BLOCK = "";
const string FORMAT = "X={0:0.00}\nY={1:0.00}\nZ={2:0.00}";
IMyTerminalBlock center=null;
IMyTextPanel screen=null;
public Program()
{Runtime.UpdateFrequency=UpdateFrequency.Update100;}
void Main()
{if(screen==null)
{screen=GridTerminalSystem.GetBlockWithName(SCREEN_NAME) as IMyTextPanel;
if(screen==null)
throw new Exception("Cant find LCD: "+SCREEN_NAME);}
if(center==null)
{if(CENTER_BLOCK==null || CENTER_BLOCK=="")
{center=screen;}
else
{center=GridTerminalSystem.GetBlockWithName(CENTER_BLOCK);
if(center==null)
throw new Exception("Cant find block: "+CENTER_BLOCK);}}
var pos = center.GetPosition();
screen.WriteText("Pos. GPS\n", false);
screen.WriteText(String.Format(FORMAT, pos.GetDim(0), pos.GetDim(1), pos.GetDim(2)), true);
}
[/code]
island 2 Jun, 2024 @ 10:30am 
@Captain Stubing

Hey, where do you add this exactly? Maybe I'm doing it wrong
StubieDubie 12 May, 2021 @ 10:41pm 
If you add this to the script it should work:

public Program()
{
Runtime.UpdateFrequency = UpdateFrequency.Update100;
}

The unreachable code messages are harmless warnings.

You have to name the screen exactly "GPS Screen" and you need to configure that screen to display text.
SpetS 7 Mar, 2019 @ 1:23am 
damn this is old... and doesn't work anymore :/
Michael 18 Feb, 2018 @ 7:43am 
I have the same problem as Islime. updated to the newer script but doesnt seem to work says unreachable code detected when i check
Isilme 2 Feb, 2018 @ 1:35pm 
Since the last update this has been flickering when displayed, like the LCD keeps resetting
E_Boy_666 8 Jan, 2016 @ 1:37pm 
nice work bro
ShieldKnight857 2 Jun, 2015 @ 2:29pm 
It can't find the text panel even though I have one
Deathpaw 7 May, 2015 @ 10:13am 
Could i please request a version of this script that displays orientation and speed?

I've been all over workshop and none of the scripts out there delivered as expected :(
Krigherren 9 Mar, 2015 @ 6:35pm 
Sweeeeeeeeeeet!
Digi  [author] 9 Mar, 2015 @ 4:36am 
It's all in the code, just read the comments I made.
Shellduck 9 Mar, 2015 @ 4:06am 
Can you choose what blocs you get the coordinates of? and how?
Digi  [author] 8 Mar, 2015 @ 9:04pm 
Grayed out ? Check the ownership.
[Andon] 8 Mar, 2015 @ 3:37pm 
I've been fiddling with this thing, but can't get a timer block to "Run" the programmable block. Aside from that it's working great
Coxzee 7 Mar, 2015 @ 4:44pm 
Ah, cheers i'll try that, sorry man I need step by step instructions or i'am lost. :/
Digi  [author] 7 Mar, 2015 @ 4:16pm 
Ehh, you didn't change the name, you added equals quotes and the GPS Screen to it, you need to erase the entire name and only set it to GPS Screen.
Coxzee 7 Mar, 2015 @ 8:09am 
So embarresing but I still can't get this to work. :(

I have changed the name of the Text panel to GPS Screen and the PB say's "exception can't find Text panel GPS Screen" here's a screenshot of what it say's and on the left the name of my Text panel.


https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=404063452
Digi  [author] 6 Mar, 2015 @ 7:48pm 
@[UESC]Coxzee=FILTH=
Create a text/LCD panel with the name "GPS Screen", load the script in a programmable block and run it every time you want to update the screen, you can use a timer block with 1 second delay and run the PB and start itself.
Coxzee 6 Mar, 2015 @ 7:01pm 
I wish I could get this to work, I'am not good with code and I just don't know what I have to do to get this working. I have tried a few ways but alas no joy. :(
password 5 Mar, 2015 @ 7:51pm 
This is perfect! Thanks