Space Engineers

Space Engineers

BlueG_Radar (stable; see description for news)
94 Comments
BlueGM  [author] 16 Sep, 2020 @ 3:53pm 
I haven't touched this in a long time, so to the question of whether or not it still works, probably not. There have been numerous updates to the Mod API since I wrote this. I've thought several times of updating it, but right now that isn't possible. As of yesterday, I don't have a computer capable of running Space Engineers at the moment. I have been playing Space Engineers again, so maybe I'll look at it again in another month when I have the required hardware again.
ThePropheticWarrior 14 Sep, 2020 @ 6:29pm 
I would love to use multiple (perhaps 4 or 5) sensors on a rotating rotor and/or rotating dish, like in real world! It would also be awesome to have the option of selecting one directional sector at a time (different radar consoles looking at different sectors, like Fighters use) - and main for (all sectors) general viewing, as well as passive/active modes - like in the real world! It would also be nice to implement this in planet/wall maps! I'm going to also suggest this in the other radar mods - perhaps some cooperation can be done between the Modders - and the Community!
RobinHorn 1 Feb, 2017 @ 6:05pm 
Does this still work? It doesnt seem to do anything. I have a sensor with [radar] in the name and a beacon with [radar] in the name as well. Any thing else that I am supposed to do?
RazersEdge 17 Jan, 2017 @ 11:26am 
Any chance that we could get an update that is optimized for the new updates to the game? I tend to get crashes when we run this mod on our server. Even though it makes life SO much easier on everyone because then you can find hostiles.
Grindstone 2 Aug, 2016 @ 7:26pm 
Is this mod dead?
imivi 18 Jan, 2016 @ 4:07pm 
To BlueG:
The latest SE update seems to have broken this script because the MyRelationsBetweenPlayerAndBlock enum got moved to VRage.Game. If you want to update the script, this is fixed by just adding "using VRage.Game;".
BlueGM  [author] 25 Oct, 2015 @ 3:02pm 
Side Note: I haven't played SE in months now. Been too busy with work and school. So I've forgetten some the details of how this mod works. However, my homing missile example uses relative coordinates to home in on its target, so you might want to check that out.
BlueGM  [author] 25 Oct, 2015 @ 3:00pm 
@tom: I assume you mean that the radar is on the battleship. The 'g' tag gets the position of the target (not the ship it is on) using the game's built-in coordinate system. So, if you move the ship, it won't affect the position reported for static objects such as stations and asteroids. If you remove the 'g' part of the tag on the sensor, then you will get the coordinates of the target relative to the sensor on the ship.
tom.gaertner 25 Oct, 2015 @ 10:40am 
I tried to build a Battle ship, got it all working if the ship stays on its position. When I moved the ship I discovered, that the relative positions to static targets wil not be updated. I used [radarg] to get the positions for GFCS. Is your mod just created for stations or what could I have done wrong ?
Exelsiar 17 Oct, 2015 @ 9:04pm 
Hi I've a small issue, the sensors only detect neutrals when their set to detect friendly too.
BlueGM  [author] 9 Oct, 2015 @ 12:08pm 
@Kira: Script mods predate in-game script by a couple months (err... I think it was a couple months... maybe only 1). Keen set up the tag "Script" for these mods and later, when in-game scripts (scripts on programmable blocks) were added, they added the "in-game" script tag. Of course, that doesn't mean that everyone is using the right tags. BTW, mods of this kind really are scripts... they're just at a different level than in-game scripts.
BlueGM  [author] 9 Oct, 2015 @ 12:02pm 
@jtfroh: I didn't think my answer all the way through when I responded before. While what I said was correct, it occurred to me that your confusion might be because while my mod changes the behavior of the beacon (allowing it to also function as a radar), if you want to do more than just display coordinates with it, then you also need to write a script on a programmable block to read those coordinates and do something with them. My homing missile is an example of this (as is cookiehunter's). The sample code in the description also shows how to do this.
BlueGM  [author] 9 Oct, 2015 @ 11:58am 
Sorry to those of you new to the mod. Due to other concerns in my life, I'm not putting nearly as much time into SE as I used to. You should look at my examples. If you want a more complex example, then also check out cookiehunter's homing missile.
Kira 9 Oct, 2015 @ 11:55am 
... so why is it listed as a script? I'm a little confused by that.
BlueGM  [author] 9 Oct, 2015 @ 11:55am 
@hazmozavr: The tag is just something that you add onto the name of the beacon using the terminal. That is, you name the beacon whatever you want and then you add, for example, [radar] (including the square brackets) to the end of that name.
BlueGM  [author] 9 Oct, 2015 @ 11:53am 
It is a mod. It uses APIs (programming interfaces) that are not available to scripts in the programmable block.
jtfroh 7 Oct, 2015 @ 7:32pm 
So I'm confused. Is this a mod, or is it a script for the programmable block?
hazmozavr 5 Oct, 2015 @ 4:21am 
How i can set the tag
BlueGM  [author] 1 Oct, 2015 @ 6:29pm 
Not orientation, no. You could calculate the direction that something is moving by comparing where an object is one frame and then the next (or a few frames later), but not orientation. Also, matching orientation has more problems than you might at first think (as I discovered when I was working on my AutoDrone mod). SE doesn't require that you place blocks in any particular orientation relative to its axis system or other blocks, so just knowing the orientation of the axis system that the grid system uses is usually not enough (unless you've engineered it that way or got lucky).
Krutchen 30 Sep, 2015 @ 9:54pm 
Is there currently a way to have the radar report target orientation? Just wondering because it would be extremely handy for a multitude of things, like matching station orientation with trade ships, or letting AI fighters make use of blindspots.
zakiducky 22 Sep, 2015 @ 5:46pm 
This is probably a stupid question to which I already know the answer, but does this utilize features/ capabilities the beacon (or game) already has somehow, or add new features/ capabilities to the beacon, making it essentially into a new block? Because this obviously doesn't add any blocks to the game, but it allows the beacon to do things alongside with sensors that would seem to function as a new block, so to speak, in a way no vanilla block can do currently. I came from the link in your tracking script, so at first I thought this was another script needed alongside the first one, but then realized this is a mod rather than a script, and that it changes the actual vanilla block. Plus, that "Mod Category: Script" tag didn't help with my initial confusion. XD
A0 20 Sep, 2015 @ 11:53am 
is it possible to paste the cordinates to remote blocks directly? trying to make a homing missile using gps.
Maroño 18 Sep, 2015 @ 6:14am 
Nerdgasm...
Raven 17 Sep, 2015 @ 1:41pm 
you should suggest to Keen that they make a radar like the scanner in Elite: Dangerous
CaptainBinary 16 Sep, 2015 @ 5:45am 
lol not asking much huh. BlueG good work on the mod, looking forward to the next version
j_south 2 Aug, 2015 @ 1:45pm 
can you please create a step by step guide for using (from construction to and including programming) this radar 4 sensors to track nearest 4 items and display the range bearing and azimuth on an lcd screen please can you make sure that each of the steps is as short no more than 3 sentances and concise as possible so that it can easily be understood :steamhappy:
¥ TendÅk ¥ 15 Jun, 2015 @ 7:40pm 
Video demo maybe better to descrive
BlueGM  [author] 10 Apr, 2015 @ 10:57pm 
If you use the 'g' option for both the beacon and the sensor (both are tagged [radarg], then yes.
Based_Stickman 10 Apr, 2015 @ 4:52pm 
Does this mod provide actually gps cords so i can upload them to missles?
Lynnuxx 8 Mar, 2015 @ 11:37am 
Ok, here's a demo of a ship-based radar system with target selection, tracking/locking and turret control:
BlueG radar used by Black Adder
Check the discussion section for quick instructions.
BlueGM  [author] 28 Feb, 2015 @ 2:18pm 
Actually, if you notice, I said in addition to whatever rights and licenses result from the publishing of my mod on Steam. In the past, Keen has said this gives them the right to use that content. I'm not sure where that comes from exactly... but, its moot. First of all, even if the Steam license didn't give them permission, I don't think that they'd have any problem producing their own version without infringement (its not a particularly orginal idea, so I think they'd just have to avoid using my code). Also, they'd have only to ask if they wanted explicit permission to use my version. I'm a programmer. Getting my name out there as a programmer is valuable to me. So, really, that's just not going to be an issue. The non-commercial license is really aimed at other modders to encourage open and free exchange of awesome code and ideas. We all have our own vision of the way things should be.
Lynnuxx 28 Feb, 2015 @ 9:22am 
Another question: the license means that Keen cannot incorporate your code/solution if they want to add radar to the game ? (non-commercial use only)
Lynnuxx 27 Feb, 2015 @ 5:00pm 
I've changed your script a bit to add all contacts to the sensor by adding [radara] (like a ll), not just one. Analog to your system, if you name the sensor [radara10], you'll only get the contacts from #10 on. I didn't test [radara+] yet, though.
Also, if the sensor is named e.g. "<name> [radara2]" you'll get contacts of format
"GPS:<name> n:x:y:z:" with n=3...up to 20 (radar tag index+1).
I don't want to publish a seperate public radar mod unless you don't want to incorporate these changes into your script. So how can I send my script to you ?
ShuffCha 26 Feb, 2015 @ 2:17am 
the problem with rotor mounted turrets are the scriptoverflow. A easy way to realyse rotor-turrents is to put the radar-complex directly to the turrent, its easyer with the math. Otherwise u have to calculate the matrix for turretlocation in relation to the radarblock. Non the less u have to calculate motionprediction.
BlueG Thanks so much. I would realy apreachiate if u could help me out with the matrix and vectorfunctions ... its hard work for a semi-mathematican and programmer :)). Ill post an example for a turretsource, if u like to.

Thanks BlueG
BlueGM  [author] 22 Feb, 2015 @ 8:41pm 
For player-made turrets mounted on rotors, yes, it's possible. It's really just a matter of math to find the correct angle to set the rotors to. The math for aiming turrets is harder than you might at first think, though. It sounds like you want to aim at ships and they move. Consequently, you need to lead your target. CookieHunter already did that math for his torpedo. It should be quite siimilar to what you would need. See the discussions for a link.
Baleur 22 Feb, 2015 @ 3:17pm 
Is there anyway to use this to get automated turrets tracking targets?
For example, say i set up a radar system on my ship, it detects a hostile large ship 10km away and relays the vector.
Is it then possible via the script you posted as an example to get that vector, to have it be used by the program block to "aim" another sensor's facing front towards that vector?

In effect, this would mean that.
1. Your ships radar system locks on to a closest target.
2. Your ships turrets recieves the target and pivots to face it.
3. Firing is easily triggered.
SEMTEX 10 Feb, 2015 @ 12:47pm 
Nice Work !
BlueGM  [author] 1 Feb, 2015 @ 9:07pm 
Also, I don't feel like I have to do everything myself. That would be counter to my goal.

My main goal to help the audience of this mod and the others that I'm working on to build great things in-game. That audience includes me as well as you and others who are using this mod to build things.

Regarding this specific example, updating the player's collection of GPS coordinates actually isn't part of that goal (nothing is being built; I am doing it myself instead of just enabling others). But, there are people who use this mod who can't program and just use it to get the coordinates. If Keen provides the interface for doing so, it would be easy enough for me to add that feature and useful enough to everyone (myself included) that I would.
BlueGM  [author] 1 Feb, 2015 @ 8:56pm 
Yes, well I'm also hoping they'll open up the text panel to both script mods and in-game scripting to be able to modify. It would simplify so many tasks. Such as when you want to put the coordinates into a text block (I also want it for communication, configuration, logging, and data storage; it's potentially a very useful block) But, as you point out, for this purpose it is, at best, an intermediary.
Lynnuxx 31 Jan, 2015 @ 6:07pm 
You don't have to do everything on your own ;-)
I copied the [radarg] coordinates manually to a textpanel and changed it into GPS format. Now you can see all the waypoints in GPS and show them on the HUD if you want. Next step is to do that with a programmable block.
One problem here: all updates of a contact are not overwriting the current waypoint but are added as a new one with the same name. Deleting waypoints is only possible with the API for GPS, I think.
So this textpanel is an intermediate solution to show the capabilities.
BlueGM  [author] 31 Jan, 2015 @ 5:54pm 
I'm hoping they'll open up the GPS feature to modding. Then I'll simply add a flag to the sensor that will cause it to also update the owner's GPS. But, I don't know what I'll do about others who may want to see the same point and have it updated (e.g. faction members). The problem then has to do with subscription. How do they subscribe to see it? But, it's premature to speculate about the solution until I see what Keen does next.
Lynnuxx 31 Jan, 2015 @ 3:43am 
I'm thinking forwards a bit. You did and do a great job here. Normally, what you did should have been done by Keen because what's missing is the radar display on the HUD. And the HUD is currently not open for players. There are some crazy players here which would be capable of that but your radar sensor has to be connected to the HUD in a way that it can be updated fast with a minimum of CPU load.
So there needs to be an API or internal connection between them (and this is KSH domain). A radar display like in good old Elite would be fully sufficient at first. The relative coordinates would come in handy for that purpose.
BlueGM  [author] 29 Jan, 2015 @ 2:14am 
@Lynnux: After some thought, I decided I would add GPS to the beacon after all. Personally, I don't like having the coordinates displayed on the beacon, but after I thought about it, I saw no real reason not to do it. I'm pretty sure you got most of your wishlist. The only problem you're likely to still have is that the radar will still detect parts connected by pistons and rotors on your own ship. I know how to fix that, but it is computationally expensive in the current mod (which is why I think I'll wait until the next/alternate version).
BlueGM  [author] 28 Jan, 2015 @ 1:53pm 
As for the radar detecting parts of your own ship, that's the same thing that sensors do. For the most part, I've tried to make the radar's behavior like the sensors, but longer range and with coordinates. I suppose I could add an option to filter connected grids so that the default behavior remains the same, but I probably won't until the next (alternate) version. It will be doing things in a fundamentally different way that is better suited to filtering like that (even though it will appear the same to the user).
BlueGM  [author] 28 Jan, 2015 @ 1:53pm 
The coordinates reported should be in the sensor's coordinate system (both their position and orientation). I think originally I was reporting position relative to the beacon, but that changed some time back. Now position is (or should be) relative to the sensor.

I thought about detecting players several times. It isn't hard to do (just a few lines of code), but decided not to. The reason is historical. I was using that checkbox as a setting to only detect friendlies before Keen added relationship options to the sensor. Its been long enough since Keen did so that I think I'll do that now.
BlueGM  [author] 28 Jan, 2015 @ 1:53pm 
Sorry, Lynnuxx. I've been busy with school (I'm an adult student, so I work too).

I was thinking of creating a GPS feature in the next (alternate) version of this mod, but wasn't planning to add it to the beacon. I was planning on having it be a separate device (in keeping with the philosophy of games like this that one block does one thing). I plan on putting that next version in an alternate mod so I don't break what people are doing with this mod. The new version will have other kinds of sensors as well, and be more server friendly. But now that I'm back in school, I can't make any promises about when that will be.
Lynnuxx 25 Jan, 2015 @ 5:46pm 
Been too quick twice.
1) The radar couldn't detect an enemy ship. Friends are detected.
2) Just adding the sensor coordinates to the beacon position doesn't work, of course. The direction of the sensor has to be taken into account...

One stupid question:
The coordinates returned by a sensor are based on the beacon position and the direction of the sensor, right ?
Lynnuxx 25 Jan, 2015 @ 3:32pm 
Is it possible to detect players also ? (search & rescue)
Lynnuxx 25 Jan, 2015 @ 2:07pm 
Works well here (use on client). Is it possible to get the current GPS position of the beacon ? Then add the coordinates from the sensor and set a waypoint in GPS for your faction... voilá.
It's a nice addition to my ECR ship though it has piston arms already creating 9 (friendly) targets.
CasiPeruano 23 Jan, 2015 @ 12:22am 
Very cool, just used this to find my first derelict ship.