Space Engineers

Space Engineers

Rdav's Gen3 Guided Missile Script
142 Comments
Dominator1559 2 Aug @ 1:24pm 
Shame. wanted a drone that launched these missiles but they battle with each other. But for anything else its perfect. Extremely simple to setup, no weird script heavy shnenanigans
Rdav  [author] 29 Jul @ 1:22pm 
drone-type behaviour is likely best suited to the vanilla AI blocks
Dominator1559 29 Jul @ 12:39pm 
is it possible for the script to both launch missiles, and allow a drone to fly? i want to make a drone that opens up with a volley of 2 small missiles, and then circles with autocannons.
Rdav  [author] 28 Jul @ 9:56am 
And the LCD does tell you you are locked onto a target?

Send me a worldfile or link or hop in the discord if you are still having issues,
TheMightyMcGrew 28 Jul @ 1:00am 
@Atomhirsch I ticked every available checkbox except sub-grid damage and unknown signals. Also wouldnt the LCD not work if that were true? Isnt that part of the script? Not to mention when I Fire the missile via the command its using the script to do so, its just not following anything.
Rdav  [author] 27 Jul @ 3:03pm 
Its coming in the next update, but there is a workaround I posted in the discord in the meantime
dannyrocker 27 Jul @ 2:45pm 
@Rdav is there a way to change the range of the radar on the chosen LCD/script in general? I am using mods for either 5km AI range or even 10km on some worlds but the screen's radar stays fixed at 2.5km
Rdav  [author] 27 Jul @ 2:25pm 
There must be a world setting messing with it if its not working,
Alternatively the ship could be not locked on properly, but that would be pretty apparent as there wouldn't be a big glaring red icon on the LCD
Atomhirsch 27 Jul @ 12:02pm 
@TheMightyMcGrew: scripts not allowed?
TheMightyMcGrew 27 Jul @ 10:10am 
followed the instructions to the letter, missiles just fire straight up and into nothing/nowhere. Pasted in the ship you built and got the same result. All done in vanilla with no mods. Any idea whats going on?
ItsJustVirgil 23 Jul @ 11:48am 
Understood, thank you very much!
Rdav  [author] 23 Jul @ 11:07am 
the event controller is a funky device and triggers somewhat inconsistently
the script should trigger now any timers named #A# once, on launch, unsure if that's any help, feel free to ask in the discord server if you've got a more specific setup in mind, I should be able to respond a bit quicker over there
ItsJustVirgil 23 Jul @ 10:14am 
Addendum; the same occurs when trying with timer blocks or just letting the script do the "enable all missile blocks" step.
ItsJustVirgil 23 Jul @ 10:11am 
@voxar Just finished setting mine up, yeah it autosorts.

@Rdav nevermind my last question, apologies for asking something I stumbled into the answer on my own. I do have a more technical question worthy of your time though; I have event controllers on my missile set to enable a beacon on merge block detach, but the trigger rate is inconsistent, only about half to 3/4ths of the time will the beacon activate properly, and I'm not sure why. Any advice?
voxar 23 Jul @ 9:54am 
Something perhaps worth noting in the description: When you add more than one missile do you still name everything on every missile "#A#" and the script automatically sorts out what belongs to which missile?
voxar 23 Jul @ 9:48am 
Oh Keen finally gave us a targeting API! Awesome to finally get > 800m lock missiles without spamming a bunch of cameras!

Feature request unless impossible or already added: Fire and guide base/silo/mothership missiles from other grids
(WTH)Virion 22 Jul @ 3:47pm 
Jesus christ, it was"Fire" instead of "fire". Case sensitivity will be the end of me one day. :P

It works just fine now!
ItsJustVirgil 21 Jul @ 8:57pm 
Can the script work with multiple cockpits on the same grid, like both a pilot seat and a WSO seat being able to fire missiles, or does the script only identify one cockpit for use?
Rdav  [author] 21 Jul @ 1:43pm 
UPDATE 1.03

Oh boy this ones a big one;

New Features Added; (all are optional, and off by default, see user edits section to enable them)

- Ordered Launching! add a prefix the merge name (ie 001, 002, 010), the order they appear in the terminal is the order they will launch,
- Automatic connect mode for connectors, (no need to timer spam anymore)
- Selection of LCD used in the cockpit,
- Customisation of gravity correction, allows for ground skimming or anti floating-ship missiles,
- Enable force own construct (prevents script grabbing connected grids stuff by accident)

Bugs Fixed;
- Thrust clamp adjustment, (better performance for large grid missiles)
Rdav  [author] 21 Jul @ 1:07pm 
Chances are it will be something very simple! OR maybe something special with your specific setup,
Try transplanting your missiles on the demo ship I have linked at the top, or visa versa, should allow you to isolate if its the ship setup or the missile,

If you are still having issues please feel free to link me a blueprint, or hop in the discord, I'm able to reply a lot quicker over there and I'll help you find the issue,
(WTH)Virion 21 Jul @ 4:03am 
I managed to make WHAM and LAMP work with remote launching missiles and everything,
and somehow here with the simplest script on earth i'm stuck. The ship is seems to be configured correctly ( The script in the programmable block thinks so at least) , however after locking on to a target it won't respond to the fire command.

No idea why, my missile won't launch.

I followed the instructions to the letter twice. Any idea what kind of a rookie mistake I made here? Not sure where to start debugging it. it's not like there's much I could do wrong.

I'm the only owner of all blocks involved.
(WTH)Virion 21 Jul @ 12:43am 
Really nice script for self -launching missiles. Gj!
Rdav  [author] 19 Jul @ 4:35pm 
you sometimes get issues with the AI blocks if you have more than 1 of each type on the same grid, for your small missiles move your AI blocks to the small grid subgrid, and keep the large on the large grid, I found this works best!
caterpillar 19 Jul @ 12:23pm 
How do you set up multiple types of missiles with Gen3?
I have a testing station I've set up with a rack of small-grid missiles and a large-grid silo, but I've been unable to make it work. I have 2 sets of flight/offensive AI blocks and 2 instances of Gen3 (each with a different tag setting) running on the grid, and there are no subgrids except for the small-grid missile racks.
The small-grid missiles work fine, but the large-grid missile fails to launch entirely, burning its thruster for a bit without moving forwards at all. How do I rectify this?
Kaito 19 Jul @ 4:29am 
Holy crap, Rdav remembered his account password!
Pandium 19 Jul @ 12:34am 
@Jj I've got 10 AI blocks, 40 missiles and a cockpit on 9 separate subgrids, so yeah, that works
Corki99 16 Jul @ 11:35am 
@Rdav I figured as much, but thank you for the response tho
Jj 16 Jul @ 1:09am 
If I place the PB and AI stuff on a large grid ship, and then use subgrids to mount the missiles, will that still work? or does it need to be on the same grid?
Rdav  [author] 15 Jul @ 2:15pm 
Radar won't currently scale no, *currently*
Corki99 15 Jul @ 11:50am 
If you use an AI max range increasing mod, will the lil missile radar thing scale to the size of the max AI range?
Myth 15 Jul @ 10:05am 
He's ALIVE!
Atomhirsch 15 Jul @ 2:10am 
Go on youtube, there are so many videos about ai missiles
Tiger_Fearful645 14 Jul @ 5:28pm 
can you please make it work where you dont have to use programmable block? my server doesnt allow programm blocks to work and i hear timer and ai blocks could work but idk how to set it up
Rdav  [author] 14 Jul @ 9:45am 
You need to increase max range of AI detection with a mod, but that should work
Monk 14 Jul @ 1:04am 
Does increasing the max lock on range of turrets via a mod also automatically increase the range of the missiles that use this script? or is it hard-locked (no pun intended) to the 2.5km mentioned?
thank you for making this script :)
Rdav  [author] 13 Jul @ 2:59pm 
Not possible at the moment I'm afraid, not without some shenanigans
peerbolt 13 Jul @ 2:50pm 
Oh i am SO excited to try this out. I am curious tho, would it be possible to allow the script to use the locked target of a cockpit? That way you could manually choose a target to lock and fire at
Rdav  [author] 12 Jul @ 6:14pm 
that's coming in the next patch
anzellott 12 Jul @ 5:22pm 
How could I adjust the code so that it displays its information on a different screen in the cockpit rather than the main one?
Rdav  [author] 9 Jul @ 11:01am 
You can install 2 instances of the script, just get one to use #A# as a tag and the other to use #B#
You can change what it looks for in the setup options,

same as this will also let you aim at two different consecutive targets
Captain Doombeard 9 Jul @ 9:31am 
Okay this looks REALLY good, but what about when I want to mount and differentiate different classes of missiles?

What if I build a torpedo boat that has a swarm of tiny missiles, but also a couple of big honkin' torpedoes? I want to be able to script those things separately.
phoenix 9 Jul @ 5:46am 
something I Wouldn't mind seeing is a way to have it launch a certain amount at a target and then switch to another one also is there a way to get them to talk to each other so they both don't target the same ship
phoenix 9 Jul @ 5:44am 
I got around it by just staggering them so instead of doing five In a Row it will be free to behind three and just give it a bigger auto launch delay timer @DazeyDream
DazeyDream 8 Jul @ 11:35am 
I was about to ask for automatic fire but you've just added that, nice! Another feature I think is essential is when missiles are lined up behind eachother, there needs to be a way to fire the ones at front first, and prevent the ones at the back launching into the ones ahead. Perhaps by allowing the merge/connectors/rotors/hinges the missiles are connected to on the firing ship to be numbered, to decided the firing order of missile positions.
Could there also be a feature to ensure freshly rebuild missiles don't auto fire unless their batteries or fuel tanks have filled up to a certain percent?
Tripi Pafkaus 8 Jul @ 10:53am 
is there a way in the script to lower max targeting range?
Atomhirsch 7 Jul @ 9:35am 
This is a very good script but i kinda think it destroy the game because its OP.
Im a server admin and think about ban people who use this...
Axelberry4101 6 Jul @ 6:42pm 
look at Texas Instruments over here goddamn
Relas 6 Jul @ 2:27am 
For example if you want to lock on on a small fighter attacking you in a fleet fight, it is hard to select that fighter with an offensive block. If you chose closest target option you may lock enemy missiles or debirs as well. I and my friends love to do real fleet fights, some of them love your script because of the turrets :)
Rdav  [author] 6 Jul @ 2:13am 
It was done mostly to streamline to script,
I did originally envisage a version with both in there,
But the problem was it started effecting how easy it was to use and set up, one of the guiding design mantras I work to is to make things quite easy to pick up and learn so it kind of conflicted with that,
maybe if there is enough demand I will add it back in, but I didn't find that it added a significant amount extra in terms of utility in combat tests,
Relas 6 Jul @ 1:56am 
It is a bit sad, that you removed turret based tracking. It is very lightweight and could complement your new tracking. With turrets you can lock on on a target you decide.