Space Engineers

Space Engineers

This item is incompatible with Space Engineers. Please see the instructions page for reasons why this item might not work within Space Engineers.
74 ratings
[Obsolete] Cruise Missile Script Mk2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
11.645 KB
6 Apr, 2015 @ 12:58am
4 Jan, 2016 @ 5:59am
32 Change Notes ( view )

Subscribe to download
[Obsolete] Cruise Missile Script Mk2

Description
This is an Obsolete script, superseded by the Easy Radar Homing Script (Much easier to setup)
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=688803417

Script to control your cruise missile. Easy deployment with automatic detection of gyroscope and thrusters orientation. This script has been updated with additional feature to point side thrusters at natural gravity.

This is a vanilla script. No mods are required.


Features

1) Drift Function - This setting is used when your missile has no side thrusters. The drift function will perform over-steering to compensate for the drift. Can be activated by setting "boolDrift" to true.

2) Beam Riding Function - This allows the use of Turret AI's 800m auto aiming to guide the missile to the target.

3) Lead Target Function - By default the missile will try to lead the target, to correct the tail chasing problem.

4) Orientation Auto Detection - All gyroscopes, thrusters and beam riding turret can be mounted in any orientation. The script will auto detect the appropriate orientation and configure it accordingly.

5) Real Time Tracking - The target coordinates can be continuously updated while the missile is in flight, to change its flight course and aimed point on the fly. Refer to Targeting Procedures for more information.

6) Natural Gravity Dampener - Automatically spins the missile to face the thrusters against natural gravity. In this way, you can have thrusters on only one side, saving cost. To activate this, set "boolNaturalDampener" to true.


Dispatch Mode

Dispatch Mode is used for multiple missile configuration, where missiles are duplicated and blueprinted with the same set of names. Script will disengage missile from grid via Merge Block or Rotor Detech first before initializing and referencing the blocks.

Additionally, script will listen on CMD's Public Title for the name of the actual Text Panel to use for getting target coordinates. this allows selection of which Text Panel to use for targeting information (Different Text Panel containing different target information).

Notes

- If Drift Function is used and your vectorPointMid is far off from center of mass, use "midToCenterOfMassDist" to compensate. See below or screenshot for more information.


Demo Worlds And Other Links

Two demo world setups to show how the script can be used:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=460236584
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=524585088


Required Setup

- A reference block named V_MID in the middle.
- A reference block named V_FRONT in front of V_MID.
- A reference block named V_TOP on top of V_MID. Latest update: If left blank, it will randomly select a top point.
- At least one gyroscope on the ship. You can save it under group named GYROS if you want script to use specific set of gyroscopes, otherwise group its optional.
- At least one thruster facing backward relative to the ship. If no such thrusters are found, script will not activate any thrusters. Manual activation will be required in this case.
- A Text Panel named CMD for inputing targeting command.
- (Required if using natural gravity dampening feature) A remote control named "LREMOTE".
- A reference block named V_DAMPENER positioned such that the direction from V_MID to V_DAMPENER is the same direction the side thrusters is going to face, towards natural gravity. Set "boolNaturalDampener" to true to use this feature.
- (Optional, If you use beam riding feature) A Turret block (Missile, Gattling, Camera Turret mods) named "BEAM" to be used for beam riding. The turret will auto aim at the target while the missile will follow its aim.
- (Optional, If you use sensor lock on feature) A sensor named "LSENSOR" to be used for sensor lock on mode. *Sensor API changed. No longer working.*


Additional Setup For Dispatch Mode

- A set of Targeting Text Panels with unique names of your choice, for input targeting command. The original CMD Text Panel's Public Title will instead be used to select the required target by inputting one of the Targeting Text Panel's name (e.g. You have CMD_TARGET_1 and CMD_TARGET_2 being updated with target coordinates by other scripts. To make missile use CMD_TARGET_2 for coordinates, set Public Title of CMD to the string: CMD_TARGET_2).
- A group of Merge Blocks, Rotors or Advanced Rotors named DISPATCH (Can be a group or blocks of this same name). This group can be a mix and match of Merge Blocks, Rotors or Advanced Rotors. When the missile received targeting command from the specified Targeting Text Panel, it will separate itself from the ship grid using the Merge Block, Rotor or Advanced Rotor within the DISPATCH group that is the closest to the programmable block running this script.

For Dispatch Mode, you can set the Private Title of CMD to a one time command that will be executed ONCE after the missile have initialized.

For Target Selection mentioned above (Populating CMD's Public Title with targeting Text Panel name), you can use Target Selection Script found at:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=559331737


Targeting Procedures

Enter targeting information into the CMD Text Panel's Public Title field (If Dispatch Mode is used, this should be the Targeting Text Panel). The format is:

[T:<X>:<Y>:<Z>]

Where X, Y and Z is the coordinates. You can continuously write [T:<X>:<Y>:<Z>] to the CMD Text Panel to have the missile update its flight course and aimed point on the fly.

You can also use the Beam Riding feature by entering the command:

-or- [B,W:<X1>:<Y1>:<Z1>,W:<X2>:<Y2>:<Z2>,W:<X3>:<Y3>:<Z3>]

Where "B" specifies that beam riding will be used and "W" is an optional sequence of waypoints to follow before switching to beam riding. Beam riding means the Turret will automatically aim at a target and the script will home according to the Turret's aim.

Note: You cannot use "T" and "B" together. Specifying "T" and "B" together will cause the script to ignore "T" (final target point) if there is a "BEAM" detected.

List of example commands:

[T:10:10:10] - Missile homes at target [10,10,10].
[T:10:10:10,W:1:1:1,W:2:2:2] - Missile travels to waypoint [1,1,1] then to [2,2,2] before homing at final target [10,10,10].
- Missile start off in beam riding mode.
[B,W:1:1:1,W:2:2:2] - Missile travels to waypoint [1,1,1] then to [2,2,2] before switching to beam riding mode.
[BX,W:1:1:1,W:2:2:2] - Missile travels to waypoint [1,1,1] then to [2,2,2] before switching to beam riding mode. If along the way the turret aims at some target, it switches to beam riding.
[BW,W:1:1:1,W:2:2:2] - Missile circles about waypoint [1,1,1] and [2,2,2]. If anytime the turret aims at some target, it switches to beam riding mode.


Sensor Lock On

You can specify a sensor using strLockOnSensor to use for sensor lock on mode. When the sensor detects a target, it will ignore all current modes and chase that target.


Unique Command Locking

If you specify a number in front of the command:

100[T:10:10:10]

The script will only read the command once until the number "100" is changed to a different number.
To allow the script to read the next command again, you will specify 101[T:10:10:10] and so on.


Special Settings

Below are the parameters used in the script. See Discussion for full documentation on what each parameter means.

boolDrift
boolLeadTarget
boolDispatchMode
boolNoConsumeCommand
defaultLaunchSeconds
defaultWaypointDistCutoff
midToCenterOfMassDist
driftVectorReduction
oneTimeCommand
boolNoConsumeCommand
boolNaturalDampener


Runtime Parameters

See Discussion for full documentation on the commands you can set to the script via CMD's Public Title.
Popular Discussions View All (2)
2
25 Nov, 2015 @ 4:41am
When coords are entered, the missile invariably misses its mark... by a lot
Viiranin
0
5 Sep, 2015 @ 6:21am
Cruise Missile Script Mk2 Documentation
Alysius
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.