Space Engineers

Space Engineers

31 ratings
Pirate Drone - Basic
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
819.000 B
16 Dec, 2016 @ 9:50am
1 Change Note ( view )

Subscribe to download
Pirate Drone - Basic

In 1 collection by Meridius_IX / Lucas
Meridius_IX's Script Library
5 items
Description
This script will give a ship basic pirate drone behavior. It's similar to the vanilla pirate drone script, but with a few minor differences.


Behavior:

When the drone spawns, it will set its current location as its 'origin'. If a player comes within 10km of the origin point, the drone will begin chasing the player. If the player exits the 10km radius, the drone will return to the origin point.

Please note that this script will only function properly when the grid is owned by a hostile NPC player / faction.


Setup:

Your ship will need the following blocks:
- Remote Control
- Programmable Block
- Timer Block

1. Load this script into the Programmable Block and compile/save.

2. On the Remote Control block, "Collision Avoidance" should be turned "ON" and "Flight Mode" should be set to "One Way"

3. Set the timer block to Run the Programmable Block with default argument and "Start" the same timer block (so it loops). Set the timer block delay to 1 second.


Differences:

This script will calculate the origin differently than the vanilla drone script. When the drone spawns, it will check to see if an origin was already been set (which often happens when a player is testing drone designs). If an origin is detected, it will compare the distance of its current location with the stored origin. If the distance is greater than 15km (which in most cases it should be), then the drone will set its current location as the new origin.

The drone should only travel 10km from whatever it's origin is, so there's very little chance that it will venture out further than 15km from origin, triggering a new origin for itself.
51 Comments
Nitrogameace 5 May, 2023 @ 12:10pm 
is there any script that can?
Nitrogameace 5 May, 2023 @ 12:10pm 
Does this script not know how to use wheels?
Captain Durall 16 May, 2022 @ 10:24pm 
Did this stop working with thrusters? Ive tried modded unmodded thrust override everything
Daniel L Parry 9 Feb, 2022 @ 9:41am 
great to know, with the new guns I'm looking to make my own targets that shoot back
Meridius_IX / Lucas  [author] 8 Feb, 2022 @ 1:55pm 
Probably, it's super simple/basic. I cannot imagine that anything that changed in the recent update would have broken it
Daniel L Parry 8 Feb, 2022 @ 1:47pm 
Out of curiosity, does this still function in a post Warfare 2 update version of the game?
ARK7 26 Aug, 2020 @ 12:52pm 
Ok
Meridius_IX / Lucas  [author] 26 Aug, 2020 @ 11:36am 
no, this will only pursue player entities.
ARK7 26 Aug, 2020 @ 11:24am 
will this go after NPC ships that are at war with the drone's faction. (will a SPRT drone go after a Reaver)
jackleyakul 19 Apr, 2020 @ 1:00pm 
ok. I figured that is the case.. that is how most of the pirate scripts are.. i was just hoping you "maybe" had modified it... it such a sad thing that there isnt a decent drone script out here.. there is so much potential for it, but no one has tackled it. every script i have tried has not worked well.
I appreciate your quick response!!

there are some scripts with limited or situational function, but nothing with true utility unless you know C# and make it yourself... i started dabling in coding specifically for this lack in the mod community, but im extremely unlearned and it will be awhile before i can make a functioning script.