Space Engineers

Space Engineers

29 hodnocení
GPS to LCD/Text Panel
   
Ocenit
Přidat do oblíbených
Oblíbeno
Odebrat z oblíbených
Velikost souboru
Přidáno
756.000 B
3. bře. 2015 v 19.48
Poznámky ke změnám (1) – zobrazit

Klikněte na „Odebírat“ pro stažení položky
GPS to LCD/Text Panel

Popis
This gets the world coordinates of the screen (or a specific block on the ship) and writes it to a specified LCD/Text panel.

Read the comments in the code and edit accordingly.
Počet komentářů: 21
Perox 16. čvn. v 18.27 
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. čvn. v 18.19 
[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. čvn. 2024 v 10.30 
@Captain Stubing

Hey, where do you add this exactly? Maybe I'm doing it wrong
StubieDubie 12. kvě. 2021 v 22.41 
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. bře. 2019 v 1.23 
damn this is old... and doesn't work anymore :/
Michael 18. úno. 2018 v 7.43 
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. úno. 2018 v 13.35 
Since the last update this has been flickering when displayed, like the LCD keeps resetting
E_Boy_666 8. led. 2016 v 13.37 
nice work bro
ShieldKnight857 2. čvn. 2015 v 14.29 
It can't find the text panel even though I have one
Deathpaw 7. kvě. 2015 v 10.13 
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 :(