Space Engineers

Space Engineers

574 个评价
[RETIRED] Whip's Optical Missile Guidance Script
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
43.447 KB
2015 年 11 月 1 日 下午 5:26
2020 年 5 月 18 日 上午 8:47
35 项改动说明 ( 查看 )

订阅以下载
[RETIRED] Whip's Optical Missile Guidance Script

在 Whiplash141 的 1 个合集中
Whip's Script Archive
5 件物品
描述
This code is no-longer supported! New version can be found here:
https://steamcommunity.com/sharedfiles/filedetails/?id=2108743626


REMINDER: Do not edit the code to change variables, you need to use the custom data field. Ignore that part of the video.

PSA: My Block Renamer Code may help you out a TON with naming and prefixing blocks with the missile tag!


Version 62-13
You can now set variables by using the program block's Custom Data!



Howdy!

This script allows you to make optically guided missiles much like those used on my Komodo Guided Missile Destroyer! Missiles (or torpedoes) using this script will follow wherever the firing vessel aims, much like a TOW missile. All block name tags are customizable inside the code; I have added plenty of comments to aid anyone who wishes to tinker with it :)

Features
  • Configurable spiral trajectory to avoid turrets! (can be turned off)
  • Configurable detach sequence parameters!
  • Automatic thruster orientation detection! No more pesky directional naming needed :D
  • Works in atmosphere!
  • Runs at 20 Hz (old was 60 Hz) so it is much less laggy! Three new missiles lag less than one of my old ones!
  • Compensates for unwanted drift!
  • Automatically shuts off and goes ballistic if vital components are damaged
  • Safety mechanisms to stop the missile from flying up your tailpipe!
  • Built in support for using AI Turrets as a Shooter Reference
  • Impact point can be offset vertically and horizontally!


The missile must be attached to the same grid as your firing platform via merge block and the reference remote can be attached statically or through rotors (yes rotor-based turrets work).

Missile Setup
    ALL BLOCKS on the missile should have the name tag "Missile 1" added in their names.
    REQUIRED BLOCKS
    • A Remote Control pointing FORWARD
    • A program block with this code
    • A battery or reactor (for power)
    • A merge, connector, or rotor (for attachment points)
    • A gyroscope
    • Some forward thrusters
    OPTIONAL BLOCKS
    • Artificial mass block(s)
    • A beacon (Highly recommended)
    • Antenna(s)
    • Timer(s)
    • Sensors
    • Warheads
    • Side thrusters
    You can now turn off anything but the timer and program if you so desire.

Shooter Ship Setup
    Make a remote or a turret with name "Shooter Reference" facing forward. (Remotes will be prioritized before turrets!)

Firing Instructions
    Attach the missile to your shooter ship and use my Missile Fire Script to fire them :)You can also manually fire by running the argument fire

Error Checking
    As seen in the video, you can use the code to error check your missile setup.
    1. Open up the ship terminal and find the programmable block
    2. In the argument field type "setup"
    3. Run the program once
    The code will then display any critical errors that it detects and will automatically prevent you from firing a missile off without the correct components.

Setting Up Multiple Missiles
    To make additional missiles change the missileTag in the CUSTOM DATA of the missile's programmable block. Now repeat the missile setup, replacing the number 1 with the new number. Names for missiles must be unique to avoid issues. Example: If you have 10 or more missiles, your tags will have to be like "Missile 01" for single digit numbers

Using Missiles on Planets
    To use missiles on planets there is no additional setup required. Make sure that the down direction of the missile's remote control is pointed downwards as well. The code will attempt to orient the down direction to the ground allowing you to use nothing but upwards thrust and forward thrust :)


I hope y'all enjoy using this script! If you have any questions feel free to leave a comment here :)

- Whiplash141
1,046 条留言
Whiplash141  [作者] 2021 年 11 月 18 日 下午 1:00 
See the comment below yours
AlienAirl 2021 年 11 月 18 日 上午 9:48 
No main thruster found. It works randomly
Whiplash141  [作者] 2020 年 5 月 25 日 上午 11:27 
This code has officially been retired and replaced by WHAM: https://steamcommunity.com/sharedfiles/filedetails/?id=2108743626
Readtext 2020 年 5 月 20 日 下午 7:21 
Oh) Everything works) Why it didn’t work before) Magic)
Whiplash141  [作者] 2020 年 5 月 20 日 上午 7:42 
missileSpinRPM or something similar in the custom data
Readtext 2020 年 5 月 20 日 上午 7:18 
I checked this and everything works)) We need rotation along the axis, without displacement of the rocket. It is necessary for super heavy missiles with baits removed on 5-6 blocks
https://wiki.freecadweb.org/File:Tache_Placement_Roulis_fr_Mini.gif
Whiplash141  [作者] 2020 年 5 月 19 日 下午 9:50 
"How to add torpedo rotation?"

enableSpiralTrajectory
spiralDegrees
timeMaxSpiral

in the custom data
Readtext 2020 年 5 月 19 日 下午 6:15 
How to add torpedo rotation? Lures on long beams die from turrets in direct flight. Rotors are not built by projection ((
Jaeger 2020 年 5 月 1 日 下午 8:10 
might just be the script is disabled or something on the server. tho it loads fine
Jaeger 2020 年 4 月 29 日 下午 7:40 
the same blueprint works fine in singleplayer. https://youtu.be/mUaYfFdyJQQ but in multiplayer they just twist around in the same spot in space kind of erratic jerking aruond