Space Engineers

Space Engineers

425 ratings
Graphical Radar Script Mark II
File Size
0.007 MB
Feb 18, 2016 @ 7:18pm
Jul 10, 2016 @ 1:34am
4 Change Notes ( view )

Subscribe to download
Graphical Radar Script Mark II

This is a script for programming blocks. It will not show up in your mod list, it will only show up in your scripts list when you edit programming blocks.

If you get an error saying "Caught exception during execution of script:Common language Runtime detected an invalid program.", it means you have an old version of .NET framework, and you need to upgrade.

- Combinatory scan block configuration
- Adjustable colors
- Adjustable lcd screen resolution, 40x40 - 160x160
- Adjustable script refresh rate
- Simultanious RC Block + Sensors scanning mode
- Status screen with formatted GPS coordinates
- Upside-down rotor support mode
- Automatic rotor and sensor configuration
- Homemade number font
- Support for multiple radars on the same grid by adjustable search tag
- Argument handling:
-- "increase" - increase remote block scan range
-- "decrease" - decrease remote block scan range

How does it work?
Sensors has a function called LastDetectedEntity, and you can do GetPosition() on that to get 3d coordinates. Comparing the radar's coordinates with the target's coordinates we get the distance. Knowing the angle of the rotor and the distance to the target we can apply simple trigonometry to imagine a triangle, and get 2D x and y coordinates to plot on the radar screen.

The Remote Control block has an autopilot feature, which has a function to detect obstacles called GetFreeDestination(). We can use that function to get the distance to the obstacle. Unlike sensors, we can tell the Remote Control block which direction to look at, so we don't need an actual rotor, we can simulate one in the code. We then apply the same basic trigonometry to get 2D x and y coordinates.

Instructions - Simple Rotorless Mode:
- Place a power source, a Timer, a Programmable Block, a Remote Control block, and a Text Panel
- Edit the programmable block, Browse workshop and find this script in the list, "ok", "Remember & Exit"
- Rename the Remote Control Block so it contains "RADAR"
- Rename the LCD / Text panel so it contains "RADAR DISPLAY" (you can have more than one)
- Setup Actions in the Timer Block like this:
-> add the Programmable Block
-> add the Timer Block itself and set it to "Trigger Now"
- Trigger the Timer Block with "Trigger Now"

Visual Guide:

Video Guide by Mirrowel:

Instructions - Combined Scanning Mode, Remote Control + 1 Sensor:
- Do everything in Rotorless mode
- Add one Rotor
- Place a block on the rotor
- Rename the rotor so it contains "RADAR"
- Place a sensor on the forward facing side of the block on the rotor
- Rename the sensor so it contains "RADAR FRONT"
- Recompile the script by editing and pressing "Remember & Exit"
- Trigger the Timer

Instructions - Combined Scanning Mode, Remote Control + 4 Sensors:
- Do everything in the previous list
- Add a sensor to the back of the block on the rotor
- Rename it so it contains "RADAR BACK"
- Add a sensor to the left side of the block
- Rename it so it contains "RADAR LEFT"
- Add a sensor to the right side of the block
- Rename it so it contains "RADAR RIGHT"
- Recompile the script by editing and pressing "Remember & Exit"
- Trigger the Timer

Instructions for extra GPS Stats Display
- Follow instructions for any scanning mode
- Add an LCD / Text panel, rename it so it contains "RADAR STATS" (you can have more than one)
- Recompile the script by editing and pressing "Remember & Exit"
- Trigger the Timer

Instructions for spanning radar image across multiple screens (experimental):
- Set up the Programmable block, Timer, Remote Block, and/or Sensors according to previous instructions
- Place 4 LCD's or Text panels (wide screens will probably not look right)
- Rename the upper left screen so it contains "RADAR MULTI1"
- Rename the upper right screen so it contains "RADAR MULTI2"
- Rename the lower left screen so it contains "RADAR MULTI3"
- Rename the lower right screen so it contains "RADAR MULTI4"
- Set the "multiScreenMode" variable in the script to "true"
- Press "Remember & Exit"
- Trigger the Timer

Need-to-know stuff and limitations:
- The remote control block is capable of detecting obstacles hundreds of kilometers away, but the detection rate is limited by the speed of the scan rotation, and by how many times the script is running per second. The actual max scanning range is unknown at this point, but it should be able to scan several kilometers.
- The remote control block is very touchy about grid placement, many different blocks prevents it from scanning at all.
- The remote control block scans in a very flat circle around you, so you need to be horizontally aligned with your targets to detect them.
- Targets detected with Remote Control and targets detected with Sensors will show up at the same time with different colors.
- The screen will scale the ratio automatically depending on the range settings.
- If a red target is displayed next to a green target, it doesn't necessarily mean that they are next to each other in the game, because where they are placed on the screen depends on the individual separate range settings of the remote control and sensors.
- Increased resolution = more calculations = bigger FPS cost
- Increase refresh rate = more calculations per second = bigger FPS cost

Update 2.1
- Added support for multiple Remote Control blocks, (you can put them on different heights to detect more targets)
- Added compatibility with stupid old glitchy .net frameworks that can't even handle foreach loops
- Fixed a multiscreen bug where it wouldn't work if you didn't have an additional "RADAR DISPLAY"
- Added more sensor options and maxed top and bottom extent
- Improved automatic fontsize

Update 2.2
- Fixed inaccurate screen scaling

Update 2.3
- Fixed compiler warnings
- Compatibility with 1.143 dev
- Compatibility with 1.139 stable (untested)
< >
The Nyét Lády Mar 24, 2019 @ 9:32pm 
it's not working here
Ecke™ Dec 29, 2018 @ 3:23am 
The code isn't working
..::||Viper||::.. Jan 2, 2018 @ 9:49am 

This script can't work and never will work again, so there's no need for this author to return. Keen removed the API function it relies on over a year ago (it was OP and shouldn't have even been accessible anyway). Try other authors who are using camera blocks and radar mods posted within the past year.
CaptPatrick01 Oct 11, 2017 @ 4:53pm 
Did everything it told me to do, Doesn't work.
Juggernaut Sep 20, 2017 @ 5:01pm 
COme back AlEx!!!
Knapp Aug 24, 2017 @ 7:49am 
Unfortunate this is abandoned. Could use a radar display like this.
Somewhat Strange Mogeko Aug 18, 2017 @ 7:00am 
Please fix!!
sysigy Aug 7, 2017 @ 2:40pm 
Broken in 1.182.x, several syntax errors :-(
Wingstrike Jul 30, 2017 @ 2:09pm 
Same problem as geniusface :/
Papy Costas Jun 30, 2017 @ 3:09am 
Good work, but in 2017 the lcd RADAR STATS = RADAR DISPLAY but it was fantastic.