Space Engineers

Space Engineers

Guidance Block Launch Script Arguments
19 Comments
Dorimanx Apr 25, 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] Apr 24, 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] Apr 24, 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 Mar 31, 2020 @ 7:54am 
Fairly sure this is broken, gives me an object reference error when run with the "Lock" or "Launch" commands.
Zuribachi Dec 26, 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] Jul 19, 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] Jul 19, 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] Jul 19, 2019 @ 12:23am 
Remote ray cast lockon and launch script is done : https://steamcommunity.com/sharedfiles/filedetails/?edit=true&id=1808523552
uglydisease  [author] Jul 18, 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] Jul 14, 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.
Lexx Lord Jul 14, 2019 @ 11:22am 
And the antenna transmission distance increases if you put other antennas on the way to the target (within a radius of 45-50km) for retransmission and so on to infinity (until one of the repeater antennas is destroyed).
Lexx Lord Jul 14, 2019 @ 11:14am 
This is to transfer the coordinates of the target from the scout.
The scout transmits: the GPS of the target, the aiming point over the target (~ 10km).
The rocket determines its coordinates, marks a point above itself (~ 10km) for vertical takeoff, flies to a point above itself, at approach it reorients to a point above the target (or several intermediate points), not reaching a certain distance to the point above the target, reorienting to the target , changes the mode from "GPS Mode" to "Lock-On To GPS Area" and locks the target.
...BOOM
Something like this. :steamhappy:
uglydisease  [author] Jul 14, 2019 @ 10:54am 
Lexx are you sure that you want this to be remotely controlled, a seperate script on the torpedo itself can readjust the gps. Given the range limitations of radio and the absence of a torpedo laser antennia i'm not sure that setting flight paths via remote communication makes sense.
Lexx Lord Jul 14, 2019 @ 10:27am 
//Example: IGC.SendBroadcastMessage("Target", Me.GetPosition(), TransmissionDistance.TransmissionDistanceMax);

NavLaunch NL = new NavLaunch();

public Program()
{
Runtime.UpdateFrequency = UpdateFrequency.Update10;
}

public void Main(string argument)
{
NL.Run(this, argument);
}

private class NavLaunch
{
public void Run(Program root, string command)
{
List<IMyBroadcastListener> listeners = new List<IMyBroadcastListener>();

root.IGC.RegisterBroadcastListener("Target");
root.IGC.GetBroadcastListeners(listeners);

listeners[0].SetMessageCallback("Target");

List<IMyRadioAntenna> guidBlocks = new List<IMyRadioAntenna>();

root.GridTerminalSystem.GetBlocksOfType(guidBlocks);

switch (command)
{
case "Target":
foreach (var item in guidBlocks)
{
//...
item.SetValue<Vector3D>("Adn.PropertyGPSCoordinates", (Vector3D)listeners[0].AcceptMessage().Data);
//...
}
break;
//...
}
}
}
uglydisease  [author] Jul 14, 2019 @ 10:16am 
@Lexx Lord, hows your knowledge of sending messages to programming blocks via antennias?
Lexx Lord Jul 13, 2019 @ 11:26pm 
Add flight route across multiple gps to target
uglydisease  [author] Jul 13, 2019 @ 10:27pm 
1) Added GPS support, you can now paste the GPS in space engineers format into the program block argument and it will set all the torpedos to that GPS.

2) I have also added the ability to change launch type through the script.

3) Fixed a bug with the multiple torpedo launch argument.

4) I have added completely new functionality, you can now string commands together and pass them together into the script for example if you want to set the guidance to GPS mode, then set the GPS and then tell it to fire you can use the following

ACTIONLIST;type 2;GPS:gpsLocation: 15:-5:2.5;LAUNCH

If anybody has any suggestions on any other features they want let me know.
uglydisease  [author] Jul 13, 2019 @ 2:06pm 
@Lexx Lord, I'll take a look the next chance I get, I tried to look online to see what format the vector3d was expecting but didn't find anything. I may want to write some code to convert the GPS clipboard copy string to vector3d format so that people don't have to convert manually.

If this can work I can see some cool applications for it in concert with antennias and radar mods that autolock based on argument passing.
Lexx Lord Jul 7, 2019 @ 12:15pm 
It looks like it works:

if(command.ToUpper() == "GPS")
{
Vector3D target;
Vector3D.TryParse(unit, out target);

for (int i = 0; i < gdblocks.Count; i++)
{
gdblocks[i].ApplyAction("OnOff_On");
gdblocks[i].SetValue<Vector3D>("Adn.PropertyGPSCoordinates", target);
gdblocks[i].ApplyAction("OnOff_Off");
}
}

Argument format: GPS {X:12.45}{Y:11.45}{Z:78.65}