Space Engineers

Space Engineers

CAT Basic Raycast Range Finder
104 Comments
Anarsim 16 Nov, 2024 @ 6:38pm 
Can this be edited in game to allow for scanning up to 75 million kilometers? I made a world with 7 solar systems using "Real Solar Systems" mod and I need a way for players to be able to discover stars and their orbiting planets other than by taking cargo transport missions from stations since they only seem to spawn missions within the same solar system I'm noticing, and I don't want to force everyone on the server to be cargo haulers if they want to explore
Dzimentar 12 Oct, 2024 @ 4:01pm 
script did not work with the cockpit display?
Levarith 20 Jun, 2024 @ 6:54am 
Is there a way to charge the camera faster? I am using this script as part of a satellite meant to identify and range distant planets visible from orbit near my home planet and the very long charge time is a bit of a drawback for this.
Loues.S.Cat  [author] 5 Sep, 2023 @ 10:41am 
You certainly could.
The script was made before custom data was a thing.
should be easy enough to simple write the returned information to the custom field
Iconaclysm 5 Sep, 2023 @ 7:20am 
This is really cool and useful script but I was wondering if I can use it with a Easy Automation 2 project. Is there a way to return the range to target variable to the Custom Data?
Damine 8 Aug, 2023 @ 12:01am 
program block states no data in mp?
SoulDragonWithFlow 30 Jul, 2023 @ 11:55am 
Never mind; figured it out
SoulDragonWithFlow 30 Jul, 2023 @ 5:31am 
I think I've got it working but I can't see it from my cockpit; the text on the LCD is too small. Tried changing the text size of the LCD in the terminal but it instantly reverts back. What do I change in the script to give me a bigger font size?
Loues.S.Cat  [author] 4 Dec, 2022 @ 6:47pm 
been a while since I did anything in SE but did you remove the <> around the variables?
Dr.Potato 3 Dec, 2022 @ 2:32pm 
yo, question i got a few questions about the script since while using i had some difficulty setting up the arguments. 1) how do i know when the script updated the range it its searching since it doesn't update on the lcd. 2) how do i get it to show the gps cords of a location since i tried show_gps:<ON> yet the lcd don't show?
Loues.S.Cat  [author] 29 Jul, 2022 @ 7:28am 
unless SE has changed the way raycasting works the camera needs to have enough charge to cover the distance requested. this is a function of SE itself, not this script.
BangBang 28 Jul, 2022 @ 1:27pm 
This is awsome!!!! Love this!!!:steamhappy::steamthumbsup::steamhappy: Is there a way to to delete the need for the camera to charge? Instant distance measurement upon Run
Big Jay 27 Aug, 2020 @ 5:33pm 
Hey! Great script idea, just struggling to get it set up..

I'm getting a 'Cam Status: Low Charge'

How can I rectify this? THanks!:steamhappy:
Meauxlag 12 Aug, 2020 @ 6:42am 
cant not get it to connect to any LCDs
alex_us 13 Jul, 2020 @ 8:01am 
Does it work???
Loues.S.Cat  [author] 4 Jul, 2020 @ 3:54pm 
@Thoshio I did exactly that with a variant in one of my ships.
The built in auto pilot can be flaky though.
ithilyn 4 Jul, 2020 @ 12:08pm 
Great script, clean, easy to understand, thanks so much.
Toshio 20 May, 2020 @ 6:44pm 
Hi, cool script, I'm thinking of a way to use it tell to a drone ship to navigate to whatever I point at (asteroids in particular). So would it be possible to add a parameter that will automatically add the last detected position to my GPS points?
I would add collision avoidance to the drone autopilot and a sensor to stop autopilot as it gets too close to the asterois. What do you think?
Jake, Exhibitor of State Farm 23 Mar, 2020 @ 4:23pm 
Would you be able to use this script on a spy ship to nab enemy base coordinates? I'm looking for a way to get coordinates for an airstrike without needing to drop an antenna, or go in myself.
Sparkyspace 16 Mar, 2020 @ 9:39am 
Looking forward to that. :)
Loues.S.Cat  [author] 15 Mar, 2020 @ 9:42am 
It wasnt intended for that. it could be used like that though.... it would be a lot simpler than the version I used to map what is above, behind and to my left and right XD
I can make a version for that shortly. not right now though I am busy.
Sparkyspace 15 Mar, 2020 @ 2:43am 
Can I use this script to only show distance to target in a Top or Bottom LCD screen? I want to use it for my large grid ships (or any actually) to see how much headroom (all directions) they have when they go inside a hangar bay. Can I do it with this script or is it really just one camera and always all the jazz of information on display?
Derzuel 21 Jan, 2020 @ 6:47pm 
Ah ok I see now, it was a misinterpretation on my part on how to set it, I had been thinking that the quotation marks were a required part of the field.
Well glad to have cleared that up, and yes after removing the quotation marks the script did begin to behave itself again.
Loues.S.Cat  [author] 21 Jan, 2020 @ 4:09pm 
Ahhhh... null is a special value while "null" is a string litteral.
If you set a variable as GS_Tag = "null"; you are looking for the string "null" so you would match names that contain the word "null".
But if you set GS_Tar = null which sets it to the special value of null which is not a string litteral but a unique value distinct in itself.
Loues.S.Cat  [author] 20 Jan, 2020 @ 8:19pm 
@Darzuel Could you upload your problem ship to the workshop so I can see? Because I tested the script and all those functions worked 0.o

@Spiff You're welcome.
Spiff Wiz Zardman 20 Jan, 2020 @ 2:36pm 
Thanks, demo mod works perfectly, not sure what I had done wrong but I'll use this to get it set up the same way. I appreciate your care in addressing this :)
Derzuel 20 Jan, 2020 @ 12:49pm 
hmm ok did some further testing, seems the "null" function is broken and the PB is requiring both a Prefix and the tag
Derzuel 20 Jan, 2020 @ 12:41pm 
any changes to gs_Prefix or gs_LCD_Tag variables seems to break the script, tested with supplied test ship and after change the prefix the [MR] from [RC] the Programmable Block could not detect the supplied text panel that had been changed to match. Even changing them back to their defaults doesn't seem to work
Loues.S.Cat  [author] 17 Jan, 2020 @ 9:49pm 
Spiff Wiz Zardman 17 Jan, 2020 @ 9:39pm 
I might be doing something wrong, I get lost easily trying to understand scripts
Loues.S.Cat  [author] 17 Jan, 2020 @ 9:14pm 
Well I am not sure what the source of your problem is, and while updating the old LCD part I got caught up in making a few more refinements XD
I'll throw a little drone ship with this built in up on the workshop for you to try out in a moment so we can see if we can track down the source of the issue.
Spiff Wiz Zardman 17 Jan, 2020 @ 8:16pm 
Wow thx for speedy reply... bravo!
I hope it's an easy fix
Loues.S.Cat  [author] 17 Jan, 2020 @ 8:06pm 
As expected it needs updating but it does seem to still be working for me.
I will swap over the way displays work in the script and update it, and have it print to the PB screen if no LCD is found... actually probably just print to screen regardless.
Loues.S.Cat  [author] 17 Jan, 2020 @ 7:52pm 
May be to do with the changes to how LCDs work.
Checking.
Spiff Wiz Zardman 17 Jan, 2020 @ 7:51pm 
It returns LCD not detected. I have both prefix and tag set to null, the LCD panel and programmable block are on small grid.
Tetra 18 Sep, 2019 @ 7:29pm 
Requires update due to LCD update runs fine on Lcd blocks but incockpit blocks and other lcd
useing blocks are currently unfunctional
Loues.S.Cat  [author] 27 Jul, 2019 @ 10:37am 
Ah I didnt test it on the playtest....
Rulin 27 Jul, 2019 @ 8:16am 
Will try it again, thanks! Maybe I had problems because I was using it in the new playtest.
Loues.S.Cat  [author] 26 Jul, 2019 @ 9:58pm 
This still seems to work fine. I have updated it to clear some warnings and changed the display to the new screen handler
Rulin 26 Jul, 2019 @ 9:12am 
Are there any alternative raycast mods that still work?
xpgx1 1 Jul, 2019 @ 9:04am 
Would be an awesome addition to my WMI MART turret design - something to display context info ALONGSIDE an ammo counter, would be dope if you specialized the script for this usecase ^^
ChardWreck 17 Jun, 2019 @ 7:47pm 
Doesn't seem to be working. Don't get any information. Cam Status: NA, Cam Charge: NA Target Range: is always the value of gi_range. No other information is on the lcd.

Looks like some deprecated code judging by the 'check code'.
Loues.S.Cat  [author] 31 Mar, 2019 @ 1:29pm 
Seems to be.
Did you have an issue?
KuroShiro 31 Mar, 2019 @ 12:11pm 
does this thing still work?
Vorg 7 Feb, 2019 @ 10:16am 
What is the max range of this? I would like to use it to check the distance to roids to see which is the next closest when looking for ore.
Dmayer1123 4 Jan, 2019 @ 4:01pm 
HOPE THIS HELPS
Step 1: Build programmable block and load script
step 2: build camera and name it [RF] Camera [Ray]
Step 3: Name LCD panel you'd like this to run on [RF]LCD[OUT]
Set 4: type doscan in the argument area of the programmable block your using and hit run.
if done correctly it should display anything within 5,000m in cross-hairs of camera.
i suggest adding the PB to your action toolbar in ship. select the correct PB Block in the action set up menu and drag it to an empty slot on your action bar, and select "RUN" in the sub menu after pasting, an argument box will pop up for you to type in "doscan" and hit ok. you can now hit the action key for a quick scan.
SUMMARY:
-NAME YOUR LCD PANEL: [RF]LCD[OUT]
-NAME YOUR CAMERA: [RF] Camera [Ray]
-PROGRAMABLE BLOCK RUN ARGUMENT: doscan
JUST COPY AND PASTE SO YOU DONT MESS IT UP "CTRL+C" AND "CTRL+V TO PASTE IT"
Serafin 4 Jan, 2019 @ 10:16am 
Hey Loues!
Could you help us less-experienced people out with a simple a-z list of steps I have to take to make this work? I found the script when trying to build a gps-based cruise missile base on Earth and some simple instructions how to use this script on my "satelite" to make the GPS coordinates my missiles shall use would be great!
HELLO 7 Aug, 2018 @ 7:25pm 
THX!:mpgb_resabell:
ratheden 2 Jun, 2018 @ 1:47am 
Can I get a simple set of a-z instructions to make this work for me for the first try? I will happly rename the blocks o what ever you say just to get it to wark for the first time, For my failing, i am not getting the instrusctions provided.
As i am seeing impaired a nice set of do this a-z would be very helpfull...
EG: A; Rename bamera to xxxxx
B; Rename screen to xxxx

i am after something where i just do it, and not make choiices, as i can do that after i have it working.


Thanks for any help you can offer.