Space Engineers

Space Engineers

[Obsolete] Active Radar Homing Script
48 Comments
Reclaimer 117 18 May, 2016 @ 8:46pm 
Oh, it also adds another merge block called "Torpedo CC Interface". This is the one that is part of the missile, the hardpoint one is the one thats part of the ship. I have no experience coding, so I have no idea if one or both of these could be the culprit/s.
Reclaimer 117 18 May, 2016 @ 6:13pm 
The large torpedo parts mod adds a "Torpedo Hardpoint", which I believe adds it as a new merge block. Maybe its because this "Torpedo Hardpoint" isnt in the script? If so, would it be possible to have it added? It would be awesome to finally be able to use these torpedo's to their full potential. No other script seems to work for them, and I suspect the "Torpedo Hardpoint" may be the culprit.
Reclaimer 117 18 May, 2016 @ 5:10pm 
Hi man, awesome mod. Im having some trouble setting it up however. I followed the video step by step, double checked and dont seem to have missed anything. But Im trying to use this script with the large torpedo parts mod, do you know if that might cause the script not to work?
BaronBoogeyman 29 Apr, 2016 @ 7:25pm 
@Puff The Magic Dragon (Rassy): So far in my testing it seems to work just fine if the missiles are at literally any orientation at all, however I would recommend they be as close to 0deg off as possible due to chance of accidentally locking a wrong target (given my understanding of how the system works)
GirthQuake 18 Apr, 2016 @ 5:13pm 
Question. Will any of these, specifically the Coordinate Lock method, work if the missile is mounted 90deg from the target vector (eg a Vertical Launch System)?
scavenjer 17 Apr, 2016 @ 5:43am 
It seems to be working with your set up, i'll try to make one from scratch now, so far so good ;)
scavenjer 13 Apr, 2016 @ 6:57am 
Thank you Alysius i will test this as soon as i can and i'll comment if it works for me. :)
Alysius  [author] 13 Apr, 2016 @ 5:40am 
An SE bug prevented gyro from ahving full power while turning. It is suddenly fixed after an SE update.
Skitto493 26 Mar, 2016 @ 4:22pm 
well, the script isn't working for me in general.

The missile launches, but does not track the target I fire at.

Here's a test blueprint of my creation: please see what is wrong?
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=653557661
Skitto493 26 Mar, 2016 @ 4:03pm 
Is it mandatory to claim ownership of the missile and ship? Will it work if everything is owned by nobody?
scavenjer 22 Mar, 2016 @ 1:25pm 
This is not working for me, when i build it myself i can't make it launch away or track a target.
When i used your missiles from the demo, and put it to use in space (with thrusters and appropiate naming mind you) it launched, but didn't track. could you make a video on this concept? (update 1.126)
blm1123581321 21 Mar, 2016 @ 8:54pm 
I got the launching working but they have a tendency to miss and then endlessly circle the target is there a fix for that?
blm1123581321 21 Mar, 2016 @ 12:46pm 
I'm having a problem where when I fire it doesn't release the missile instead it turns my whole ship into a missile and kamikazes me into the target I can't figure out where I went wrong.
carn1vore 26 Feb, 2016 @ 7:27am 
I started from scratch with just a basic large ship, and was able to get it to work fine, so it's error somewhere on my part. Beautiful script. This changes everything...
ThGaming 22 Feb, 2016 @ 6:36am 
i also cannot get it to work from large to small grid sadly, so much for my hell fire missle project
carn1vore 21 Feb, 2016 @ 4:25pm 
Incredible. I've got it working on small grids, but I've got a large ship which launches small grid missiles. I can't seem to get it working this way! I've tried using a large ship remote control and a small ship remote control attached to the launcher. Can you give me any advice???
Takao 28 Jan, 2016 @ 4:38pm 
I have tested this skript multiple times (including the Launch Trigger script), but it doesnt seem to work very good.
Most of the time the missile is not hitting the target (stationary). Its just flying forward or in an angle away from my ship.
I build the setup exactly like in the video shown.

Furthermore, what happens, if Im not exactly on the target? Can the missile autolock on a target (real fire and forget)? If I want to hit a fast moving target pointing directly at that sounds very complicated.
silentdeth 20 Jan, 2016 @ 12:05pm 
@Alysius I must admit I am a bit confused by your response. Did you look at the example code at the bottom of the post? It is for a game where you know the vector3 of the missile and the target. It outputs a lateral acceleration vector: a correction vector to hit the target.
Erebus Alpha 4 Jan, 2016 @ 6:28pm 
I am currently working on a torpedo with a primary and secondary fire mode. The projectile has two programmable blocks on board, one with this script, and the other with Whip's manual vector-guided script:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=546494746

The idea is to fire the missile in manual guidance mode when facing very large targets, when it is necessary to direct fire at specific areas of the enemy ship/base. For smaller and more nimble targets, auto-homing mode is better; a single hit at center mass will almost assuredly cripple or obliterate them.

I tried renaming your LREMOTE (and several other blocks) so that one remote control block could serve as the control point for either script, regardless of which one is running. Unfortunately, even with copy & paste to ensure that the block and group names do match precisely, I cannot get the self-guided mode to work properly.

I'll continue troubleshooting this issue.
Alysius  [author] 4 Jan, 2016 @ 12:27am 
@slith Still working on a revamped script that only needs one V_REF block and also have trigger features (e.g. activate blocks when missile is X distance from target etc...). Not fully completed yet.

@silentdeth Missile uses a different kind of Lead target instead of angles for PN, as the locking algorithm allows getting exact coordinates.
silentdeth 29 Dec, 2015 @ 5:13pm 
You might find this interesting: http://www.moddb.com/mods/wicmw/features/flint-lead-pursuit-guidance-principles
It covers some different algorithms for missile guidance.
slith 29 Dec, 2015 @ 1:31pm 
spinAmount seems to only be activating while it is in mode1 - kinda pointless, should really be mode3.

Managed to achieve missile spin by adding:
SetGyroRoll(spinAmount);
SetGyroOverride(true);
after the lines
else if (mode == 3)
{
at 385

Makes it less accurate, but still good enough at 30rpm or less.

An additional set of commands that lets the user trigger blocks at set distances to target might be a very nice feature.
Example:

distance1 = 1000m
distance2 = 100m

if (distance <= distance1) {
"start timer block extending piston with decoy on top and activating said decoy"
}
if (distance <= distance2) {
"rename antenna block to 'BOOM BI**H' and activate antenna"
}

You get the idea :)
SievertChaser 20 Dec, 2015 @ 5:47am 
Holy hell, this can actually work...
Alysius  [author] 17 Dec, 2015 @ 6:16am 
Added additional parameter to set initial lock on minimal distance with default value of 50. This is to prevent ship from accidentally locking onto the missile itself as it is very close to ship during launch.
EnjoyCoke 15 Dec, 2015 @ 9:43pm 
That is so awesome!
Alysius  [author] 15 Dec, 2015 @ 9:37pm 
@EnjoyCoke Remote control block has a method called GetFreeDestination. You can input a target coordinate to move your ship to, then the method will return you a coordinate that will be free to occupy without collision. Using this method you can purposely calculate a collision point.
EnjoyCoke 15 Dec, 2015 @ 12:37pm 
How do you get the coordinates from the target? Normally people use a drone and assign the drone's own GPS coordinates.
Are you saying there's a way to get a "target in front of me"-s GPS coordinate from looking at it?
Alysius  [author] 15 Dec, 2015 @ 7:49am 
@Trozzo Yes, using the boolNaturalGravityDampener setting to point dampener thrusters against gravity.
CONS 14 Dec, 2015 @ 8:42am 
Amazing, can the script manage if there is gravity or not?
kortikal 12 Dec, 2015 @ 4:12pm 
10/10
Venom415 12 Dec, 2015 @ 7:05am 
BEHOLD THE POWER OF C# WELL DONE SIR, hopefully it will inspire others to learn C# and give it a try on SE, it opens up so many possabilities and you just showed how great it can be, rate this script 10/10 :steamhappy:
Alysius  [author] 12 Dec, 2015 @ 2:31am 
@silentdeth It uses intersection of missile and target vector to calculate impact point. Exact same method as the Sogeki targeting scripts. Since the locking method allows getting of exact coordinates, this method of target leading is used instead of PN.
deadlypanda23 11 Dec, 2015 @ 7:58pm 
Fucking incredible Sir.
Hellothere 10 Dec, 2015 @ 1:16pm 
Woha. I didn't think this was even possible. So awesome!
PareableDeadMan 9 Dec, 2015 @ 4:30pm 
ITS TO COMPLEX I NO BRAIN NOW
:steamhappy:
silentdeth 9 Dec, 2015 @ 3:21pm 
Does this use a variation of PN guidance?
CONS 9 Dec, 2015 @ 3:31am 
OK that's something really close to the AMAZINGNESS!
Great job!
Nemo 7 Dec, 2015 @ 7:28am 
OK, I understand bounding sphere mechanism and have solved problem. Thank you!
Alysius  [author] 6 Dec, 2015 @ 7:53am 
@Pennywise Np! I am thinking of a crazy script idea, where players will just build their torpedos anyway they want following some rules (at least 1 gyro, thrusters etc). Then trigger a "Missile Configuration Script" to select the homing type they want, then script auto detect and rename the blocks to whatever it is required. Those things not doable by script will be listed as instructions, like: 1) Group GYRO1, GYRO2 under group named GYRO. 2) Add PROGRAM1 as Run under CLOCK as an action.
Alysius  [author] 6 Dec, 2015 @ 7:46am 
@Nemo Can be used on rotors. Except that since it is a different grid, the rotor mount is detecting your launching ship instead, as it is using bounding spheres. Its is an API limitation at the moment.
Nemo 6 Dec, 2015 @ 7:28am 
One more question. Is this script support communication between rotors? In my case, I put REF_REMOTE and REF_FRONT to rotor grid that different from missile launcher grid. It can launch missiles but doesn't homing to target.
Nemo 6 Dec, 2015 @ 4:33am 
Yep, I was just thinking the same thing. The division is as below.

[Remote Targeting (SARH)]
Strong : Precise targeting, manageable multi-target, Off boresight
Weak : Little hard to operate

[Active Radar Homing (ARH)]
Strong : Fast targeting and launching, Easy to construct missile barrage
Weak : Longrange attack
Pennywise 6 Dec, 2015 @ 2:53am 
Hi, Alisius. This is completely your script. Why should i be a contributor. But thanx anyway.:steammocking:
Alysius  [author] 6 Dec, 2015 @ 1:06am 
@Nemo The former setup using Remote Targeting Script is like the Semi-Active Radar Homing. It is still preferable if you want to suddenly switch target mid flight and it has more stable locking. Also less CPU intensive if multiple missiles are launched.
Alysius  [author] 5 Dec, 2015 @ 9:27pm 
@Nemo Totally removed data uplink after the initial lock. You can also use T coordinates for initial locking. But once switch over occurs, missile is on its own.
Nemo 5 Dec, 2015 @ 7:47pm 
It's cool. The amazing point of this script is more easy to operate than former one.
On the other hand, is it removed any information that indicate missile coordinate? I'm just curious about that.
NordicBeast 5 Dec, 2015 @ 2:48pm 
Very impressive! I can't wait to try this script!