Space Engineers

Space Engineers

Autopilot Mining Drone scripted with programmable block (Upd 4: can be used on remote servers)
285 Comments
Dots 2 Aug, 2018 @ 10:03pm 
This thing is totally broken with current game
Wictor_Little 10 May, 2017 @ 9:29am 
Can anyone confirm this, im going to make one for the server i am in and the admin is a slave driver :P we need more recourses... is this working on version 1.179
Blitz 22 Jan, 2017 @ 2:27pm 
Can you suggest a newer bot that works in current game with no mods? Thanks
Dirzylene 5 Sep, 2016 @ 4:40am 
Кто-нибудь знает, возможно ли создать полностью автоматический дрон - после активации сам вылетает, сам ищет близкие астероиды, сам добывает и сам разгружается/заряжается? И то же самое касательно боевых дронов - по активации вылетают и охраняют корабль?

Does anyone know it is possible to create a fully automatic drone - so it takes off after activation, looking for nearest asteroids, mine aster and return to station for unload/recharge? And the same thing about combat drones - to fly off after activation and protect the main ship/station?
Zarok 5 May, 2016 @ 10:36pm 
Жаль(
Pennywise  [author] 5 May, 2016 @ 7:42am 
Zarok это оооочень старый бот. он уже месяцев 8 не работает
Zarok 5 May, 2016 @ 5:07am 
Не загружается в игру
Pennywise  [author] 29 Feb, 2016 @ 2:13am 
xz You need linear algebra, if i name it correctly in english. Vector and matrix operations, transforming matrixes and stuff alike.
xz 28 Feb, 2016 @ 2:18pm 
Very interesting script. I want to understand but I do not know math. What a math section I need learn up to understand the formula of void GetCoordsRotMatrix () function? since the vector Z I have nothing to do not understand ,but I definitely need it to understand =))
Pennywise  [author] 19 Oct, 2015 @ 10:14pm 
they dont check collisions.
these drones are very old, only one which was updated and still works is here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=394837487
RangerOfTheOrder 19 Oct, 2015 @ 6:22pm 
Can I use multiple drones on one astroid at once? Or are they likely to run into each other?
bnhgray 9 Sep, 2015 @ 6:57am 
How would i go about slowing down this drone? The drone in the downloaded map had already broken off a drill and when I started the H4 from base, it broke off a drill as soon as it started.
Pennywise  [author] 1 Aug, 2015 @ 2:17pm 
Krishna 1 Aug, 2015 @ 2:14pm 
Problem of compilation with the actual version..
Pennywise  [author] 31 Jul, 2015 @ 11:42am 
I've edited Hrv4 to handle with cargo mass. My steam creates new workshop item every time, so here is the link:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=491619315
Pennywise  [author] 31 Jul, 2015 @ 1:04am 
yes, yhank you. i haven`t check what last upd has braught.
i'll probably have to change many things in harvesters and i doubt if my torpedoes will work like before. at least with such economic thrust as now.
3DogBrew 30 Jul, 2015 @ 4:45pm 
The most recent update including "mass" seems to have made the H9 have problems during DrillAlign. Changing the MaxThrust=15000 to MaxThrust=45000 seems to have solved the problem. My line number is 274, but I have heavily modified the code. It is in the PB_Nav code in the "if (Status=="DrillAlign"){" section
3DogBrew 24 Jul, 2015 @ 5:28pm 
I believe I have made all the changes to the PBHRV_Nav script (still need to rename all blocks on the ship and test). I just wanted to comment here that this is real elegant coding. Being able to make these wide sweeping changes without having to re-munge the entire script says a lot about your skill in putting this together. Real nice work.
Pennywise  [author] 24 Jul, 2015 @ 10:27am 
in h4 scripts i renamed all blocks called from script to <ShipName> + <GroupName> + <Index> like "Hrv4FwdThrust3"
and rewritten GetBlocksFromGroup to find blocks by name not by group.
3DogBrew 24 Jul, 2015 @ 8:03am 
Okay, I just checked and I'm using the July 17th version that you've linked to below ( https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=483407282 ) and that version of H9 PBNav has the GetBlocksFromGroup function:
List<IMyTerminalBlock>GetBlocksFromGroup(string group)
{var blockGroups=new List<IMyBlockGroup>();
GridTerminalSystem.GetBlockGroups(blockGroups);
for(int i=0;i<blockGroups.Count;i++)
{if(blockGroups .Name==group)
{return blockGroups .Blocks;}}
throw new Exception("GetBlocksFromGroup: Group \""+group+"\" not found");}

In order to fix this one would need to rename the affected blocks in a "Group" and iterate through them in the "update" functions to resolve this? (i.e. setThrustGroupLevel would need to know the specific names of thrusters rather than utilizing the "thrusts" group).
Pennywise  [author] 24 Jul, 2015 @ 12:15am 
yes, i've changed searching specific blocks by groups to search by block name. groups are faulty when base has other grids connected (blocks of different colors when you brouse grid).
3DogBrew 23 Jul, 2015 @ 7:41pm 
Yep, that was it. Removed the rotor from the base and HRV9 is back to work. Do you remember what was changed in HRV4 for the pistons/rotors issue?
3DogBrew 23 Jul, 2015 @ 6:42pm 
That makes sense. It was working fine for 54 or more drill passes and stopped about the time I added a rotor for a hanger door. I can remove the rotor for now.
Pennywise  [author] 22 Jul, 2015 @ 11:11pm 
or maybe ive just forgotten smth. old drone stucked on connector when base had rotors or pistons. i'm sure i've updated h4. but h9 maybe still uses groups.

Pennywise  [author] 22 Jul, 2015 @ 10:09pm 
old version of hrv9. new one does not use groups
3DogBrew 22 Jul, 2015 @ 4:41pm 
Anyone have any idea why the HRV9 gets confused when it docks to my platform? It seems to get stuck trying to set the NavGyros and Thrusts groups and can't get to the section that sets the status to "docked". Specifically, the error message is: caught exception during execution of script: GetBlocksFromGroup. Group "Thrusts" not found. There are no other groups named Thrusts or anything remotely similar in the control panel. Any ideas? TIA
Spoonie 18 Jul, 2015 @ 10:39am 
No idea on the workshop issue, but thanks for the update!
Pennywise  [author] 17 Jul, 2015 @ 3:34pm 
I've patched Harvester 9. Now it works.
But I have a problem, maybe someone knows how to deal with.
My savegame lost itsk link to workshop world and when i publish it, it doesn,t update previous workshop item, but creates a new one.

The link to working Hrv 9is here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=483407282

But maybe some of you know how to link new save to previous workshop item. please advise.
JaseRocks 17 Jul, 2015 @ 10:43am 
Yes, they have broken your harvester:(
Spoonie 16 Jul, 2015 @ 1:02pm 
The patch today (6/16/15) seems to have broken the Harvester 9. When I try to run the scripts it says "Assembly not found, please recompile", even if I just recompiled it.
Esméa Tuek 10 Jul, 2015 @ 5:55pm 
So in that case, the code is reading "from" containers (e.g. containers on the Harvester) and if the ship is named Harvester 4, then the syntax for the *group* name would be "Harvester 4 Cargo" (ShipName + "Cargo")

You showed line 780 of the Hrv4PB_Nav but neglected to include line 781:
ToContainers = GetBlocksFromGroup("BaseCargo");

Once again, it states to have the destination cargo containers in a group named "BaseCargo".

I C&Ped that line straight from this worldsave on the Harvester 4 ship. (H9 uses the old code that calls on the ship cargo group named "ShipCargo")

I can read code quite well, but can't write it =(
glajsnake 10 Jul, 2015 @ 10:38am 
Ah yes, that's probably it, I'm using the hrv4 and there the line reads

FromContainers = GetBlocksFromGroup(ShipName + "Cargo");

Another mystery solved ^^
Esméa Tuek 10 Jul, 2015 @ 4:57am 
I was just going over the HrvNav script in an attempt to figure out some commands to force it back to dock, as it got stuck in a loop after it finished mining, where it just kept going forward until I lost comms with it and had to reload prior save. (I'm also looking into trimming the status comms to clear out some clutter).

This line here is the reason why the Group name is important:
void LoadCargo(string Load="FromShip")
{
var FromContainers = new List<IMyTerminalBlock>();
var ToContainers = new List<IMyTerminalBlock>();
if (Load=="FromShip"){
FromContainers = GetBlocksFromGroup("ShipCargo");
ToContainers = GetBlocksFromGroup("BaseCargo");

It's possible that the PB_HrvNav scripts are different in this regard between the Hrv4 and the Hrv9. I pulled this code from the Hrv9, which I prefer. I'll check them, but it should be as simple as changing that one bit of code to match.
Esméa Tuek 8 Jul, 2015 @ 1:12pm 
glajsnake, yes, just a group worked fine for me. This was both when I had another script that required different container names (turned off), and when I simply left the default names there.
3DogBrew 8 Jul, 2015 @ 12:42pm 
I have modified and tested the PB_Nav code to include "ice" as an ore type. let me know here if there is any interest and I can find a way to share the updated code for PB_Nav
glajsnake 8 Jul, 2015 @ 11:50am 
It's exactly as you said 3DogBrew and author! (For some reason your name is blank)
I did have a group named BaseCargo but apparently what was needed was for the container to be named BaseCargo, or at least something beginning with base cargo.

Esmea, do you get it to work with only a group named BaseCargo when the individual containers are named something different?

Thanks a bunch for the help to all of you!
Pennywise  [author] 8 Jul, 2015 @ 5:54am 
hehe:) i dont even remember what script version is last wit group or with block names. I guess there should be containers named basecargo. i've noticed that finding blocks by group was faulty when base had some rotors or pistons. maybe this is patched now.
Esméa Tuek 8 Jul, 2015 @ 2:22am 
Fantastic creations. They both qualified in the Minerbot Olympics to compete against the best autonomous mining drones available on the Workshop.
I fear for the opponents if you manage to implement your ranged targeting into these.

Also, 3DogBrew, don't name the container "BaseCargo"; create a group with the container(s) and name the group "BaseCargo" as the scripts are looking for a group name.
3DogBrew 7 Jul, 2015 @ 6:02pm 
Oh, and be sure to recompile PB_Nav after added the BaseCargo container
3DogBrew 7 Jul, 2015 @ 6:02pm 
glajsnake, check my comment below. You need a container named BaseCargo (no spaces) and it will unload.
glajsnake 7 Jul, 2015 @ 4:19pm 
This is a great peice of work you've done here!

I do, however, run into some trouble on my own survival world using the hrv4. The mining and navigation works like a charm but when it's docked to my station it doesn't transfer the ores. I dug into the code and I think I understand what it's supposed to do. It seems it tried to load the cargo from ShipName+"Cargo" but no such block exist, so I changed it to "ShipCargo" (the name of the cargo group on the ship). I recompiled and saved the code in the PB_nav block but unfortionately it still wouldn't transfer the cargo.

Any ideass what could be the issue?

Warm Regards
3DogBrew 7 Jul, 2015 @ 6:02am 
Ah! I found a code block "PB_RemCon" that I had never seen before. (don't know how I overlooked it) Compiled that and everything seems to work fine now.
3DogBrew 6 Jul, 2015 @ 7:25am 
jhnwgacy, thanks for sharing this, I love it.
I am playing survival on local game mode and ran into a couple of issues I would like your advice on. I built the Hrv4 in survival mode using a projector and blueprints. After reading all the comments on this Update, I still can't get the ship to unload cargo. It docks just fine, locking the connector but doesn't ever transfer ores to the base. After reading through all the scripts, I built a large cargo container named BaseCargo and recompiled PB_Nav hoping to correct the issue. Hrv4 still docks but doesn't unload. Is there an incompatibility with the Conveyor Filter block?

Second, can I simply edit the PB_Nav script to include "ice" as an ore type? The harvester doesn't throw it out like stone, but it also doesn't track it as "inventory" either. Is it more complicated than that?

I noted there is a "debug" statement on one of the LCD displays, how can I use this to test any code modifications?
Pennywise  [author] 27 Jun, 2015 @ 2:03am 
coordinates of drilling start point are stored in Data text panel when you launch "start auto" prog block. it doesn't remember previous asteroid.
Fox 26 Jun, 2015 @ 6:24pm 
That's great - I'll give it a try! I'm worried that if I do say 10 shafts on one asteroid, then navigate to a new asteroid, it will try to return to the first asteroid. I assume its smarter than that. Cheers!!!
Pennywise  [author] 26 Jun, 2015 @ 10:35am 
find
float DockGyroPower= 0.5f;
set this variable to higher value.
Fox 26 Jun, 2015 @ 7:45am 
Is there a way to reset everything - as in - to forget which connecters and shaft number and what status it is in? I'm using the small ship Hrv4 and it has got itself awfully confused some how (prolly my fault!) and I just want to reset and start again. It mines 2 shafts and returns to base but it reverses up to the connector and holds fast about 10/15 metres and refuses to actually dock. I need to pilot another craft to push it close to the connectors. It will then engage once it's past this "dead zone" and start offloading ores. Thx.
Pennywise  [author] 26 Jun, 2015 @ 2:08am 
it mined 100+ shafts without explosions in local game, but i've not tested this drone for 3 months since i ve made last update. so maybe smth has changed in game physics.
Pennywise  [author] 26 Jun, 2015 @ 2:06am 
Change these vars to lower values:
MaxSpeed=3; MaxThrust=5000;
line 336 in navigation prog block
alex 25 Jun, 2015 @ 10:38am 
My problem would be in local currently