Space Engineers

Space Engineers

Not enough ratings
Drone Master Script v3.4
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
6.845 KB
Jun 1, 2017 @ 9:29pm
Jul 9, 2017 @ 10:24am
5 Change Notes ( view )

Subscribe to download
Drone Master Script v3.4

Description
This script allows for navigation and task control of automated drones.

Requires:
* LCD/Text panel for commands input
* LCD/Text panel for diagnostic output
* Timer block
* Remote control
* Programmable block (not referenced by script)
* Names are set at the top of the script and can be modified.

Operation:
* Set behaviors at the top of the script
* Write commands to Text Panel GPS, in the order in which they are to be followed
* Start the timer
* Watch as the drone executes given commands and behaviors

Commands: GPS, Echo, Action, Dock, Lock
Behaviors: isSet, isScanning, isSearching
All commands are written in the format:
Type:Argument1:Argument2:...:ArgumentX:

Action Command:
Summary: Applies the specified action to the specified block
Argument 1: Block Name
Argument 2: Block Action
Example: Action:Spotlight:OnOff
Notes:
Be very careful that the specified block can apply the specified action! BAD THINGS will happen otherwise.
Introduced in v3.2.

Dock Command:
Summary: Docks the drone to a specified docking point
Argument: GPS location of docking point
Example: Dock:0:1:2:
Notes:
Testing is ongoing - there may be bugs!
Moving drones near the docking point before calling a dock command is recommended
Introduced in v3.2.

Echo Command:
Summary: Repeats the given argument to the diagnostics panel
Argument: string
Example: Echo:Hello Clang!:
Notes:
Mainly useful in validating the new task system
Introduced in v3.0.

GPS Command:
Summary: Moves the drone to a specified waypoint
Argument 1: Name
Argument 2: Location
Example: GPS:Name:0:1:2:
Notes:
The GPS command is formatted exactly the same way as GPS points copied from the list - just paste them into the command panel!
Introduced in v1.0.

Lock Command:
Summary: Locks/unlocks the drone
Argument 1: Lock type (connector, merge, landing gear)
Argument 2: String "unlock" for unlock, anything else for lock
Example: Lock:Connector:unlock:
Notes:
Introduced in v3.2.

Set Behavior:
Summary: Test behavior for behavior manager
Variables: isSet (bool)
Description of isSet: Enables/disables test behavior
Notes:
Introduced in v3.3.

Scanning Behavior:
Summary: Runs continuous scans
Variables: isScanning (bool), scannerType (string)
Description of isScanning: Enables/disables scanning
Description of scannerType: Sets the type of scanner
Recognized inputs for scannerType: "radar", "sensor"
Notes:
Introduced in v3.3.

Searching Behavior:
Summary: A volumetric search pattern centered on the starting point
Variables: isSearching (bool), scannerRange (double), searchBorder (int)
Description of isSearching: Enables/disables searching
Description of scannerRange: Sets the distance between waypoints.
Recommended: Max range of the scanner * square root of 2.
Description of searchBorder: Sets the farthest layer out the drone will search.
Notes:
Introduced in v3.4.

Planned Features:
* Interception
* Aiming and weapon use
* Tool use
* Inventory

Example navigation drone: Nav Drone v3.3.

Have Fun!

If you find bugs, please let me know in the comments and I will see what I can do to fix!
11 Comments
baterenema Aug 10, 2022 @ 7:27am 
how can i view the code ?
Fish Oct 15, 2020 @ 12:26am 
Next century huh? 👀
Foundation Mar 28, 2019 @ 3:30am 
do you plan on rewriting this ?
rlb  [author] Jun 7, 2018 @ 7:32pm 
Sorry for late reply. This script was somewhat poorly designed (being grown from an automated taxi service) and development has been discontinued. Specifically, I didn't write in any support for persistent data, i.e. an active target, and shoehorning it in would not work well.

New drone script is in the works, to be released next century :)

To answer your question, this version is capable only of scanning, flying, &c. Next version was to be automatic, attack, and so on, but I couldn't build in support.
Roasty my Toasty May 16, 2018 @ 9:04am 
(Sorry for spam posting, things are just occurring to me as I think of them and I cant edit comments) I can have turrets set to attack everything just turned on
Roasty my Toasty May 16, 2018 @ 9:01am 
And what would I type into the text screen?
Roasty my Toasty May 16, 2018 @ 9:00am 
Could you use this script to have murderous friendly drones agressively look for and attack anything in sight explore the whole surface of a planet?
rlb  [author] Jul 8, 2017 @ 4:40pm 
@The Mirage Thanks, I'll look into it and see if by any chance it's on my end!
The Mirage Jul 8, 2017 @ 3:43pm 
This works well in single player. In multiplayer there is a problem where the drone will not accept any new waypoints. Even if you clear the GPS text box and enter new waypoints, it won't use them and will return to the first set of waypoints you entered. Eventually it will just stop responding, thinking that it's already at a final waypoint.

This happens manually using the remote control block and adding waypoints as well, so I beleive it's a SE core bug. But if anyone else runs into this it would be useful to know.
rlb  [author] Jul 8, 2017 @ 4:11am 
(v3.3) Not too useful for anything quite yet. It can move around, scan things, dock to things, and perform actions at waypoints (see Action List [spaceengineerswiki.com] for actions).

To use it:
- Build a drone with two text panels, a timer, a remote control, and a programmable block.
- Make sure all the names of the above are correct (you can double-check the names used in the script; they're at the top) and set the timer to run the programmable every second.
- Set behaviors in the script (also at the top) and enter commands into the command text panel (e.g. move here, dock here, etc).
- Start the timer and let the drone go!

If you don't wanna do that, you can pull the example drone I made from the link at the bottom of the workshop page and modify it.
Hope this helps!