Space Engineers

Space Engineers

Not enough ratings
BlueG_Radar Homing Example
   
Award
Favorite
Favorited
Unfavorite
Type: World
File Size
Posted
Updated
52.414 KB
11 Jan, 2015 @ 9:32am
11 Jan, 2015 @ 7:33pm
6 Change Notes ( view )

Subscribe to download
BlueG_Radar Homing Example

Description
This is an example of how to use the BlueG_Radar mod to create a homing missile. To see it in action, do as follows:

  1. Take ownership of the missile (all of its blocks)
  2. Edit the programming block and choose "Remember and Exit" to recompile its code (this is necessary because ownership of the block changed)
  3. Select the "Trigger now" action on the missile.

If you copy and paste the missile after the first two steps, then you'll only need to perform the last step on the copy.

If you use the in-game script on a different missile design, be aware that the direction the sensor is facing is the "forward" direction for the missile.

The missile is quite primitive. Its guidance overcompensates if it is pointed in the wrong direction. It also doesn't take target velocity into account. It is only meant as an example, so I tried to keep things simple and gave lots of comments in my code to help you create your own great stuff.

Something you may miss about the missile itself is that I don't just use the sensor as part of the radar. I also have it detonate the warheads when the sensor is close to the target. This helps ensure that the warheads go off if the missile doesn't hit quite straight or with enough force.

The radar mod used in this example can be found at https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=369578004.

A special thanks to cookiehunter. His help getting and setting the fields in the Vector3D structure made this example possible. He also created a more sophisticated torpedo. Mine may be easier for learning purposes, but his is more likely to hit its target. You can find his torpedo at https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=373716002.
5 Comments
F-16D Block-60 FemboiDILF 16 May, 2015 @ 7:32pm 
Okay. I need help, I can calculate the minute of angle of a projectile's deviation in my head but when I read C# my brain melts. Your comments are helpful and I'm getting a little bit of a grasp on how this all works but what I'm trying to do is make your script write the target xyz in a specific format to a text panel's public field so that I can use Alysius' Cruise Missile script to take over the actual flight dynamics.
BlueGM  [author] 22 Feb, 2015 @ 8:46pm 
cookiehunter's example is probably much better suited for a turret, if you can figure out how to incorporate the math. That's because my torpedo does not try to lead its target. If you want to aim at ships, you'll need to lead your targets. Well... maybe not... if they are stopped or moving straight towards or away from you, then you wouldn't. At a 10km range, like you were suggesting in your other comment, you'll need to be precise.
Baleur 22 Feb, 2015 @ 3:21pm 
Oh my god you already did what i commented to ask about in the radar mod page. Sorry :D
Must try to adapt this for turret usage.
SEMTEX 9 Feb, 2015 @ 5:33pm 
Nice one :D I have used the script on my own torpedo desing and it works fine about the accuracy i can say ok. if have tested this only on Ranges about 1000+ and on non moving objects but the most tested torpedo desings (1 -5 forward thrusters) i have test hit it in the first try. Next i try cookiehunters script but first i have to learn a little bit about C# with the cookihunter script i got an error that something is missing but we will see if i can figure out my own way
Lynnuxx 28 Jan, 2015 @ 2:03pm 
One comment/hint to detect enemies: The sensor has to have ownership "Me" and "No share" or "Share with my faction" and the beacon has to have ownership "Me" with any of the three specific settings.