Space Engineers

Space Engineers

[RETIRED] Whip's Missile Launch Script
178 Comments
Whiplash141  [author] May 25, 2020 @ 11:26am 
This code has officially been retired and replaced by LAMP: https://steamcommunity.com/sharedfiles/filedetails/?id=2108744940
Whiplash141  [author] May 4, 2020 @ 10:09am 
"Shooter Ship Setup" in the missile code instructions covers it. And relatively soon
Litra May 4, 2020 @ 9:32am 
how to that.
its is easy to use turret to steer the missile then move the ship.
how long to the new script is up??
tnx for the help. :D
Whiplash141  [author] May 3, 2020 @ 1:51pm 
This script does not lock on, but the direction of a specified turret can be used to steer the missile.

I have a new script in development that will support actual homing, and this script will be retired.
Litra May 3, 2020 @ 1:49pm 
hei can the script use turret to guide missile???
Whiplash141  [author] Apr 28, 2020 @ 4:02pm 
(2/2)

3) You need to make an assumption about the missile merge/connector/rotor's position relative to the missile's programmable block to determine how to detach the missile. Most scripts that operate in the way you describe use the one closest to the program. Now what happens if the closest merge/connector/rotor to your programmable block ISN'T the correct one?

4) If I fire the furthest/closest missile, what if I want a specific firing pattern?

I'm not in the business of making code guess a user's intentions, nor do I wish to impose design limitations upon how users build missiles any more than I need to. I'd much rather have the user explicitly state how they want missiles to be handled so that the code simply does what you tell it to.
Whiplash141  [author] Apr 28, 2020 @ 4:02pm 
(1/2)

"im surprised theres not some function that allows just firing of the nearest missile regardless of name"

The behavior of that is not user intuitive, repeatable, nor easy to troubleshoot. To support this, this would require multiple assumptions/edge case handling that I am not going to make.

1) If 2 missiles are the same distance from the measurement point, which fires first? How do you do it in such a way that it is repeatable and intuitive to the user taking into account floating point errors caused by mounting missiles on subgrids?

2) If missiles don't have any sort of identification of their blocks that means that you need to detach it from the firing ship before fetching blocks, otherwise you grab blocks you don't mean to (what you experienced). How, then, would I ensure all a missile's power blocks are enabled before detaching if there is nothing to identify which power systems belong to which missile?
Jaeger Apr 28, 2020 @ 11:38am 
im surprised theres not some function that allows just firing of the nearest missile regardless of name like in guidance's launch script that i used long ago.
Whiplash141  [author] Apr 28, 2020 @ 9:03am 
"cant get it to launch ONE AT A TIME. i named each prgram block on each missile custom data 01 02 etc but no luck wasted 6 hours so far"

As stated in the instructions for the missile script, you need to change both the name of the blocks on the missile AND the custom data to match. If all missiles are named the same thing, they will all fire at the same time.
Ghost Apr 28, 2020 @ 4:37am 
There's a BP on the WS for a missile defense vehicle. Not sure of the name right off but it was a showcase vehicle for this script. I would suggest taking a look at it and see what's different. I don't remember how to do this off hand but it's a place to start.
Jaeger Apr 28, 2020 @ 3:44am 
cant get it to launch ONE AT A TIME. i named each prgram block on each missile custom data 01 02 etc but no luck wasted 6 hours so far
Calendir Jan 9, 2020 @ 1:27pm 
ok figured it out it is case sensitive
Calendir Jan 9, 2020 @ 1:18pm 
well i actually have it named but its still not working
Calendir Jan 9, 2020 @ 1:07pm 
oh.... thank you much appreciated
Whiplash141  [author] Jan 9, 2020 @ 5:32am 
Well that means there are no programs with "Missile" in their name
Calendir Jan 9, 2020 @ 12:46am 
whenever i press run with the argument fire it says no untriggered missile programs were found...
Calendir Jan 8, 2020 @ 11:03pm 
hi um the missile launch script is not working for me yet i can manually trigger the missile it self and works i also have the latest update
Whiplash141  [author] Sep 25, 2019 @ 9:12pm 
Awesome, good to hear it. Also, the missile code no longer needs a timer, so you can save a block of space
mobisam Sep 25, 2019 @ 7:00am 
@Whiplash141
OOPS! - Missile now running Optical Guidance System v62-18. Must watch the videos more closely.

When I Run the missile code with the 'Setup' argument I get the [OPTIONAL] warnings but also:

[FAILED] No main thrusters found - the forward thruster on the missile is named 'Main Thruster Missile 1'

I had placed the 'shooter reference' on the cockpit rather than the remote control so that was a noob error.

Thanks for the assist (from Oz)
Whiplash141  [author] Sep 25, 2019 @ 5:50am 
@mobisam: the missile needs to be running the missile code, not this launch code. If it is in fact using the missile code, what version is it?
Whiplash141  [author] Sep 25, 2019 @ 5:46am 
@Captein: You could make a timer block that runs the program with the fire argument 2 times
mobisam Sep 25, 2019 @ 2:51am 
HELP!! Missile will not fire.
I have battery, gyro, thruster, merge block, progblock, remote and timer all with 'missile 1' as part of their names.
The timer is set to trigger now/start/run the progblock with a 'fire' argument.
Missile progblock and craft with 'shooter reference' in its name both running rev 8.2 1/5/19 of Whip's Missile Fire Script
All blocks belong to 'Me'
When I 'Fire' the launch progblock reports"
WMI Missile Fire System
Triggered program named:
'Progblock Missile Launch'
Nothing reported via the missile 1 progblock

I also have the missile launch progblock stating 'No untriggered missile programs were found'

I thought I had followed the video but obviously there is an issue between the video and my eyes.

Thanks for your excellent work on this as the pirates are winning on my world

HateMedLoveTunnel Jul 20, 2019 @ 1:30pm 
Is it possible for this script to launch both "Missile 1" and "Missile 2" with a single fire run?
Natomic Jul 15, 2019 @ 7:02am 
sorry had to go away and forgot to check the page. Link to ship https://steamcommunity.com/sharedfiles/filedetails/?id=1799195691
Whiplash141  [author] Jul 10, 2019 @ 2:58pm 
Workshop link is most convenient. You can just leave it here and I'll take a peek.
Natomic Jul 10, 2019 @ 8:19am 
sure how do you want me to get it to you?
Whiplash141  [author] Jul 10, 2019 @ 7:36am 
Do you have a blueprint/world I can look at?
Natomic Jul 10, 2019 @ 6:43am 
just double checked, everything has ownership set to me still not working
Whiplash141  [author] Jul 9, 2019 @ 8:20pm 
Nope
GOMERSGOOD Jul 9, 2019 @ 8:20pm 
is there any script you DO have that can accomplish the same task?
trying to use the programmable block on my ship to launch torpedo block missiles via GUIDANCE block. i have them set to rebuild and when they rebuild they get grayed out of the toolbar.
is there any way i can edit this to fend the signal to the GUIDANCE block instead?
Whiplash141  [author] Jul 8, 2019 @ 10:02pm 
No
GOMERSGOOD Jul 8, 2019 @ 9:43pm 
sorry i think i figured it out, im trying to use your script on the torpedo blocks, is this possible?
GOMERSGOOD Jul 8, 2019 @ 7:09pm 
that and imnow noticing i dont have the same script read out as in your video was there and update?
GOMERSGOOD Jul 8, 2019 @ 6:51pm 
side note, missile wont fire when i run the fire argument in PB
just sits there
i usually use the guidance block to launch or lock missiles on to target? is that whats fucking me over?
GOMERSGOOD Jul 8, 2019 @ 6:44pm 
cant get the missile to fire, do i have to use something other than the HARDPOINT that comes in the torpedo blocks?
i got the program to run just fine, says it launches missiles, but they don't release?
Whiplash141  [author] Jul 8, 2019 @ 3:00pm 
Check ownership on the firing program
Natomic Jul 8, 2019 @ 9:06am 
Um i have a slight problem. When i try and run this with the fire argument it says "no untriggered missile programs" but i have two missile sitting in their silos. The missiles work fine and they fire when i activate them from their command blocks "manually" but the problem is the silos weld more missiles once they fire so that more can be fired. So without this script i have to add the programable blocks back to the hotbar every time i want to fire. Also when i fire the missiles and then use the "kill" argument on this script it says it killed guidence on 0 missiles. Help
Whiplash141  [author] May 17, 2019 @ 10:28pm 
That ship is sadly broken due to API changes. I have a new one in the works which is why I haven't bothered going back to fix the old one.
Tricky Ricky May 17, 2019 @ 10:07pm 
man i been trying to shoot a missile out of the Komodo for days now i feel pretty stupid so do i need to load this script into it? cause i see the Komodo already has it in it but when i press 1 for fire just the alarm goes off and no misssiles shoot pleaseeeee some one help im really new tot his game and i really wanna learn how these missiles work and shoot them
drMuesli Apr 24, 2019 @ 9:38am 
Yeah, found it, ty :)
Is there a chance to join the Whiplash Mil. Industry? :D
Whiplash141  [author] Apr 24, 2019 @ 8:44am 
It's not a mod, it's a script. Place w programmable block, click edit, then click the workshop button
drMuesli Apr 24, 2019 @ 7:42am 
Hi, i don't see the script in my F10 or Mods menu
Whiplash141  [author] Apr 13, 2019 @ 5:36pm 
My Komodo Mk 1 :)
Atro Apr 13, 2019 @ 2:36pm 
Do you have any workshop items using the script
Atro Apr 13, 2019 @ 2:36pm 
Yessss
Whiplash141  [author] Apr 12, 2019 @ 4:28pm 
Theoretically infinite, but you kinda need to be able to see the target since these are optically guided
Atro Apr 12, 2019 @ 2:35pm 
can you tell us the range of the missiles
BenDoesThings Feb 2, 2019 @ 2:14pm 
sorry i am an idiot, i did not read the description, i only watched the video, i have figure it out, sorry for taking up your time
:(
BenDoesThings Feb 2, 2019 @ 2:08pm 
wait, so do you need to change the settings in the custom data and not in the script itself?
BenDoesThings Feb 2, 2019 @ 2:05pm 
i do, with the ship and missiles