Space Engineers

Space Engineers

[Obsolete] Cruise Missile Script Mk2
189 Comments
the_educater 16 Feb, 2016 @ 3:46pm 
I need help. I can't get the Sensor Lock On feature to function at all.

Deese Nutz 11 Feb, 2016 @ 10:59pm 
Does this work with the missile launch trigger script?
THE CHURROSAUR 24 Jan, 2016 @ 6:19pm 
Thanks for all the amazing work Alysius.
Just as a question, is dispatch mode (and linking CMD to a different text panel) compatible with different runtime parameters?
fam1923 17 Dec, 2015 @ 9:05am 
Hello,I'm test missles on moon,but my missles always fly over the target gps coordinates(hit too higher),How can i improve accuracy of missle?
Garmaul 15 Dec, 2015 @ 2:09pm 
You seem to have misinterpreted my question a little. I've since fixed the problem, but the problem might still exist in the Cruise Missile Script Mk.2.

The missiles I had put together did indeed point the V_Dampener block towards the planet, relative to V_MID. All of the V_ reference Blocks were 1x1x1. However, it no longer pointed the V_Dampener towards the planet when I choose an Earth planet, instead of a Martian planet.

I tried using the JDAM missile you made, and it works normally even on the Earth planet type. So I copied it's script and renamed the config area, to match my missile and it worked like a charm.

So IMO there is either something wrong in the Cruise Missile Script Mk.2 making it not work correctly on Earth type planets, which you fixed while making the JDAM, without re-uploading the script itself. Or I set something up wrong when I made it from scratch, which was then fixed by using the script from the JDAM, and renaming it. The latter is probably more likely lol
Alysius  [author] 15 Dec, 2015 @ 6:08am 
@Garmaul you can try building a chair on the missile to see if it is pointing as expected. Sometimes it may point diagonal due to placement of the V_DAMPENER (when using non 1x1 blocks). Will be improving it to allow specifying the name of one of the dampener thruster, then let it automatically find the direction.
Garmaul 13 Dec, 2015 @ 7:29am 
Hello again, =p

I've made a new missile using your Cruise Missile Script Mk.2, your Remote Targeting script Mk.2. It is set up to line its bottom thrusters up with the planets gravity. It works perfectly on some worlds, like the mars custom start world for example. But when I go to use it on an Earth like planet, it still tracks to the target, but no longer points towards the planets gravity, crashing into the ground before it reaches the target.

Any idea what might be causing this?
AJMansfield 11 Dec, 2015 @ 2:49pm 
Love this script.
Here are some features that would make it even better:
* add functionality for using jump drive missiles / teleport bombs -- either as a way to get to the target, or as something that gets activated once the missile is within range of the target in order to penetrate the target's defenses.
* add support for multiple-warhead configurations, and for decoy deployment, to counter anti-missile defenses.
Lagy_Paladin 10 Dec, 2015 @ 9:04pm 
Awesome skript. will try next chance i get
Alysius  [author] 9 Dec, 2015 @ 4:54am 
@FowlPlayChiken It is possible, but there will be some additional control script needed to do the multiple locking and dispatching. This missile script (or the Active Radar Homing script) will just home according to the specified target.
FPC 8 Dec, 2015 @ 10:48am 
Possible to somehow combine the ability to lock and fire at multiple targets/points on a single target which this allows, with the hand-off to the missile remote's guidance that your new script provides?

Going to be printing missiles. Imagining pre-locking several targets and then firing/printing/firing on several ships, then jumping once they switch to local guidance. Could fire many missiles and jump out before the first impacted.

This may already be supported but having difficulty figuring it out if it is!
Alysius  [author] 28 Nov, 2015 @ 3:03am 
@AntiPriuSS Alternatively, you can add a 1 in front of the command:

1[T:123:123:123,W:456:456:456]

To force script to only read the command once, preventing it from keep initializing the waypoint info.
Alysius  [author] 27 Nov, 2015 @ 2:03pm 
Looks like I need to clean up the script to make it more state machine based, as opposed to current intertwined messy codes.
Alysius  [author] 27 Nov, 2015 @ 1:58pm 
@AntiPriuSS Now i know the issue. The boolNoConsumeCommand is enabled, meaning the script keeps reading and re-initializing the Waypoints, so it keeps getting reset to the first waypoint. Set the value to false. Also, update to the latest script, as the version you are using has the bug fixed for single Target coordinate, but not with waypoints. Latest update to solve these is uploaded on 28/11/2015 5:58AM +8 GMT.
Sargent Beard 26 Nov, 2015 @ 8:08pm 
Alysius  [author] 26 Nov, 2015 @ 5:03pm 
@AntiPriuSS The fix is for the coords issue. I cant download your world, workshop has some gigantic screw up when u listed it.
Sargent Beard 26 Nov, 2015 @ 8:56am 
Doesnt seem to have fixed the problem perhaps a github and paste the code there so we can paste it into the programing block to see if its the workshop still not updating correctly?
Alysius  [author] 25 Nov, 2015 @ 5:05am 
Bug fixed. Currently workshop seems down. Cannot load any blueprint, even my own uploaded script.
Viiranin 24 Nov, 2015 @ 2:58pm 
https://www.youtube.com/watch?v=JWUUbMzV3kQ&feature=youtu.be ther video wil be live in about 140min
Viiranin 24 Nov, 2015 @ 2:58pm 
Hello! Whenever I enter the coords of a base on a planet, for instance, from space-- or anywhere for that matter, the missile seems to miss its mark by hundreds, if not thousands of meters. I always check to see if the coords entered are correct, and sure enough they are. Help. A video will be uploaded shortly demonstrating my problem.
Sargent Beard 24 Nov, 2015 @ 9:43am 
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=561740852

Here is the setup Im currently having problems with
Alysius  [author] 24 Nov, 2015 @ 7:05am 
@MK84 Having said that, you just gave ma an idea of a distributed network locking. Sort of completely unjammable as the locking beam can come from any missile. But clean up is required, to remove remote controls located on missiles that are destroyed.
Alysius  [author] 24 Nov, 2015 @ 6:29am 
@MK84 Currently not possible, since the criteria to determine that the hand off is successful (handed off to the same target) is based on the distance from old remote to target and new remote to target. Both distance is compared and must be within 50m difference. When missile is closing in on target, the distance will be shorter and shorter; Script will think hand off failed and try another remote control instead.

Will be modifying the Remote Targeting Script Mk2 to calculate the criteria based on target point instead, so that what you mention can be realised.
MK84 24 Nov, 2015 @ 5:50am 
Definitely target occlusion issue in my case. Can the remote on the missile be used as part of RE_REMOTE_GROUP?
Alysius  [author] 24 Nov, 2015 @ 5:17am 
@AntiPriuSS @MK84 Can you set s sensor with name LSENSOR, to test out if this is the issue? LSENSOR is to use sensor to confirm lock on and switch to sensor tracking once missile is very close to target.
Alysius  [author] 24 Nov, 2015 @ 5:15am 
@MK84 Sometimes the Remote Targeting Script may accidentally lock on to the missile itself when the missile is about to impact. I didnt anticipate this issue, as the missile I used is very small.
Alysius  [author] 24 Nov, 2015 @ 5:13am 
@AntiPriuSS I tried to setup the scripts, using the Mk2 version of both Cruise Missile and Remote Targeting Script, seems ok. Do you have a workshop link of the setup you encountered problems?
MK84 24 Nov, 2015 @ 5:12am 
Hmm I'm getting the same issue like AntiPiuSS. Missile would inexplicably veer off at the last second.
Sargent Beard 23 Nov, 2015 @ 8:37am 
Im also now having a problem where the missile with make the turn toward the target from a waypoint then turn back to the waypoint
Sargent Beard 23 Nov, 2015 @ 7:08am 
Coordinates inputed via text pannel
Alysius  [author] 23 Nov, 2015 @ 3:39am 
Are you using turret targeting or coordinates from Remote Targeting Script?
Sargent Beard 22 Nov, 2015 @ 12:45pm 
Any idea why at the last second my missiles pull up to save themselves?
Alysius  [author] 21 Nov, 2015 @ 12:31am 
After 5 power trips (and restoring corrupted worlds and videos) due to lightning strike, I have given up on creating tutorial videos today.
Erebus Alpha 4 Nov, 2015 @ 11:01am 
Currently, I have timer sequences for both primary fire and secondary fire modes for the missile; the primary arm and secondary arm timers both trigger three seconds after the launch commands execute, once the missile is completely clear of the launcher. I imagine it would be very bad if the missile accidentally detected the launcher-ship as a valid target.

I do need to reconfigure the missile to fly in a 'better' spiral, that way the missile will almost certainly target an opponent that moves slightly during that three-second launch window.
Alysius  [author] 4 Nov, 2015 @ 9:59am 
Yes you can. But you must have some buffer delays cause when the missile is detached first time from the merge block, it is too close and will have erratic behaviour aa there are many ships around, making it miscalculate.
Erebus Alpha 4 Nov, 2015 @ 7:27am 
I wonder if I could put text panels and the remote targeting script on the missile itself. Then if the missile happened to lock onto a missile in front of it, it wouldn't really be an issue. Missile B would chase missile A until it hit the target, then reacquire the target when missile A explodes. There might be a minor issue with accidentally target-locking random bits of debris.

This also means that if inter-grid communication ever does require an antenna link, the missiles would be completely self-guided, not dependent on any telemetry from the firing ship. Thus, much stealthier. They could even continue to track after targets if the firing ship is destroyed.
Alysius  [author] 4 Nov, 2015 @ 6:52am 
@Endryon You can check the "Launch Next Computer" in my Hivebender, which uses toolbar click to switch target (writing to CMD the target panel based on your click).
Alysius  [author] 4 Nov, 2015 @ 6:48am 
@Endryon Remote targeting needs clear line of sight from the remote control block to the target (edge to edge, such that the remote control block can see the target as a whole). If missile is fired too close, it can lock on to it self, cause the beam will hit the missile blocking it first.

@Garmaul Its quite hard to detect, unless you use something like grid position. Meaning your missile have a fixed sized bay holding it, you can check every position (IMyFunctionaBlock.Position) if it is build completed. IsWorking i think
Erebus Alpha 4 Nov, 2015 @ 6:36am 
Well, my missiles separate from the ship correctly, but when used in conjunction with the remote targeting script, they don't chase after the locked target properly.

Currently I have six text panels for targets, with the aim of eventually locking multiple targets at once, and welding and firing missiles at different targets, but CMD's public title is currently set to CMD_TARGET_1, and won't change unless I retype it.

Here's the weirdest part: When I weld and fire a second missile, the two missiles seem to turn toward one another, hit one another, and blow themselves up. Lol!

As nearly as I can tell, the program is running. A sensor on the torpedo detects the launcher when it unmerges, and triggers the launch timer, which among other things, retriggers the program-timer-loop. I'll continue troubleshooting it.
Garmaul 4 Nov, 2015 @ 6:24am 
@Alysius,
One final problem.. =\ In survival some missiles are fired before they are done being built, welding times vary in survival depending on the work load of each welder, which vary depending on how many missiles have been shot and are currently reloading. Which makes timers useless for this.

But I'm wondering how I might go about writing a 2nd addition to the Launch next missile script, which would check for the existence of several blocks, before launching the missile. Do you happen to know of an "if" statement or something similar which would do this?

Simon 3 Nov, 2015 @ 9:57am 
Fixed it!
I'm Sorry, Alysius.. i found my mistake -.-'.
maybe you should use Public title also for LCD Panel as Default...
i tried to give Command via LCD Panel's Public Title. That doesn't work.
Textpanel is the right Choice ;)
thy for that script, works perfect :D
Garmaul 3 Nov, 2015 @ 9:24am 
It works! I was struggling for most of yesterday to get this to run, with absolutely nothing to show for it. But as always Alysius to the rescue, a few words from you and an hour or so of tinkering, and it's working like a charm.

Thank you! =D
Garmaul 3 Nov, 2015 @ 8:15am 
Ive just tried using a second programmable on the missile, and had no luck in various configs. Ill try this out, thanks =D
Alysius  [author] 3 Nov, 2015 @ 8:08am 
@Garmaul Your script will work, you can put at the Launch Next Computer first section, so before any launch it can set and make sure all battery are rdy.

@Sero93 Try to ser the command as 1 instead of
Simon 3 Nov, 2015 @ 7:38am 
@Alysius, the gun has no Beam ( dx11 in Creative), but aims to the target. The Torp just goes straight after launch, no turning to gun angle.
Alysius  [author] 2 Nov, 2015 @ 9:45pm 
@Garmaul This should be on a separate programmable, as the missile havent detach it self and all missile script will be setting on the same set of batteries
Alysius  [author] 2 Nov, 2015 @ 9:43pm 
@Sero93 Did the beam responds and turns to aim the target? The missile will aim in the direction that is targeted by the beam
Garmaul 2 Nov, 2015 @ 4:51pm 
@Alysius, Hello again,
I'm trying to write an addition to your script to fix a game bug where the battery is not usable after repairing it with a welder from a projector. I think I've come close but it's still not working. Im also not quite sure where to put everything into your script, I need an expert's opinion. Any help you can give would be greatly appreciated. Here is what I have so far:

string batteryName = "Battery";

int timeElapsed = 0;

void Main()
{
List<IMyTerminalBlock> batteries = new List<IMyTerminalBlock>();
GridTerminalSystem.SearchBlocksOfName(batteryName,batteries);
if (timeElapsed == 0)
{

for(int i = 0 ; i < batteries.Count ; i++)
{
var thisBattery = batteries as IMyBatteryBlock;
thisBattery.SetValue("Recharge", false);
}
Simon 2 Nov, 2015 @ 9:43am 
Hey @Alysius,
great script! but i have a problem...
Beamriding doesnt work.(due to missing lasers in current SE build?)
i set up a simple missle. Programable as V_MID, batery infront of it as V_FRONT,
and the panel as CMD with public title . and gattling as BEAM.
Timer block loops it every 1 sec.
But the missle is just activating thust and wents straight. no turning to target at all.
tried also setting up with a V_TOP, and given the gyro and thruster the requested group names.
Is Beamriding Broken due to the not existing BEAM in current Creative mode, or am i too stupid ? :D
kindly
sero93
Alysius  [author] 1 Nov, 2015 @ 7:43pm 
Cruise Missile Script + Remote Targeting Script + Unlimited speed mod = Spectacular Impact