Space Engineers

Space Engineers

[QoL] Radio Spectrometry
Buddy Leeski 12 Thg01, 2023 @ 6:55pm
GPS Addition
I love this mod and quickly created a controllable ore detector with a camera so that my main carrier ship can scan for ores. Issue was trying to recall which asteroid I was looking at. I added this little bit of code below line 218 of the RadioSpectrometryTSS.cs file... it will give you the GPS coordinates of the asteroid you're looking at in the CustomData of the display panel.

Sandbox.ModAPI.IMyTextPanel txtPanel = m_ScriptBlock as Sandbox.ModAPI.IMyTextPanel;
if (txtPanel != null)
{
try
{
Vector3D position = scancomp.m_lastMap.PositionLeftBottomCorner;
var half = scancomp.m_lastMap.SizeInMetresHalf;
txtPanel.CustomData = "GPS:Asteroid:" + (position.X+half.X).ToString() + ":" +(position.Y+half.Y).ToString() + ":" +(position.Z+half.Z).ToString() + ":#FFFFFFFF:";
}
catch (Exception ex)
{
txtPanel.CustomData = ex.Message;
}
}

Probably a cleaner way to implement but I didn't have a good IDE set up at this point.

Here are all the using statements as I think i had to add some of the vrage libs

using Sandbox.Game.GameSystems.TextSurfaceScripts;
using Sandbox.ModAPI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VRage.Game.GUI.TextPanel;
using VRage.Game.ModAPI.Ingame;
using VRage.ModAPI;
using VRageMath;
using IMyCubeBlock = VRage.Game.ModAPI.IMyCubeBlock;
Lần sửa cuối bởi Buddy Leeski; 13 Thg01, 2023 @ 12:40am
< >
Đang hiển thị 1-4 trong 4 bình luận
Emiricol4Rl 1 Thg03, 2023 @ 7:29am 
YOU are amazing! edit: what if anything must be done with the "using' statements?
Lần sửa cuối bởi Emiricol4Rl; 1 Thg03, 2023 @ 7:31am
DraygoKorvan  [nhà phát triển] 15 Thg03, 2023 @ 10:22am 
This is not something i'm going to do. Remember the client is doing the scan what this will do is cause a lot of network updates when there are multiple clients in the same ship.

What would be a better solution would be a chat command that gives you the gps of whatever is in your crosshair.
Cthulhu 12 Thg05, 2023 @ 12:39pm 
Nguyên văn bởi DraygoKorvan:

.....
What would be a better solution would be a chat command that gives you the gps of whatever is in your crosshair.

this is likely to become the killer function! very nice, in the same time i was thinking about something similar more in-line whit the radio-spectrometer concept/design:
when scanning just under the "scanning" line in the lcd an estimation distance value, only for voxels, if possible
Jack Schitt 8 Thg08, 2023 @ 8:04am 
Nguyên văn bởi Swa7Sairys_PL:
I didn't have a good IDE set up at this point.
There's a tool for Visual Studio 2022: https://github.com/malware-dev/MDK-SE/releases
Get the .vsx in the "Assets" section.
Lần sửa cuối bởi Jack Schitt; 8 Thg08, 2023 @ 8:04am
< >
Đang hiển thị 1-4 trong 4 bình luận
Mỗi trang: 1530 50