Space Engineers

Space Engineers

Orbital Drop Position Calculator
DrCuddles 2019 年 6 月 5 日 下午 1:54
Fix for Script writing to every LCD
For anyone suffering from the Script writing to every LCD I have fixed it myself until the author gets round to it, he specifies a variable for the name of the screen to look for when adding the data but then never uses it and loops over every screen in the grid anyway.

Please replace your method WriteToLCD() with this one:

private void WriteToLCD() { GridTerminalSystem.GetBlocksOfType<IMyTextPanel>(lcdList); string text = "---Result---\nPayload dropping position :\n" + dropPos + "\nShip jump position :\n" + jumpPos; if(showPlanetDataToLCD){ text += "\n\n---Recorded Planet Data---\n"; foreach(PlanetData p in planetsList){ text += "Planet Name : " + p.Name + "\n" + ConvertVector3DToGPS(p.Name,p.Position) + "\nGravity at planet surface : " + p.DefaultGravity + "G" + "\nNatural gravity decreasing altitude(Sea level) : " + p.MaxHillRadius + "m" + "\nNatural gravity radius : " + p.GravityRadius + "m\n\n"; } for(int i = 0; i < lcdList.Count; i++) { if(lcdList.CustomName == lcdName) {
(lcdList).WritePublicText(text, false);
(lcdList).ShowPublicTextOnScreen();
}
}

}
}
最后由 DrCuddles 编辑于; 2019 年 6 月 5 日 下午 1:55
< >
正在显示第 1 - 2 条,共 2 条留言
Fuchs Tairn 5 月 6 日 上午 7:17 
hey when i try to build your part in it spits out tons of errors could you send me a full version of your script please
RenzoARG 10 月 9 日 上午 7:17 
Tried this, trying to save me the effort of fixing it myself. Failed.

lcdList is... a "list", not a single block.

Here's the correct, corrected version.

private void WriteToLCD() { lcdList.Clear(); GridTerminalSystem.GetBlocksOfType<IMyTextPanel>(lcdList, l => l.CustomName.Contains(lcdName)); string text = "---Result---\nPayload dropping position :\n" + dropPos + "\nShip jump position :\n" + jumpPos; if (showPlanetDataToLCD) { text += "\n\n---Recorded Planet Data---\n"; foreach (PlanetData p in planetsList) { text += "Planet Name : " + p.Name + "\n" + ConvertVector3DToGPS(p.Name, p.Position) + "\nGravity at planet surface : " + p.DefaultGravity + "G" + "\nNatural gravity decreasing altitude (Sea level) : " + p.MaxHillRadius + "m" + "\nNatural gravity radius : " + p.GravityRadius + "m\n\n"; } } foreach (var lcd in lcdList) { lcd.ContentType = ContentType.TEXT_AND_IMAGE; lcd.WriteText(text, false); } }
最后由 RenzoARG 编辑于; 10 月 9 日 上午 7:17
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50