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
I did put it in my normal save, but it made it just a bit too easy, so I removed it - that made the ore detectors stop working all together.
Now I have it in again.
I got to look for the config to make it less op ;P
03:25:27.4952 [DEBUG] Keen: Exception: System.ArgumentNullException: Value cannot be null.
at System.Threading.SemaphoreSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Collections.Concurrent.BlockingCollection`1.TryTakeWithNoTimeValidation(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken, CancellationTokenSource combinedTokenSource)
at System.Collections.Concurrent.BlockingCollection`1.TryTake(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Collections.Concurrent.BlockingCollection`1.Take()
at OreDetectorReforged.Detector.DetectorServer.ProcessTasks()
at ParallelTasks.DelegateWork.DoWork(WorkData workData)
at ParallelTasks.WorkItem.DoWork(Int32 expectedID)
First time I've seen this.
2024-05-18 17:43:16.104 - Thread: 31 -> Exception: System.OverflowException: Value was either too large or too small for a UInt16.
at System.Convert.ToUInt16(Int32 value)
at OreDetectorReforged.Detector.DetectorPagePlanet.Pop()
at OreDetectorReforged.Detector.DetectorServer.ProcessTasks()
I fixed this by editting detectorpageplanet.cs and updated this line...
pq.Push(new Node(dist, page, Convert.ToUInt16(plod1.X), Convert.ToUInt16(plod1.Y), Convert.ToUInt16(plod1.Z)));
To this...
// Clamp values to UInt16 range.
ushort clampedX = (ushort)Math.Max(0, Math.Min(plod1.X, UInt16.MaxValue));
ushort clampedY = (ushort)Math.Max(0, Math.Min(plod1.Y, UInt16.MaxValue));
ushort clampedZ = (ushort)Math.Max(0, Math.Min(plod1.Z, UInt16.MaxValue));
pq.Push(new Node(dist, page, clampedX, clampedY, clampedZ));
For example: if you set the display count to 3, whitelist Iron only, and exclusion range to 100m, it would only show 3 markers at 3 different iron deposits rather than 3 markers overlapping at the same location on different voxels of iron.
But on my new Server it doesn't seems to work right.
When i log in it works, or when the server restartet. But as soon as you leave the log in area or turn the ore detector off/on nothing happens besides the default Ore detector scan range.
I have Better Stone installed (The Full Modlist is 105 Mods long), which worked well on the previous Server.
I also played with the Load order of this mod but the behaviour remains the same.
Some Ideas?
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3044962040 is the link to the script. It will scan through all the ore types and write the first found ore to the custom data. If it doesn't find a specified ore, it moves to the next ore until it does find one or all the ores were depleted.
ReforgedDetectN(new BoundingSphereD(Me.GetPosition(), 3e4), Ore, 1, (vs) => Results += "\n" + vs.FirstOrDefault());
while (true) {
if (Results.Length > 0) {
break;
}
}
because it would compile. but then I tried to run it and I was told my script was too complex.
Looks like Task from System.Threading.Tasks is not allowed in space engineers. Meaning I can't for example
Task t = Task.Run(() => {
ReforgedDetectN(new BoundingSphereD(Me.GetPosition(), 3e4), Ore, 1, (vs) => Results += "\n" + vs.FirstOrDefault());
});
t.Wait();
Do something like that. Is there a built in method to wait until the task is complete?
string[] oreTypes = new string[]
{
"Gold",
"Iron",
"Ice",
"Cobalt",
};
void ReforgedDetectN(BoundingSphereD area, string minedOre, int count, Action<List<Vector3D>> callBack) {
Me.SetValue("ReforgedDetectN", new ValueTuple<BoundingSphereD, string, int, Action<List<Vector3D>>>(area, minedOre, count, callBack));
}
public void Main(string argument, UpdateType updateSource) {
string Results = "";
foreach (string Ore in oreTypes) {
ReforgedDetectN(new BoundingSphereD(Me.GetPosition(), 3e4), Ore, 1, (vs) => Results += "\n" + vs.FirstOrDefault());
Echo("Results for " + Ore + ": " + Results);
if (Results.Length > 11) {//X:0 Y:0 Z:0 is 11 characters
Echo("Writing to custom data: " + Results);
Me.CustomData = Results;
break;
}
Me.CustomData = "";
}
Echo("Done");
}
@thorman I would guess it's the other mod. Nanite had similar issue.
@ WGTaP No I don't have discord.
@AnonaMoose What api stuff?
The ingame script example is linked in description and in the readme file: `steam://openurl/https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2810169765`
The mod message handler is registered by the code `RegisterMessageHandler(modMsgId`.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2976762253
Can i use this in conjunction with say an auto miner and plug in a bunch of gps locations and send it to mine it all?