Space Engineers

Space Engineers

Not enough ratings
Guidance Block Launch Script Arguments
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
15.869 KB
5 Jul, 2019 @ 6:48pm
18 Jul, 2019 @ 8:04pm
4 Change Notes ( view )

Subscribe to download
Guidance Block Launch Script Arguments

Description
Original Code written by : R.U.Sirius
https://steamproxy.net/workshop/filedetails/?id=1408954946
Based off code by : Alyius
https://steamproxy.net/workshop/filedetails/?id=1408954946
Multi argument code by : uglydisease

Torpedo Guidance Control Script
NOW WITH INTERGRID LAUNCH FUNCTIONALITY
Functionality :
1) Allows you to trigger multiple complex commands to allow torpedos on a grid using a single program block activation
2) Allows intergrid communication with grids that have torpedos and with the torpedos them selves, even after they are launched. This allows small ships without torpedos to use the torpedos on larger ships. See the sender script for more information https://steamproxy.net/sharedfiles/filedetails/?id=1808523552


Single Argument Commands :
TRDM_On or TRDM ON
Turns on the "Target Random Block" option for all Guidance Blocks with the associated GuidanceTag, good for targeting large ships/stations, not so good for small ones. Must b/*
Original Code written by : R.U.Sirius
https://steamproxy.net/workshop/filedetails/?id=1408954946
Based off code by : Alyius
https://steamproxy.net/workshop/filedetails/?id=1408954946
Multi argument code by : uglydisease

Editable Fields :
string GuidanceTag =
int launchSelectionType =


Single Argument Commands :
TRDM_On or TRDM ON
Turns on the "Target Random Block" option for all Guidance Blocks with the associated GuidanceTag, good for targeting large ships/stations, not so good for small ones. Must be set before lock on for it to work.

TRDM_Off or TRDM OFF
Turns off the "Target Random Block".

Lock
This will turn On and set a Lock on target for all Guidance Blocks with the associated GuidanceTag, based on whatever settings you selected for them.

Launch
Launches one missile/torpedo each time it's run. Which Guidance Block is launched is based upon launchSelectionType.

Off
Turns off all Guidance Blocks with associated GuidanceTag

Properties
Lists the properties that the guidance block has

MultArgument Commands :

LAUNCH x
Launches x torpedos

DET_DIST x
Torpedo distance from target that causes detonation

CLEAR x
Clearance in seconds from launch that the torpedo becomes active

NAV_CONST x
Sets the navigation constant to x

MAX x
Maximum lockon distance

MIN x
Minimum block size of target for lockon

DMS x
Dead man switch distance

DETACH / THRUST / GYRO x
Sets the tag that the torpedo uses blank by default

{GPS coordinate}
Sets the gps for all torpedos to the coordinate,

TYPE x
Sets the lock on type x is a number as follows :
0 : LOCK_ON_FORWARD,
1 : LOCK_ON_AIM_BLOCK,
2 : LOCK_ON_GPS,
3 : GPS_MODE,
4 : GLIDE_MODE

Multiple Commands in an Argument :
Use ActionList followed by your commands seperated by semicolons.
Note : Don't add extra spaces as these will get picked up as splitters between commands and argument.

Example:
ActionList;type 0;Det_DIST 20;LAUNCH 2
- Sets the fire type to Lock On Seek Forward
- Sets the detonation distance to 20m
- Fires two torpedos

ActionList;type 2;Det_DIST 20;GPS:uglydisease #2:-11091.43:2154.46:15634.07;LAUNCH 6
- Sets the fire type to Lock On In Gps Area
- Sets the detonation distance to 20m
- Sets the gps point in the guidances
- Fires six torpedos

Inter-grid Operations :
- Receiving
You can send commands to any torpedo block simply by sending your message to "TorpedoGuidancePB"
Example : IGC.SendBroadcastMessage("TorpedoGuidancePB", "ActionList;type 3;Det_DIST
20;GPS:uglydisease #1:9122.15:-7181.37:14153.59:;LAUNCH 1");
- Sending
Right now this is done using a second script see https://steamproxy.net/sharedfiles/filedetails/?id=1808523552

An untest feature for this script is enabled this is meant to communicate with a second torpedo guidance script on the torpedo itself. Note : This is currently done with the other script above

Example (To redirect an already launched torpedo) :
REMOTE;ActionList;GPS:uglydisease #2:-11091.43:2154.46:15634.07;LAUNCH 1

Possible Additions :
- Implement timing mechanic between commands
- Create a remote launch script with built in ray cast to get gps
19 Comments
Dorimanx 25 Apr, 2020 @ 6:34am 
I think it's will be best if you remove from Required Missile Guidance Block is this mod is broken now... not sure if ever will be fixed.
it's will be force loaded and damage the working guidance mod.
uglydisease  [author] 24 Apr, 2020 @ 7:03pm 
MrZurbachi, The script is currently only dealing with the control block. The problem you are describing is pretty easy to fix however, either with timer that is linked to both the guidance block and the battery, or better yet with a second program that searches for a keyword in your batteries names and turns them on. In theory this could be added to the same program code as this one. I haven't been working much on SE lately however.
uglydisease  [author] 24 Apr, 2020 @ 6:57pm 
_x0 the problem is with the guidance block the script. Try For_Server_11_Guidance mod instead, I tested it and its working fine there.
elimin8 31 Mar, 2020 @ 7:54am 
Fairly sure this is broken, gives me an object reference error when run with the "Lock" or "Launch" commands.
Zuribachi 26 Dec, 2019 @ 12:22pm 
So, really liking your additions. Any chance you might a command to turn recharing on torpedo batteries on/off? I need to set my torpedoes to recharge before launching them, otherwise my grids suck them dry if the torpedo remains unused for some time, not leaving enough energy to fly longer distances.As of now, I have to recharge/discharge my torp batteries manually by opening the control panel, but that's not really to my liking, since I'm using such scripts for easier use
uglydisease  [author] 19 Jul, 2019 @ 11:10pm 
Oh and if you dont want the torpedo to blow up when hits the GPS marker set the DET_DIST to 0
uglydisease  [author] 19 Jul, 2019 @ 11:09pm 
@Lexx Lord, I have confirmed that this can now working to redirect torpedos after launch. You will need to attach a programming block and an antenna to the torpedo, equip this script to the torpedo. Then on your ship use the Intergrid Torpedo Lockon and Fire Script, place the GPS you want to send the torpedo to in the custom data of the PB with the lockon and fire script and pass the following argument : SEND@TYPE 3;LAUNCH The torpedo will then change direction toward the GPS you put in the customData. This can be repeated or changed to GPS lockon by using TYPE 2
uglydisease  [author] 19 Jul, 2019 @ 12:23am 
Remote ray cast lockon and launch script is done : https://steamproxy.net/sharedfiles/filedetails/?edit=true&id=1808523552
uglydisease  [author] 18 Jul, 2019 @ 8:16pm 
@Lexx Lord, I added I some intergrid functionality. I haven't tested trying to activate these commands on a torpedo in flight but it should work. I am thinking about adding a companion script for creating a drone or fighter to relay and fire torpedo's remotely.
The sender code is really simple :
public void Main(string argument, UpdateType updateSource) {
IGC.SendBroadcastMessage("TorpedoGuidancePB",
argument
);
Echo("Your order was broadcasted " + argument));
}
uglydisease  [author] 14 Jul, 2019 @ 10:02pm 
@Lexx Lord, This is possible I did some testing, before I got distracted by my space tether, a torpedo that is already launched can be retargeted by setting a new gps and hitting the launch button again.

Its too bad there is no indicator for when the torpedo reaches its gps, it either blows up or flies around in circles but its status is always idle, so there is no way to pre-program a set of GPS without either trying to calculate flight time or altering the mod itself. This was my original idea.

I can take a look into your suggestion, but I doubt I'll get around to it til next weekend.