Space Engineers

Space Engineers

T-Drone
Survival Ready  [developer] 12 Aug, 2021 @ 4:14pm
Drone Automatition
The small grid combat drone is one of the most interesting and difficult craft in SE. In battle, this is a consumable and therefore drones should be easy to reproduce and independently perform basic functions such as takeoff and return to the carrier, reloading weapons and, of course, fighting the enemy.

To do this, I use my modification of the Easy Automation 2.0 script to develop basic scenarios for the drone and organize cross-script interaction. This allows the drone to be used on carriers of various modifications.

All scenarios are loaded into CustomData of the PBL TFCode program block and will be gradually added to the extent of my modest capabilities. Comments will be given below for each scenario, so that you can, if you wish, change them for your own purposes.

Manual landing

Used to manually land the drone on the carrier using the remote control unit. The state of the drone is determined by the readiness to dock the magnetic plate. If it is ready for docking, then the autonomous program of the drone is turned off, all thrusters and power consumers, including antennas, are turned off, and the chasses and the connector are put into the "locked" state.

@toggle_lock { if LockMode of !TD Landing = ReadyToLock { OnOff_Off PBL Attack OnOff_Off (TDrone, Ion All) OnOff_Off (TDrone, Intercom) Lock !TD Landing Lock !TD Connector } else { OnOff_On (TDrone, Ion All) OnOff_On (TDrone, Intercom) Unlock !TD Landing Unlock !TD Connector } }

Launch from printer

The scenario starts after the end of printing and charging the drone in the hangar. After disconnecting all connectors for 500 msec (0.5 sec), the thrusters' afterburner starts up, and then for 5 sec. afterburner thrusters forward, which take the drone out of the hangar about 100 meters from the ship. After that, all units and antennas are turned on, a unique name is assigned to the drone, and a stand-alone control script is activated.

@get_out { Unlock !TD Landing OnOff_Off !TD Connector OnOff_On (TDrone, Ion All) OverrideThrust to (TDrone, Ion Up) = 10 Delay 500 OverrideThrust to (TDrone, Ion Up) = 0 OverrideThrust to (TDrone, Ion Forward) = 20 Delay 3000 OverrideThrust to (TDrone, Ion Forward) = 0 OnOff_On (TDrone, Intercom) OnOff_On !TD Connector Rename MyGrid = "TDrone_+4" OnOff_On PBL Attack }

Launch from external suspension

The following three scenarios allow you to launch a drone with an external sling in one of the left / right / up directions. The flying distance of the drone from the carrier is determined by the afterburner time of the corresponding thrusters. At the end of acceleration stand-alone control script is activated.

@watch_left { Unlock !TD Landing OnOff_Off !TD Connector OnOff_On (TDrone, Ion Up) OnOff_On (TDrone, Ion Down) OnOff_On (TDrone, Ion Left) OverrideThrust to (TDrone, Ion Up) = 10 Delay 1000 OverrideThrust to (TDrone, Ion Up) = 0 OverrideThrust to (TDrone, Ion Left) = 20 Delay 5000 OverrideThrust to (TDrone, Ion Left) = 0 OnOff_On (TDrone, Ion All) OnOff_On (TDrone, Intercom) OnOff_On TD Connector OnOff_On PBL Attack } @watch_right { Unlock !TD Landing OnOff_Off !TD Connector OnOff_On (TDrone, Ion Up) OnOff_On (TDrone, Ion Down) OnOff_On (TDrone, Ion Right) OverrideThrust to (TDrone, Ion Up) = 10 Delay 1000 OverrideThrust to (TDrone, Ion Up) = 0 OverrideThrust to (TDrone, Ion Right) = 20 Delay 5000 OverrideThrust to (TDrone, Ion Right) = 0 OnOff_On (TDrone, Ion All) OnOff_On (TDrone, Intercom) OnOff_On TD Connector OnOff_On PBL Attack } @watch_up { Unlock !TD Landing OnOff_Off !TD Connector OnOff_On (TDrone, Ion Up) OnOff_On (TDrone, Ion Down) OnOff_On (TDrone, Ion Right) OverrideThrust to (TDrone, Ion Up) = 20 Delay 3000 OverrideThrust to (TDrone, Ion Up) = 0 OnOff_On (TDrone, Ion All) OnOff_On (TDrone, Intercom) OnOff_On TD Connector OnOff_On PBL Attack }

Fire torpedoes

Single and salvo firing with torpedoes of two types is implemented in the last four scenarios. They simply activate the torpedo programm blocks on which the lidar guidance script is installed. Long-range torpedoes have the TFh prefix, and melee torpedoes guided by the AI of the Gatling turret have the TFt prefix.

@fire_tft { Run TFt PBL Missile } @salvo_tft { Run TFt PBL Missile Delay 500 Run TFt PBL Missile } @fire_tfh { Run TFh PBL Missile } @salvo_tfh { Run TFh PBL Missile Delay 500 Run TFh PBL Missile }

Any of the scripts can be displayed digitally on the drone control panel through a program block with an argument corresponding to the block name without the @ symbol, or from the carrier digital panel through another script of cross-script interaction using Easy Automation 2.0.

To be continued... Subscribe to the discussion if you are interested in this topic.