Space Engineers

Space Engineers

HudLcd v2 1/2 beta w/ Multi-screen blocks
MoonMoon 14 May, 2020 @ 12:46pm
Range fuction
Appears that range function when set does not use the provided value and only uses the default 100m.
< >
Showing 1-6 of 6 comments
Kapitan Oczywisty  [developer] 14 May, 2020 @ 2:38pm 
Can you provide exact configuration line used?
MoonMoon 14 May, 2020 @ 3:06pm 
//hudlcd -1.0x1.0 range=10

ive tried various values above and below the default.
MoonMoon 14 May, 2020 @ 3:29pm 
if theres anything i should test or try let me know.
MoonMoon 15 May, 2020 @ 3:48am 
Okay so from what ive learned so far experimenting with regex testers and looking at your code.

regexRange = new Regex(@"(?xi) (?: range ) (?: = ( [a-z]+ | \d{1,3},\d{1,3},\d{1,3} ) )?", RegexOptions.Compiled | RegexOptions.RightToLeft);

the regex line for range isnt finding any match. from what i can tell its looking range=x,x,x . Instead i think what might work is using something similar to what was used in the stable versions code and use the following.

regexRange = new Regex(@"(?xi) (?: range ) (?: = ( \d{1,3} ) )?", RegexOptions.Compiled | RegexOptions.RightToLeft);

we arent looking for letters after the "=" so leave the [a-z] out, and if your only wanting values 1-1000 then have \d{1,3} (values 0-999 will match) or \d{1,4} (values 0-9999 will match)
Last edited by MoonMoon; 15 May, 2020 @ 3:48am
MoonMoon 15 May, 2020 @ 4:23am 
ive figured out the fix and tested it successfully. in the HudSurface.cs file for the regex setting for range on line 357, changed

regexRange = new Regex(@"(?xi) (?: range ) (?: = ( [a-z]+ | \d{1,3},\d{1,3},\d{1,3} ) )?", RegexOptions.Compiled | RegexOptions.RightToLeft);

to the following allows for successful matching of a 1-3 digit number input after "range=" in the custom data of an lcd.

regexRange = new Regex(@"(?xi) (?: range ) (?: = ( \d{1,3} ) )?", RegexOptions.Compiled | RegexOptions.RightToLeft);

i made the change and saved the file, did a reload of the game, and was able to set the range to 1 meter, 10 meters, and 110 meters all successfully displaying/not displaying when entering/leaving the range.
Kapitan Oczywisty  [developer] 15 May, 2020 @ 1:00pm 
Fixed, thank you!
< >
Showing 1-6 of 6 comments
Per page: 1530 50