Space Engineers

Space Engineers

Rdav's Guided Missile Script
1,247 Comments
Rdav  [author] 21 May @ 11:28am 
I'm currently working on a rework of this script for the modern era, hold tight
Rightraoedhelontidae Minima 21 May @ 7:31am 
In purely vanilla game, when putting a defensive IA block, it causes the turrets (say, large grid Artillery Turret) to have 2000m range instead of 800m.
But the missile only launches when the target is at 800m from the turret, instead of 2000m. Do you know a way to avoid this and make the script fire the missiles when at 2000m?
Rdav  [author] 27 Mar @ 2:27pm 
yeah, depending on the mod ofc, but mostly yes
catlol456 24 Mar @ 5:16pm 
ok, that is a lifesaver, would it be possible to use a modded turret with the script?
Rdav  [author] 24 Mar @ 4:07pm 
it is based on weapon tracking distance, so longer turret AI range = longer targeting range
catlol456 24 Mar @ 4:05pm 
is there a way to increase the lock on distance? i am playing with some mods the increase weapon ranges, and it is super dangerous to get within 800m of the npcs
MrXSmiles420 14 Feb @ 9:27pm 
can the firing mechanic work in a silo ?
meaning if it were in a tube could it still work ?
Rdav  [author] 9 Feb @ 4:00am 
when you launch the missile it detects and permanently locks in things like guidance turret and cockpit (ie for direction)

no way at present, you could add a random offset to target centre, with respect to how big the target is, its possible, but I am trying to only do critical bugfixes maintenence on the program currently due to an over-subscription of various projects,

no way to pre detonate the warhead with the tow guidance as it has no idea how close it is to a target, you can try using a few staggered sensor blocks to achieve the same effect possibly
murukmanjur 8 Feb @ 3:17pm 
First of all, I truely love your script. I use it alot and having fun with it.

I have some questions though.

1. Is it possible to have a fire and forget setup where as an example, having a remote control block and the programming block on the missile. Then detach it from a vehicle/aircraft/spacecraft with a fusion block and activate the script by using a timerblock? I was experimenting with this without luck cause it still used TOW guidance with my craft.
If it's possible, can you tell how.

2. Is there an option, where the missile will not fly in the center of the target?

3. Is there a option to detonate the warhead before impact (just like the turret guidance) with the TOW Guidance?

Best Regards
Spencer 8 Feb @ 4:18am 
Ive had setups where I had a sound block named #A# and the volume turned way down but for some reason it always wants to steal my sound blocks and outta the blue my build is making annoying noises again lol
Spencer 8 Feb @ 4:15am 
So I have used this script to power my missiles for years but the problem is I can not also use a sound block for other purposes. I do not want the annoying noise when it target locks so I dont use one but if I simply place one on the ship the script will steal it for its function. This bit of functionality I think we could do without period.
Ren 28 Nov, 2024 @ 10:18pm 
Can you update this to allow searchlights to be used as missile guidance turrets?
Spanker 1 Sep, 2024 @ 5:09am 
Thanks Rdav ! always having fun with your evil scripts :D
Here is my contribution to your work. Thanks !
https://sp.zhabite.com/sharedfiles/filedetails/?id=3322322307&searchtext=
Natilus 28 Aug, 2024 @ 6:13pm 
Hey @Rdav can you make this script compatible with Custom Turret controllers pleaaaseee
Rdav  [author] 7 Aug, 2024 @ 10:47am 
its strange its defaulting to picking this even after disconnection and recompilation, you can add a 'nouse' tag to the custom data of a block and the script will ignore it, this is probably the way to go
Ignignokt 7 Aug, 2024 @ 6:45am 
HI again, love the script, been doing all kinds of building with it, im only running into 1 problem with it now and its after the firing delay the missile turns right around and straight back towards the firing point, and i know exactly why its happening, i have a drone attached to the rear of my ship with a RC facing the way the missile is going after launch (no real other way to attach it to the ship BUT to the rear), i fix it easily by just unlocking it and locking again, but every time it recompiled through a reload of the save or manually it goes straight back to using the rear facing RC on the drone. point being is there any real way to specify ONE RC/seat to use rather then just the first one it finds? or posting a pin to the answer if already addressed? Thanks for the help in advance!
{H.K.}Warlama 3 Aug, 2024 @ 10:04am 
well i will hope against hope!
Rdav  [author] 2 Aug, 2024 @ 12:00pm 
sadly I think it was an intentional change made in order to reduce network traffic, so I don;t think it will be reverted
{H.K.}Warlama 1 Aug, 2024 @ 4:30pm 
i hope that gets fixed at some point, cause id love to be able to hear it. it would help greatly
Rdav  [author] 1 Aug, 2024 @ 1:20pm 
the way it does the warning screech is is turns on the audio loop plays it then toggles it on and off rapidly to give a warning tone noise,
I believe keen may have changed some of the behaviour so it messed with the timing and sometimes you can't hear the warning lock on noise now
{H.K.}Warlama 31 Jul, 2024 @ 4:32am 
well im back, and i have a question. i have now sorted everything out, and my missles fire successfully at stationary targets, moving targets coming soon. but my question is about the sound block. i attached one and renamed it #A# and recompiled the PB. but i have noticed i cant hear anything from it despite me turning up the volume and range to max. the sound block also seems to switch itself off sometimes when the target turret is not on, or when not targeting an enemy. is this supposed to happen?
{H.K.}Warlama 29 Jul, 2024 @ 2:47pm 
thank you for helping me with this. this script is too awesome to not have working for me. i appreciate it. if i have further issues or questions i will be sure to hit you up
Rdav  [author] 29 Jul, 2024 @ 1:43pm 
no, the turret needs to be tracking a target
if it is doing this, it will normally be shooting, it should also work if the turret is actively tracking but not firing too, but the best debugging indicator its correctly tracking is the turret firing
{H.K.}Warlama 29 Jul, 2024 @ 1:37pm 
so its correct if the turret IS shooting? is it not supposed to simply track without firing?
Rdav  [author] 29 Jul, 2024 @ 1:14pm 
the turret should be shooting the target
if its not shooting the target then the script won't see it as 'tracking' an enemy
{H.K.}Warlama 29 Jul, 2024 @ 11:25am 
alo something to note, for what ever reason, when i launch the missles, my launching ship just falls out of the air, as if you hit the off button. the ship has more than enough thrusters to keep itself aloft, no idea why this is happening
{H.K.}Warlama 29 Jul, 2024 @ 11:16am 
i have tried setting this all up in a new world with no available DLC, the tracking turret in question opens fire on the enemy target no matter what turret i use, no matter if i block off the turret, or renaming it, or recompiling the PB.
{H.K.}Warlama 29 Jul, 2024 @ 10:57am 
i have also uninstalled ALL DLC to see if that can clear anything up, will let you know my finding
{H.K.}Warlama 29 Jul, 2024 @ 10:49am 
i tried to encase the turret with armor blocks to keep it from firing, and it just shoots through regardless.
{H.K.}Warlama 29 Jul, 2024 @ 10:48am 
i went into my world, i looked for any DLC blocks but couldnt find any. could you tell me what blocks they are? i also replaced the turret with a different one, named it #A# and recompiled the PB. the turret immediately opened fire on my target. i made to sure to enable target stations, but it makes no point as the turret just fires at the target no matter what i do.
{H.K.}Warlama 29 Jul, 2024 @ 9:50am 
the launching ship was made in that world, it was not ported over from another world. you said the turret was bugged, how did you fix it? did you replace it with a different turret? if so which one? i will go into my version of the world and try to apply the fixes and let you know what happens/
Rdav  [author] 29 Jul, 2024 @ 7:13am 
also you can get more endurance out of testing worlds by disabling damage while troubleshooting these things, means you don;t need to continually replace your target!
Rdav  [author] 29 Jul, 2024 @ 7:12am 
oh you had target stations off on the turrets, and your target was a station grid, turned that on and it immediately worked in your test world
Rdav  [author] 29 Jul, 2024 @ 7:08am 
okay I took a look

There is something wrong with the turrets you have on those ships,
They are bugged, and they are refusing to target enemy blocks, even with a clear shot
was the blueprint of your launching ship made in a modded world perchance?

I fixed it in my own world by:
replacing dlc blocks with vanilla
replacing the turret, renaming turret to #A#
recompiling pb

the missiles then worked tracked and hit fine
Rdav  [author] 29 Jul, 2024 @ 6:50am 
I'll take a look now
{H.K.}Warlama 29 Jul, 2024 @ 6:41am 
https://sp.zhabite.com/sharedfiles/filedetails/?id=3299139760

here is the link, i wish you luck on trying to solve this, as at this point im about ready to pipebomb my own mailbox out of frustration.
{H.K.}Warlama 29 Jul, 2024 @ 6:13am 
roger that, i will link you when its ready
Rdav  [author] 29 Jul, 2024 @ 2:13am 
The MIG is likely a little outdated, something with supergidding doesn't quite sit right these days,

I would say definitely test in an unmodded world, if you wanted to upload your unmodded world where they are not working, unlisted to the workshop, and give me a link I could take a look,

My initial guess is possibly ownership related issues, but often you'll find that when trying to debug these things you start changing stuff and accidentally start compounding problems together, it can be quite frustrating, either way, if you try it in an unmodded world, get as far as you can then upload and send me a link I should be able to take a look,
{H.K.}Warlama 28 Jul, 2024 @ 6:27pm 
I have started a new world. no mods. i have enabled supergridding option. i downloaded the mig aircraft and took it apart to get hold of your interior turret. i placed it on my vessel. i double checked all settings and looked over the PB to make sure there are no errors.I built missles identical to the ones on the mig. i attached them to my ship. at this point, the turret from the mig fires on my target im using to test, the missles no longer fire at all.
{H.K.}Warlama 28 Jul, 2024 @ 2:11pm 
The list of mods i have in my world are as follows:
The ore scanner. (Ore detector)
TBH - Industrial Batteries
Paint gun - realistic painting for survival + special creative
Build Info
Control module - Basically key binding for ships
High torque rotors
(OBSOLETE) THRUSTER FORCE MAGNITUDE X 1000 replacement
Q-tech utilities 3.3
Rdav  [author] 28 Jul, 2024 @ 9:16am 
If the turret is not tracking the target that does mean there is something else wrong here, any mods at all in the world?
The missiles will never lock on unless the turret is actively tracking the target, as if it is not tracking the target the script cannot see that it is 'tracking' a target, and thus use that for guidance
{H.K.}Warlama 27 Jul, 2024 @ 1:20pm 
for whatever reason, the turret wont track the target at all now, when it did it would just shoot the target. i really have run out of ideas on what to try to fix it. i have a sound block, but it wont make a sound.at this point i think im more out of patience than anything else. if anyone has any idea please let me know
{H.K.}Warlama 27 Jul, 2024 @ 10:42am 
Hello, im loving the idea of this script. i have been sitting here for 2 days trying to get this to work. my missles will fire from my ship but they just fuck off into the distance, the PB gives me no errors or issues at all. i have named everything #A# i have placed lateral thrusters on my missles as im testing on a planet. i have placed the current weight of the missles in the custom data field of the gyro. (you say the weight of the missle is in Kg in the Info tab. im given just a number under grid mass. 8397) i have the tracking turret on my ship, and its following my targets on its own and its named #A# i also do not have WC installed i have read through everything i can find in hope of solving this. but at this point its looking rather hopeless. is there anything i missed? or anything you can suggest? please and thank you.
Ignignokt 21 Jul, 2024 @ 8:53am 
needed to recompile 'after' adding the new tag, thanks!!
Rdav  [author] 21 Jul, 2024 @ 1:04am 
you'd need a new tag for each side
Ignignokt 20 Jul, 2024 @ 8:52pm 
Is "only' 1 turret with the tag compatible? im trying to set up a 2 sided setup but its only really using one turret with the tag rather than the 2 with the same tag when on both sides
.
Lazlo 20 Jul, 2024 @ 5:33pm 
ah good point.. i forgot about that.. sorry i will try again
thank you
Rdav  [author] 20 Jul, 2024 @ 2:36pm 
running any mods?
Lazlo 19 Jul, 2024 @ 5:34pm 
it is amazing script.. i cannoy get it to work myself because i am a skill issue.. it just goes up and foreward and wont lock on i gues.. no clue..
[BR]SharkStrike 7 Jul, 2024 @ 12:16am 
Any chance of an update, so it works with the 1x1x1 small grid connectors, and turret spotlight?