Space Engineers

Space Engineers

117 ratings
Setup Guide for Easy Lidar Homing Script
By Alysius
   
Award
Favorite
Favorited
Unfavorite
Available Homing Modes
You can setup your missile with specific Homing Modes via either of the following options:

1) Setting variable missileLaunchType via Custom Data (See Custom Data Configuration Section)

2) Use my Launch Control Script (See my other script uploads) and trigger that script's Run Action with Arguments:
MODE:<missileLaunchType>
(This will override the missileLaunchType variable, as it takes higher precedence)


List Of Homing Modes Available:

0
Lidar Homing Mode using launching ship's R_LIDAR for initial lock-on and R_FORWARD for aiming.

1
Lidar Homing Mode using coordinates from launching ship's R_TARGET for initial lock-on.

2
Lidar Homing Mode using launching ship's R_LIDAR for initial lock-on and R_FORWARD for aiming with initial Camera Guidance.

3
Camera Guided Mode using launching ship's R_FORWARD for direction tracking. R_FORWARD can also be a Turret.

4
Cruise Mode using launching ship's R_TARGET as GPS coordinates.

5
Turret AI Homing Mode using launching ship's R_DESIGNATOR AI Turrets for Guidance. Multiple R_DESIGNATOR are allowed.

6
Fixed Glide Mode using launching ship's R_FORWARD for one time aiming, then continues to glide on that fixed direction.

7
Lidar Homing Mode solely using launching ship's R_LIDAR for lock-on and R_FORWARD for aiming (Semi-Active Style Guidance).

8
Turret AI Homing Mode using missile's mounted AI Turret for Guidance.

9
Turret AI Homing Mode using missile's mounted AI Turret for Guidance, with initial Camera Guidance using launching ship's R_FORWARD. R_FORWARD can also be a Turret.

99
Launch missile in Dummy Mode. This is used for testing if the missile detaches properly at the correct connection and display missile detected configurations.
Required Setup
Script automatically detects everything from which direction is the missile facing, to whether drift is required. Just build your missile anyway you want it, following a few rules listed below:

Before you begin, ensure ALL Ownership are set to the same.


For Missile

1) A Programmable Block loaded with this script.
2) At least one Remote Control.
3) At least one Gyroscope.
4) At least one Thruster.
5) At least one Power Source.
6) Exactly one Merge Block for detaching missile from ship.
7) (For Lidar Homing Modes 0,1,2,5) At least one forward facing Camera.
8) (For Turret AI Homing Mode 8 and 9) Exactly one AI Turret.

- See Homing Modes Section on how to set the missile homing mode.

- You SHOULD enable excludeFriendly to prevent locking-on to friendly units. Simply add the line excludeFriendly=true to the Custom Data of the PB:
`
- DO NOT name tag your missile's cameras with R_LIDAR, as it will mess up the cooldown and initial lock-on.

- By server default, Camera has a 45 degree view limit and a 1 second per 2km beam cooldown. More cameras means better lock-on.

- Try to have Cameras on ALL Sides of your Missile if possible (due to blind spots from drifting).

- Make sure there is enough thrust to fly your missile:
For Planets: Put some downward thrusters (just one side) for dampening gravity.
For Space: You should NOT put any side thrusters (missile drifts perfectly with just the backward thrust).

- (Optional) Sound Block named R_ALERT on your launching ship. This block is played when the missile is locked.

- (Optional) Add the word PROXIMITY to a camera to make it a tripwire for detonating all on-board warheads. See Proximity Sensors Section for more information.


For Launching Ship

1) At least one Camera name tagged R_LIDAR. This block must face forward in the intended aiming direction. More Cameras means better initial lock-on.
2) A Block Or Turret name tagged R_FORWARD. This block is used for aiming and can also be a Turret. If this block is not found, the Main Cockpit is used instead.
3) A Text Panel name tagged R_TARGET. This Text Panel is used for sending commands via its Text field. For Mode 1 and 4 it also sends the GPS coordinates via its Title field. This block if not required if you are using the new Inter-Grid Communications to transmit information.

4) (Only if you use Mode 5) One or more AI Turrets name taggedR_DESIGNATOR. Missile will home to a target locked on by any of these Designators.

- For all R_LIDAR mentioned in the above modes, put them very closely clustered together. This is to reduce parallax error while aiming.


Test Your Missile

With the missile still attached to your ship, enter CHECKSHIP into the PB Argument field and click Run. It will tell you exactly which Merge block / Rotor is selected to detach your missile from ship. Make adjustments if it detected the wrong blocks.

Now detach your missile from your ship, then enter CHECK into the PB Argument field and click Run. It will tell you exactly which blocks are selected (main thruster, dampener thruster, cameras) and whether gravity dampening is enabled. Make adjustments if it detected the wrong blocks.
How To Use
Usage of missile will depend on the Mode your missile is launched in.

For Modes 0 and 2

1) Trigger Run of Programmable Block to launch (or use Launch Control Script).
2) Aim ship nose at target until missile responds and start homing to target.

For Modes 1 and 4

1) Ensure the Title of R_TARGET is populated with a GPS coordinate. This can be from any source such as another lock-on scripts, Radar Mods and other target aquisition methods.
2) Trigger Run of Programmable Block to launch (or use Launch Control Script).

For Mode 3

1) Trigger Run of Programmable Block to launch (or use Launch Control Script).
2) Keep Camera or Turret aimed at target until missile impacts.

For Mode 6

1) Aim Camera or Turret at target.
2) Trigger Run of Programmable Block to launch (or use Launch Control Script).

For Mode 5 and 8

1) Trigger Run of Programmable Block to launch (or use Launch Control Script).
2) Sit and wait for AI Turret to lock-on.

For Mode 9

1) Trigger Run of Programmable Block to launch (or use Launch Control Script).
2) Aim ship nose at target until missile responds and start homing to target.

If P_WFT (waitForHomingTrigger) Is Activated

1) Trigger Run of Programmable Block to launch (or use Launch Control Script).
2) Missiles will just fly straight and do nothing else.
3) When you are ready to start the homing (Any of the above Modes), write the word "LOCK" to Public or Custom Data of the R_TARGET.
4) Proceed with the above procedures for each of the Modes.
Proximity Sensors
This script supports the use of raycast cameras as proximity fuses. To setup a Camera as a proximity fuse, put the word tag PROXIMITY to the Camera. You can have more than 1 cameras as proximity fuses.

By default, the proximity fuse detects directly in front of the camera (zero yaw pitch), and detection distance is dynamically calculated as the distance the missile can travel in one tick (Missile speed / 60). When triggered, it will Detonate ALL on-board warheads (Warheads must have the word Warhead in their names).

These behavior can be overridden by setting override variables via Custom Data of the Camera:

Example:

distance=3
proximityTriggerCommands=ACTP:Rocket Launcher:ShootOnce


These 2 lines will set the proximity fuse distance to a constant 2 meters and triggers shooting of all weapons with name tag Rocket Launcher in them.



Available Override Variables

distance (e.g. distance=3)
Sets the proximity fuse distance.

yaw (e.g. yaw=35)
Yaw angle in degrees to raycast the detection beam (server default is max 45).

pitch (e.g. pitch=30)
Pitch angle in degrees to raycast the detection beam (server default is max 45).

failunsafe (e.g. failunsafe=true)
When set, if the camera is incapacited (damaged or destroyed), it will Arm all on-board Warheads (but not detonate them. this behavior can be overriden by the failunsafeTriggerCommands variable listed below). Note: If multiple cameras have this set, ANY one of them getting incapacited will result in warheads arming.

failasgroup (e.g. failasgroup=true)
If failunsafe is set on multiple cameras, set this to true if you want the warheads to arm only when ALL those cameras with failunsafe set are incapacited (cameras incapacited but do not have failunsafe set is not considered).

failunsafeTriggerCommands (e.g. failunsafeTriggerCommands=ACTP:Rocket:ShootOnce)
Overrides the default command of Arming Warheads with your own custom trigger command, when failunsafe is triggered.

proximityTriggerCommands (e.g. proximityTriggerCommands=ACTP:Rocket:ShootOnce)
Overrides the default command of Detonating Warheads with your own custom trigger command, when proximity fuse is tripped.

dmsrange (e.g. dmsrange=10)
Dead Man's Switch scan distance in meters (MUST be further than the proximity distance).

When the target is detected within this range, it will activate DM Active Mode instead of detonating warheads immediately. When DM Active Mode is activated, all subsequent detection via this camera MUST detect back the same target and with a closer distance then last scanned. If target is lost, camera incapacited, detected another target or detected same target but is further away than last scanned, the warheads are detonated.


Dead Man's Switch

Reason for the Dead Man's Switch feature is due to the following scenario:

1) You want to detonate warhead even if missile does not intercept and impact target directly (fighter dodges missile), but is close enough to do damage.

2) You also want to detonate warhead as close as possible for close to stationary targets as it is a confirm hit.

If you set distance to 10m, you cater for Scenario #1 but not #2 (as missile auto detonates at 10m). If you set distance to 1m, you cater for #2 only, as missile in #1 is not close enough to the target.

Therefore, this feature is introduced to cover both scenarios.

Example: You set distance to 2 and dmsrange to 10. If missile is heading for a stationary target, it will detonate at 2m as usual. If the missile is chasing a fast dodging target and the missile passes by closer than 10m, it will enter DMS mode and once the missile misses the target, it will detect this as moving further away from the target, instantly detonating the warheads.
Custom Data Configuration
You can set the Custom Data of the Programmable Block to specify various settings or change script variables, avoiding the need to edit the script everytime when updating to newer script versions.

Each variable must be specified in the following format, with each one on a new line:

<VARIABLE1>=<VALUE1>
<VARIABLE2>=<VALUE2>
<VARIABLE3>=<VALUE3>


Example:

missileLaunchType=3
verticalTakeoff=true
strDirectionRefBlockTag=MISSILE_FORWARD


Note: DO NOT put the C# keywords like "static float" in front. There must be NO semicolon behind each values. Also DO NOT enclose the values with " quotes.


Variable List

The available variables are exactly the same set as those available for editing in the script:

missileLaunchType
Missile Launch Mode. See Homing Modes Section for list of available modes.

missileDetachPortType
Type of block to disconnect missile from launching ship: 0 = Merge Block, 1 = Rotor, 2 = Connector, 3 = Merge Block And Any Locked Connectors, 4 = Rotor And Any Locked Connectors, 99 = No detach required.

spinAmount
The amount of RPM spin for the missile.

verticalTakeoff
Whether missile will perform a vertical takeoff using side thrusters before switching to forward flight.

excludeFriendly
Whether to exclude locking-on to Friendly targets (RECOMMENDED to set to true). Default is false.

adjustThrustBasedOnAim
Turn off Thrusters if missile direction is way off.

waitForHomingTrigger
Wait for LOCK command from R_TARGET panel before attempting to home.

enableMissileCommand
Whether to allow In-Flight Command to the missile. Requires R_TARGET text panel.

fivePointInitialLockDist
Set to more than zero to activate 5 point initial lock-on. 5 raycasts are used instead of 1, for easier initial aiming to lock-on. This value specifies the distance the 5 raycasts will be spaced apart.

raycastAheadCount
Set the number of additional raycasts to be casted ahead of your aim point. This if for mitigating high ping and gyroscope lag (actual aim point is always behind your intended aim point).

raycastAheadSeconds
Set the number of seconds to raycast ahead of your aim point. raycastAheadCount must be set to a value greater than 0 first.

useOffsetTargeting
Home in on the initial aimed lock-on position instead of the center of the target. This is for targeting specific spots on the target instead of its center.

useOffsetRaycasting
Raycast on the initial aimed lock-on position instead of the center of the target for lidar tracking during full fire and forget mode. This is for target ships with large hole in the middle.

switchTurretToRaycast
For AI Turret Lock-on Modes 5, 8 and 9. Whether to switch to raycast after AI turret lock-on. Missile must have cameras.

strShipRefLidar
Name tag of launching ship's Lidars. Default is R_LIDAR.

missileId
Used for inter-grid communications. Sets the unique identity of the missile. Missile will only process messages with recipient equal to missileId or missileGroup.

missileGroup
Used for inter-grid communications. Sets the group identity of the missile. Missile will only process messages with recipient equal to missileId or missileGroup.

allowedSenderId
Used for inter-grid communications. Sets the allowed sender wildcard comparison string. This can have a * at the start or back for multiple matching. Missile will only process messages from this sender (no check if this is not set).

strShipRefForward
Name tag of launching ship's Forward Reference. Default is R_FORWARD.

strShipRefTargetPanel
Name tag of launching ship's GPS and In-Flight Command Text Panel. Default is R_TARGET.

strShipRefTurrets
Name tag of launching ship's AI Turret Designator (For Mode 10). Default is R_DESIGNATOR.

strShipRefNotMissileTag
Name tag of launching ship's Not Missile block to signal missile in case detach fails (Avoid turning the launching ship into a missile). Default is NOT_MISSILE.

missileTriggerCommands
Commands to trigger when missile satisfies certain criteria (e.g. within a certain distance to target etc). See Missile Deployment Commands Section for more information.

missileActivationCommands
Commands to trigger right after missile is detached from grid and all on-board electronics including thrusters are activated.

proximityTriggerCommands
Commands to trigger when the proximity tripwire is triggered. See Proximity Sensors Section for more information.

faildeadlyTriggerCommands
Commands to trigger when the proximity tripwire is incapicitated. See Proximity Sensors Section for more information.

strGyroscopesTag
Name tag of missile's Gyroscopes. Default is blank to allow use of all detected Gyroscopes.

strThrustersTag
Name tag of missile's Thrusters. Default is blank to allow use of all detected Thrusters.

strDetachPortTag
Name tag of missile's Detachment Merge Block (Rotor and Connectors if missileDetachPortType is different). The closest one will be used. Default is blank to allow searching of all Detachment Merge Blocks.

strDirectionRefBlockTag
Name tag of missile's Forward Reference Block. Default is blank, so the side with most thrust is used as backward.

strLockTriggerBlockTag
Name tag of Trigger Block to trigger when missile is locked on.

strLockTriggerAction
Action of the Trigger Block to trigger when missile is locked on. Default is based on the type of Block (e.g. Timer is TriggerNow, Sound Block is PlaySound etc).

strStatusDisplayPrefix
Prefix name of Block to use as debugging Display, which is usually a Beacon or Antenna. Default is <D>.

launchSeconds
Number of seconds to wait for missile to clear the launch platform before homing.

boolNaturalDampener
Whether to point side thrusters at Gravity to act as Dampeners.

boolCompensateDampener
Whether to compensate for gravity if no Gravity Dampeners are found.

LIDAR_MIN_LOCK_DISTANCE
Minimum Lidar lock-on distance. Default is 50 (50m).

LIDAR_MAX_LOCK_DISTANCE
Maximum Lidar lock-on distance. Default is 3000 (3km). The larger the value, the more cooldown is required for each Lidar camera.

LIDAR_REFRESH_INTERVAL
The number of Ticks to wait before using the next Lidar to attempt lock-on. Set zero for auto calculation (Default is zero).

LIDAR_REFRESH_CALC_FACTOR
Percentage number of Lidars to use for auto calculation (For LIDAR_REFRESH_INTERVAL = 0)

THRUST_ESTIMATE_FACTOR
Script automatically estimates the thrust value to be used for intercept calculation. This multiplier factor is used to reduce this estimated thrust value to account for speed cap and gyro turning losses (Default 0.75).

AIM_P
Proportional Gain of the PID Controller. If AIM_P, AIM_I or AIM_D are all zeros, the default values are used.

AIM_I
Integral Gain of the PID Controller. If AIM_P, AIM_I or AIM_D are all zeros, the default values are used.

AIM_D
Derivative Gain of the PID Controller. If AIM_P, AIM_I or AIM_D are all zeros, the default values are used.

AIM_LIMIT
Maximum combined Pitch and Yaw Radian values. If script calculation exceeds this, the Pitch and Yaw will be scaled down.

INTEGRAL_WINDUP_UPPER_LIMIT
Integral Upper Limit to mitigate Integral Woundup. Must be more than 0.

INTEGRAL_WINDUP_LOWER_LIMIT
Integral Lower Limit to mitigate Integral Woundup. Must be less than 0.

MERGE_SEPARATE_WAIT_THRESHOLD
Number of Ticks to wait after Merge Block detachment before initializing.

TURRET_AI_PN_CONSTANT
Proportional Constant of the Turret AI Homing.

TURRET_AI_AVERAGE_SIZE
Size of the Average Filter for Turret AI Homing.

outputMissileStatus
Whether to output Missile Status to CustomInfo. This is for use with Missile Status Script.
Inter-Grid Communication
While this script still uses the caching of block (reference exploit) to communicate with launching ship for aiming, initial lock-on and GPS coordinates, it has built-in inter-grid communications just in case you need it.

This section is intended for scripters who has knowledge of using the SendMessage API. If you are using someone else's script to send these commands, then you just need to setup this script for receiving commands.


Setup Script For Receiving Commands

One Antenna will be required to act as the receiver of messages. Change the Assigned Programmable Block dropdown box value to the Programmable Block running this missile script.
(See this image: http://imgur.com/aJtfj74.jpg)

When another script uses their Antenna to broadcast a message using SendMessage API in their script, that message will be received by this Antenna and the content redirected to this missile script.


Command Format

The format of the command is (Note that the separation character is a semi-colon ;):

MSG;<recipient>;<sender>;<options>;<Message>


Where:

<recipient>
The target recipient. This matches with either the missileId or missileGroup that is configured via the Custom Data Configuration. Wildcard character * is only allowed at the front and back of this value. If this does not match both the missileId and missileGroup, the message is ignored.

<sender>
The sender identity. This matches with the allowedSenderId that is configured via the Custom Data Configuration. If this does not match with the allowedSenderId, the message is ignored.

<options>
For future use. Not read currently.

<Message>
The remainder of the string that is passed directly to the missile script for command processing. This value can be either a command string from Launching Platform Commands in the below section, or commands from Missile Deployment Command Section and In-Flight Missile Command Section.


Multiple messages can be sent to different recipients, by starting each message on a new line (one message per line).


Example:

M93743;Ship01;;ACTW:Warhead:Detonate
Sends a warhead detonation message to all missiles with UniqueID: M93743 -OR- with GroupID: M93743. Missiles must have allowedSenderId either not set -OR- set to a matching value like: Ship01, Ship*, *01 etc.

M*;Ship01;;ACTW:Warhead:Detonate
Sends a warhead detonation message to all missiles with UniqueID starting with M -OR- with GroupID starting with M. Missiles must have allowedSenderId either not set -OR- set to a matching value like: Ship01, Ship*, *01 etc.

M*;Ship01;;GPS:1:2:3
Sends GPS coordinates {X:1,Y:2,Z:3} to the missile (For Homing Modes 1 and 4). Missiles must have allowedSenderId either not set -OR- set to a matching value like: Ship01, Ship*, *01 etc.

M1;Ship01;;GPS:1:2:3
M2;Ship01;;GPS:4:5:6

Sends GPS coordinates {X:1,Y:2,Z:3} to the missile M1 and {X:4,Y:5,Z:6} to missile M2.


Launching Platform Commands

Instead of using R_FORWARD, R_LIDAR and R_TARGET on the launching ship to get information (reference exploit method), you can substitute them and use the follow commands instead.
(Which means launching ship no longer needs these blocks, instead it uses these commands in their place):

GPS:<X>:<Y>:<Z>
Sends the Target Position (Substitutes R_TARGET) for Homing Modes 1 and 4.

FWD:<A>:<B>:<C>:<X>:<Y>:<Z>
Sends the Forward Position (Substitutes R_FORWARD) for Homing Modes 0, 2, 3, 5, 6, 7. ABC is the Forward Vector, XYZ is the Starting Point (e.g. For a Cockpit, ABC is the Cockpit's current aiming direction vector and XYZ is the Cockpit's current position)

LDR:<ID>: ... ... (26 parameters in total, excluding LDR keyword)
Sends the Camera Raycast Locked-on information (Substitutes R_LIDAR) for Homing Modes 0, 2, 5, 7. Basically the launching ship will have a complex script to perform raycast lock-on, then send this lock-on information via this command when it has accquired lock. List of the 26 parameters below:
1 : Target Entity ID
2-4 : Target Position
5-7 : Target Velocity
8-10 : Raycast Hit Position
11-13: Target Bounding Box Mininum
14-22 : Target Orientation Matrix
23 : Target Type
24 : Target Relationship
25 : Raycast Timestamp
26 : Target Entity Name


Other Notes

1) There MUST be enough Antenna range for the launching ship to reach the missile. Also, these commands must be sent on every tick, until it is no longer required.

2) You can send multiple messages (each to different missiles) in one SendMessage command. Just start a new message on a new line.
Missile Deployment Commands
You can configure the missile to perform certain actions based on distance to target, distance travelled and spin rate achieved. The missile deployment commands will only be activated when it is in Homing Stage (Missile has completed the Launching Stage).

To configure the missile deployment commands, set the missileTriggerCommands variable (See Custom Data Configuration Section on how to set) to a command string in the following format:

<COMMAND1>:<VALUE1>,<COMMAND2>:<VALUE2>,..... and so on.

Note: Some commands do not have parameter values.

The following is a list of supported commands:

ABORT - Forces the missile to stop homing and fly straight. After this command is issued, no further command can be sent.

ACT and SET commands are also available. See the respective section below.


ACTx

Usage: ACTx:<Block Name>:<Action Name>

Where x can be one of the following:

B - Triggers an action for all blocks with specified name.
P - Triggers an action for all blocks starting with specified name.
S - Triggers an action for all blocks ending with specified name.
W - Triggers an action for all blocks containing specified name.


Example Commands:

ACTB:Warhead:StartCountdown
Start countdown of blocks with name exactly as "Warhead"

ACTP:Thruster:OnOff_On
Turn on all blocks with name starting with "Thruster"


SETxy

Usage: SETxy:<Block Name>:<Property Name>:<Property Value>

Where x can be one of the following:

B - Sets property for all blocks with specified name.
P - Sets property for all blocks starting with specified name.
S - Sets property for all blocks ending with specified name.
W - Sets property for all blocks containing specified name.

Where y can be one of the following:

P - Sets property value as float.
B - Sets property value as boolean (True or False).
D - Sets property value equals to <Distance To Target> divide by <Property Value>. (See example)
S - Sets property value equals to <Missile Current Speed> divide by <Property Value>. (See example)
T - Sets property value equals to <Estimated Time To Impact> divide by <Property Value>. (See example)
A - Adds <Property Value> to the existing value of the block's specified property.
M - Multiplies <Property Value> to the existing value of the block's specified property.


Example Commands:

SETBP:Gyroscope 1:Yaw:10
Set the Yaw value of "Gyroscope 1" to 10

SETBB:Remote:ShowOnHUD:True
Set the ShowOnHUD value of "Remote" to True

SETPP:Warhead:DetonationTime:5
Set Detonation Time to 5 for all blocks with name starting with "Warhead"

SETBD:Antenna:Range:0.5
If missile is 1500m to target, it will set Range of "Antenna" to 3000; 1500 / 0.5 = 3000

SETBS:Antenna:Range:2
If is moving at 100m/s, it will set Range of "Antenna" to 50; 100 / 2 = 50

SETBT:Warhead:DetonationTime:1
If is estimated to impact in 12 seconds, it will set Detonation Time of "Warhead" to 12; 12 / 1 = 12

SETBA:Warhead:DetonationTime:3
If Detonation Time of "Warhead" is 12 seconds, it will be changed to 15 seconds; 12 + 3 = 15

SETBM:Warhead:DetonationTime:2
If Detonation Time of "Warhead" is 15 seconds, it will be changed to 30 seconds; 15 * 2 = 30


TGx

Usage: TGx:<Trigger Value>:<Trigger Command>

Where x can be one of the following:

R - Triggers the specified command when missile is spinning with RPM at or more than the specified <Trigger Value>.
D - Triggers the specified command when missile is within the distance specified by <Trigger Value>.
V - Triggers the specified command when missile is within the distance specified by <Trigger Value> from the bounding sphere of the target.
E - Triggers the specified command when missile has travelled the distance specified by <Trigger Value>, starting from the time this command is issued.
T - Triggers the specified command X seconds later, where X is the specified <Trigger Value>.


Example Commands:

TGR:25:ACTP:Lock:OnOff_Off
Execute the command "ACTP:Lock:OnOff_Off" when missile is spinning at or more than 25 RPM

TGD:2000:ACTB:Warhead:StartCountdown
Execute the command "ACTB:Warhead:StartCountdown" when missile is within 2000m to target

TGE:500:ACTB:Warhead:StartCountdown
Execute the command "ACTB:Warhead:StartCountdown" when missile has moved 500m since this command is issued

TGT:5:ACTB:Warhead:StartCountdown
Execute the command "ACTB:Warhead:StartCountdown" 5 seconds later


SPIN

Usage: SPIN:<RPM>

Spins the missile at the specified RPM.


Example Commands:

SPIN:10
Spin the missile at 10 RPM
In-Flight Missile Command
You can send commands to the missile in-flight by setting the Custom Data of the R_TARGET Text Panel. The command string is in the following format:

<COMMAND1>:<VALUE1>,<COMMAND2>:<VALUE2>,..... and so on.

Note: Some commands do not have parameter values.

The following is a list of supported commands:

ABORT
Forces the missile to stop homing and fly straight. After this command is issued, no further command can be sent.

CRUISE
Forces the missile to use Mode 4 (Cruise Mode). Missile will start reading from R_TARGET for target coordinates after this.


You can also send In-Flight Commands via Inter-grid Communications. See Inter-grid Communications Section for more information.
Dynamic Configuration Command
You can set the Argument of the Programmable Block to a specific command string to dynamically change missile behavior during launch. The command string is in the following format:

<PARAM1>:<VALUE1>,<PARAM2>:<VALUE2>,..... and so on.

Example:

R_REM:REMOTE_1,V_DVR:1.2,V_DRIFT:FALSE

The available parameters are as below:

MODE - Select the Missile Launch Mode. [Integer]
R_LDR - Set name tag of Lidar Camera on launching ship to use for initial lock-on. [String]
R_TAR - Set name tag of Text Panel on launching ship to use for GPS coordinates. [String]
R_FWD - Set name tag of Block or Turret on launching ship to use for Camera Or Turret Guidance. [String]
R_DES - Set name tag of AI Turret on launching ship to use for AI Turret Lock-on. [String]
V_LS - Set launch duration in seconds, where missile flies forward without turning. [Double]
V_DRIFT - Whether Drift should be used. [TRUE/FALSE]
V_LEAD - Whether missile should Lead Target. [TRUE/FALSE]
V_DAMP - Whether Natural Gravity Dampening should be used. [TRUE/FALSE]
P_VT - Whether to use Vertical Takeoff during launch. [TRUE/FALSE]
P_WFT - Whether to fly straight first until LOCK command is given via R_TARGET Text Panel to start homing. Activating this will ignore launchSeconds variable. [TRUE/FALSE]
P_EMC - Whether to allow missile to read Custom Data of the R_TARGET to get command during missile homing. Refer to In-Flight Missile Commands Section for more information. [TRUE/FALSE]


Note: This Configuration Command will always take precedence over Custom Data Configuration.
183 Comments
WardenWolf 15 May @ 8:28pm 
Is there any way to control WHICH side thrusters are used for vertical launch? For example, if you need the missile to drop down to clear the launch ship, which works fine in gravity but you need it to do so in space, too.
Acid 14 Jan, 2023 @ 3:09pm 
How could I better optimize the missiles to perform good with a speed limit above 100 m/s?
alecz 22 Nov, 2022 @ 7:45pm 
I am using this blueprint https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=847580570 which has an older version of the script that works okay.

I updated to the current version and I can't get the missile to lock. I read the guide several times. How do I get the missile to lock with the default mode: I'm triggering from the Launch script with no arguments.
PiezPiedPy 28 Dec, 2021 @ 8:31am 
Btw: ShowOnHud is in TerminalBlock, Enabled is in FunctionalBlock
PiezPiedPy 28 Dec, 2021 @ 8:27am 
Triggering a merge block with TGD:1000:SETWB:Merge:Enabled:False is throwing an exception, TGD:1000:SETWB:Merge:ShowOnHUD:True worked fine though ??
Succ Nasty 14 Nov, 2021 @ 4:35pm 
oop nvm i got it
Succ Nasty 14 Nov, 2021 @ 4:28pm 
I can't get this to do anything but shoot dummy rockets.
123 13 Oct, 2021 @ 12:08pm 
you can implement this by yourself, VOXAR. this code is an excellent base.
voxar 28 Sep, 2021 @ 4:15am 
I really wish for a fire and forget mode where the missile starts by following the ships R_FORWARD then uses it's own LIDAR for locking on to the first target it sees. For out of range shots with missiles too small to fit a turret and servers without the designator mod.

Feels weird that it's not in here already, perhaps limited by the game api?

Really like this script btw, haven't found any other that doesn't need a whole launch system on the ship!
Lead Hail 26 Apr, 2021 @ 10:02pm 
I don't understand what I am doing wrong. My missiles launch great but it appears they don't track at all, as far as i can tell i'm following all the directions Can I send my blueprint to anyone for help?