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
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
// 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]
Hey, where do you add this exactly? Maybe I'm doing it wrong
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.
I've been all over workshop and none of the scripts out there delivered as expected :(