Space Engineers

Space Engineers

395 ratings
Easy Lidar Homing Script
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
94.705 KB
27 Nov, 2016 @ 3:14am
21 Dec, 2019 @ 6:18pm
77 Change Notes ( view )

Subscribe to download
Easy Lidar Homing Script

Description
Lidar Homing uses the latest Camera Raycast Lock-On. This is a Fire and Forget missile script. After initial aiming and achieving lock-on, missile will be fully autonomous and tracks the target with leading intercept.

NEW!! Revamped Guidance System to use better intercept calculations. Missile is now MUCH HARDER to Dodge!
https://youtu.be/3LRfwtnRlOk


This is a Vanilla Script. NO MODS are required.

See Homing Modes for the different ways this script can guide the missile (Raycast Lidar, TV Guided, AI Turret, GPS etc)


The Complete Setup Guide for this script can be found at:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1211340504


Tutorial Video can be found here:
To be released on weekends.



NOTE: Timer Block NO Longer Required! Script loops itself automatically.

WARNING: Camera Panning Mod messes with this script! This is an API limitation, nothing can be done.

WARNING: Camera Crosshair is highly misleading and may not be the actual aim point, causing off center aiming and unable to lock-on.

WARNING: PID Values have been Re-Normalized! If you have tweaked AIM_P, I, D and LIMIT before, you need to convert it from angles to radians (i.e. divide by 30 then multiply by Math.PI).

NEW: useOffsetTargeting and useOffsetRaycasting flag available to enable homing in on specific spots of the target instead of its center. Available for all Lidar Type Modes. See Custom Data Configuration Section for more info.


Best used together with the Launch Control Script to launch multiple missiles:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=691441036

And also with Missile Status Script to get missile lock-on information:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=702255497



Demonstration Builds:

Red Ship Mech by Halipatsui:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1285924680

X479 Cruiser Rabblerouser by Monorchid:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1382285229

Stalker Skyfighter:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1109370030

Stalker Spacefighter:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1109370333

Twinhydro Mobile SAM:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1221350549

Patriot Mobile SAM:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1230416099




Available Homing Modes

(Lidar means Camera Raycast)

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

[Mode 1] Lidar Homing, Initially GPS Targeted
Lidar Homing using coordinates from launching ship's R_TARGET for initial lock-on.

[Mode 2] Lidar Homing, Initially Camera Guided
Lidar Homing using launching ship's R_LIDAR for initial lock-on and R_FORWARD for aiming with initial Camera Guidance. R_FORWARD can also be a Turret.

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

[Mode 4] GPS Cruise
Homes in on the GPS Coordinates set by the R_TARGET Text Panel.

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

[Mode 6] Fixed Glide
Homes in based on the direction the R_FORWARD is facing during launch. Direction is fixed after that.

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

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

[Mode 9] Turret AI Homing, Initially Camera Guided
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.



Important Notes

1) Default maximum lock-on range is 3km. You can increase this by setting LIDAR_MAX_LOCK_DISTANCE in metres. Longer range means more delay between beam traces as Camera cooldown is longer.

2) For testing purposes, missile is set to lock on to ANY grid it can raycast to. For actual PvP use, write this line to the Custom Data of the script's PB to make it only lock on to enemies:
excludeFriendly=true


Proximity Sensors

This script supports the use of raycast cameras as proximity fuses.

See Guide.

Custom Data Configuration

You can set the Custom Data of Programmable Block to specify various settings or change script variables, avoiding the need to edit the script everytime when updating to newer script versions.

See Guide.

Inter-Grid Communication

This script supports Inter-Grid Communications.

See Guide.

Missile Deployment Commands

Missile can be set to perform certain actions based on range to target and other measurements.

See Guide.

In-Flight Missile Command

Missile can be aborted in-flight or change to GPS homing.

See Guide.

Dynamic Configuration Command

You can set the Argument of Programmable Block to a specific command string to dynamically change missile behavior during launch.

See Guide.


IMPORTANT: AVOID using useOffsetRaycasting=true as it will cause lock-on to lose lock easily, since it will not raycast the center. Let the script decide when to use it automatically instead. You can use useOffsetTargeting=true however (note the spelling, these are different parameters!)

useOffsetTargeting => Missile homes to your aim point, such as to take out specific points on a base or large targets.

useOffsetRaycasting => Missile locks on to last raycast hit point, specifically used for ships with a large hole in it (cannot lock on to middle in this case). Else this has absolutely no uses.


Others

Skybox Aurelia by AssHunter:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=493552729
Popular Discussions View All (3)
7
30 Mar, 2020 @ 9:22am
Problems with Script
DMN Nitemare
0
12 Jun, 2020 @ 3:47am
problems with custom setup
puppamilaspranga
0
22 Mar, 2020 @ 10:53am
Mode 1 doesn't work as expected
Kyr
859 Comments
HydraDominatus 28 Apr @ 12:38pm 
does anyone know how to change script so it works in situation where missile is already detached? I made it so missile runs it's PB after detachment through event controller so I can launch missiles without adding them to hotbar
Bumongus 23 Apr @ 7:03am 
Best bet is to take a look and see how it groups thrusters I guess... :\
It should say in the comments somewhere how it works
WardenWolf 21 Apr @ 7:40pm 
So, running into a problem. The missile keeps misidentifying the gravity dampening thrusters as the main thrust (instead of automatically selecting based on R_FORWARD which would make sense). Your setup guide mentions correcting such automatic selections but doesn't say how.
DUBwithCHEESE 22 May, 2024 @ 8:37pm 
distance=2
dmsrange=5
failunsafe=true
failasgroup=true
FreezingPanzer 18 Jul, 2023 @ 9:10pm 
can anybody provide me what to put into the camera custom data that allows me to do the following.

the missile will be in launch bay with all warheads NOT armed. once launched it will arm it self when the missile is within 60 meters of the target.

i understand that a extra block sensor can also do the job, but i would like to do the job with the scripts custom settings.
EndoMatrixHD 9 May, 2023 @ 4:27am 
is it normal to not get any Lock-on sound before i shot the missile? everytime the sound yust comes aftherwards, so i dont know when it is locked on?
Plongo 17 Sep, 2022 @ 6:48pm 
Hey @Alysius do you think you could update the script so it can run the custom turret controller &/or search light as the R_DESIGNATOR? Cheers
Daxter 15 Aug, 2022 @ 7:51am 
Hello. Could you add me as a friend? I wanted to talk about a new project.. I hope you can help..
Boldtaar 21 Jun, 2022 @ 5:41pm 
never mind I found the problem. I had some old override in custom data field for the cameras
Boldtaar 21 Jun, 2022 @ 3:23pm 
Not used this script in a while is still working?
Having problem with proximity fuse and Dead Man's Switch not detonating my Warheads