Space Engineers

Space Engineers

1,647 ratings
Whip's Turret Based Radar
5
4
3
2
18
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
442.714 KB
Apr 8, 2019 @ 10:56am
May 21 @ 11:03pm
51 Change Notes ( view )

Subscribe to download
Whip's Turret Based Radar

In 1 collection by Whiplash141
Whip's Scripts
22 items
Description
Whip's Turret Based Radar System

  Description
Howdy!

This script uses turret targeting to populate a 3D radar and is designed to increase the user's situational awareness. This script also works with custom turret control blocks!

This radar bears many visual and functional similarities to those of Elite Dangerous. Targets are plotted upon an angled plane centered around your ship, and vertical lines denote the target's elevation above your ship.

Also, targets are shared across antenna networks; if one ship detects a target, any other ships within its antenna range can see that target on their radar.

Targets locked with WHAM or LAMP will also be displayed.




  Setup Instructions
Required Steps
  1. Place this script on your ship.
  2. Add turrets and custom turret control blocks to your ship.
  3. Add Radar to the name of text panels or blocks with text surfaces that you want the radar displayed.
    • Blocks with text surfaces include: Cockpits, flight seats, programmable blocks, consoles, etc.
    • Configure which text surface the radar is displayed on within the block's custom data (You don't need to do this for text panels).


Optional steps
  • Place one or more ship controllers on your ship (Cockpits, Flight Seats, or Remote Controls).
    • These will be used to orient the way the radar is drawn.
  • Place the word Reference in the name of the specific ship controller that you want use to orient the radar.
    • If you do not specify, the code will automatically detect and use the seat you are controlling the ship from!
  • Place some sensors on your ship if you want to also use sensors to detect targets.
  • Place one or more antennas to enable the antenna network target sharing functionality.

NOTE: If you don't have turrets on your ship, the code will still work; however, you will only be able to see targets that are broadcast to you by other friendlies.


  Custom Data Config
You can change how the radar looks and behaves within the Custom Data of the programmable block this script is running from. Simply open the custom data, modify it, and click "Ok". The code will update to reflect these changes within 10 seconds at most.



  Multiscreen Display
You can also combine multiple LCD panels together to create larger surfaces to draw sprites on.

In order to create a multiscreen display:
  1. Make a wall of LCD panels (They must all be the same type of LCD).
  2. Add the name tag Radar to only the top left LCD panel in the wall.
  3. Add the following to the custom data of that top left LCD panel:
    [Radar - Multiscreen Config] Screen rows=1 Screen cols=1
    • Change "Screen rows" and "Screen cols" to match the shape of your screen wall.
  4. Run the argument refresh to process changes.
This will now be treated as one massive LCD screen!



  Arguments
To use an argument, enter it in the argument box and click the "Run" button.
Argument
Function
Example
range [number]
Sets radar display range to the specified number (in meters)
range 1200
range increment [number]
Increments the radar display range by the specified number (in meters)
range increment -100
range default
OR
range auto
Resets radar display range to be automatically determined from the max turret range
(Same as argument)

Increasing the radar display range does not magically increase the range that turrets can detect targets!


  What the FAQ?!
Will this script work with sensors?
Yes, simply add sensors to your ship.

How is the radar range determined?
It uses the max range of the turrets on your ship (default) or the range override.

How do I detect enemies and neutrals?
Turrets.

How do I detect friendies?
They need this radar script and they need to have you within antenna range.

There are also other scripts that broadcast valid IFF messages including:

Do enemy ships need this script to show up on my radar?
No. They merely need to be in turret range.

Why don't I see any ships on my radar?
  • You have no allied ships nearby with this radar
  • Your turrets are not shooting at any targets

Can I force the radar to show a different range than my turret range?
Yes. Change the range override in the custom data of the program block.

Will this script use camera raycast (aka LIDAR)?
No, hence the name. Raycast is absolutely awful at blindly scanning volumes without slagging sim-speed.

However, if you use LAMP or WHAM with a raycast (Lidar) lock, those targets will be shown.

Why do the visuals update so slow?
Keen capped the refresh rate of sprite drawn canvases to 6 Hz for performance reasons.

Why is the text so hard to read in the cockpit screens?
The screens in the cockpits are inherently darker than the LCD or text panel screens. Also, their resolution isn't all that great either.

Will this work with most modded/longer range turrets?
Yes.

Do WeaponCore turrets work with this script?
No, due to a WeaponCore decision to be incompatible with the script API.

However, user Sigmund Froid has made a script that will broadcast weapon core target info to this script.

How do I send the radar script targeting information?
Send an IGC broadcast message with tag IGC_IFF_MSG and content MyTuple<byte, long, Vector3D, double>.
  • byte: Target info flags. To combine flags, simply add the numbers together.
    Flag values: Neutral=0, Enemy=1, Friendly=2, Locked=4, LargeGrid=8, SmallGrid=16, Missile = 32, Asteroid=64.
  • long: Entity ID of the target.
  • Vector3D: Position of the target.
  • double: Squared radius of the target. Used by the turret slaver for friendly fire avoidance.

Will this work with Configurable Auto LCDs 2?
Yes. See the section titled "Compatibility with other scripts" in the Auto LCD 2 Guide.


  Author's Notes
Be sure to report any bugs below in the Bug Reports discussion. I hope y'all enjoy! :D

(Do not reupload without permission, not even to mod.io)

Searchlights have no API, so no, they can not be supported.
Popular Discussions View All (2)
91
Nov 19, 2024 @ 12:17pm
PINNED: Bug Reports
Whiplash141
10
Jun 29, 2022 @ 12:14am
PINNED: Color Schemes
Whiplash141
1,032 Comments
Jul 14 @ 6:16am 
is it possible to use searchlights instead of turrets?
Whiplash141  [author]
Jun 28 @ 2:43pm 
No because the way that targets are identified via the defensive/offensive combat blocks is incompatible with how raycast and turret targeting provide info, so it could create multiple radar contacts for a single grid. That being said, anyone motivated enough can broadcast IGC targeting data to this script to display, so if they wanted to sort through that themselves, they could provide the de-duplicated data to this script
Jun 28 @ 1:45am 
Any chanse on making this trigger on the defensiv AI scan?
May 21 @ 11:33pm 
Great! Thank you!
Whiplash141  [author]
May 21 @ 11:05pm 
"May I ask you why don't you use targetInfo.BoundingBox to get enemy radius"

Because for many many years, the bounding box returned was that of the targeted block, not that of the grid. Idk when it changed, but I've updated it in v35.7.1.
Whiplash141  [author]
May 21 @ 10:47am 
radius squared
May 21 @ 9:23am 
Please let us know here if you add a radius or a radiusSquared to the IGC_IFF_PKT broadcast :)
May 21 @ 7:34am 
Hello again!
May I ask you why don't you use targetInfo.BoundingBox to get enemy radius (better send squared for performance) and send 0 instead? That will be really helpful for scripts those read IGC_IFF_PKT
I guess performance wise.. but valid data is missing

Currently I use fixed value (50m like sensor radar) to set radius of the target to filter positions so longrange AI block radar targets do not overlap with your radar
May 13 @ 10:25pm 
I will take this opportunity to thank you for this script. It's great!
Also, if I could, I would make a suggestion. It'll great to see max weapon range circles on a radar (a bit more transparent than middle circle, could be optional) and also some kind of config to set custom circles to set range like for fixed weapons.
May 13 @ 10:17pm 
I angree it's inconsistent. But that's really good to populate radar with a lot of targets via one AI blocks pair (combat+movement) at ~2.4km range event without turrets. Thanks to your script we can send them as "dots" without details of a grid type, so it could be easily skipped by targeting applications if it's based on your radar broadcast.
I will look into you broadcasted radius field, if it sends for all turret based targets then we could listen broadcast, collect and filter out untyped(grid type) targets if they in typed range, so there will be no "dots" Inside fully detected target.