Space Engineers

Space Engineers

"Behind you" drone-companion script
423 Comments
Skleroz  [author] 2 Dec, 2022 @ 2:27am 
@jivaii Yes, script works with thrusters.
jivaii 2 Dec, 2022 @ 1:06am 
I take it this only works for flying drones, not rover drones?
Skleroz  [author] 30 Oct, 2022 @ 1:43am 
@CDR.Kitten Good news! Glad to to hear that script is working again
User error is totally normal, without error will be no progress XD
CDR.Kitten 29 Oct, 2022 @ 8:14pm 
The script works fine after having built a new one from scratch. I think it's just some weirdness when trying to update the ship. Most likely it's my own user error honestly. XD
Skleroz  [author] 29 Oct, 2022 @ 11:35am 
@CDR.Kitten I have an idea. Script calculates average runtime in terminal?
Skleroz  [author] 29 Oct, 2022 @ 11:31am 
Well, this kinda strange, until it has thrusters, gyros, sensor and some type of control block with "_Follow" appendix, it should work. At least, it works in my local example world. Script needs text panel of the PB, it could be an issue, when PB replaced by modded one.
CDR.Kitten 28 Oct, 2022 @ 3:32am 
Yeah my old BB was from Aug-2020. It served me well until I realized the script has been overhauled. I swear, time flies when you're having fun. :D I did try to throw in the new appendix but the whole girl was like, way too old. I decided to mothball my BB-02. I mean, to give an example her antenna was like An0.follow and a bunch of old stuff back when times were simplier and a bit more buggy. :D
Skleroz  [author] 28 Oct, 2022 @ 12:05am 
@CDR.Kitten Hi! "program.V is not used..." - this is just warning, it shouldn't break anything. In old versions there were a lot of unused variables in the code =)
Regarding version changes - if I remember correctly, there were several appendix changes? it could source of the problem. In the actual version for all terminal blocks used by the script appendix "_Follow" have to be applied. Hope this will help!
CDR.Kitten 27 Oct, 2022 @ 11:20pm 
Heyoh. I'm getting a, program.V is not used error on code-check.Not sure if impacts anything but, after having updated my drone from an ancient version of the code, she's not too keen on doing anything haha.
Skleroz  [author] 10 Oct, 2022 @ 10:38am 
@Shadaris Hi! Custom turret controller doesn't work without full setup. Theoretically you could install two rotors and camera but it makes grid too complicated.
Shadaris 10 Oct, 2022 @ 8:35am 
other then using a longer sensor mod, would it be possible to adjust to use the custom turret controller in order to locate the player at least past sensor range? then swap to the sensor for "fine tuning"
Skleroz  [author] 15 Sep, 2022 @ 2:46pm 
@Texnik Если моды сервера не затрагивают работу сриптов и/или сенсор, проблем в теории быть не должно. У всех жизненно важнй блоков должен быть соответствующий аффикс, вроде больше ничего не требовалось. Как вариант, соббственники у ПБ и дургих блоков разные, может повлиять.
Texnik 15 Sep, 2022 @ 2:16pm 
Не наботает на сервере Sofa Space
Или я что то делаю нетак, хотя перепробовал, как мне кажется, уже всё
Skleroz  [author] 17 Aug, 2022 @ 1:29am 
Этот скрипт никогда не задумывался как боевой. Не те задачи. Поставить турель на грид можно, но какой-либо оптимизации или нацеленности на боевое применение не планировалось.
shllyapnikov 16 Aug, 2022 @ 4:07am 
Кстати скрипт Behind you может защитить от пауков, волков и вражеских дронов?
shllyapnikov 16 Aug, 2022 @ 4:04am 
2-й вариант на мой взгляд (Если это возможно) это удаленное управление. (Т.е скрипт загружается на корабль и через различные антенны и ДУ с камерой управляет им). Плюс сенсор настроенный на обнаружение ракет, метеоритов, врагов и гридов. Главная задача дрона по сути это эскорт т.е сопровождение любого вида. Ну или создание мода.
shllyapnikov 16 Aug, 2022 @ 4:04am 
Ну в принципе возможно создать скрипт конкретно для корабля. И как вы сказали 1-й вариант это разделение скрипта на основной и дополнительный которые будут обмениваться координатами (Чем то напоминает скрипт Auto-Docking Optional Home Script 2: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2155667657 и Spug's Easy Auto-Docking 2: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2146371052 . Но они не боевые).
Skleroz  [author] 16 Aug, 2022 @ 2:13am 
И все это вкупе не решает проблемы отслеживания, какой из гридов владельца сейчас управляется владельцем. Это серьезно мешает и обнуляет все костыли для следования на большом расстоянии.
Skleroz  [author] 16 Aug, 2022 @ 2:11am 
Турели вне задачи - если они не могут стрелять, они не ловят цель (не знаю, справедливо ли это сейчас), да задачи у этого скрипта исключительно мирные, не про это. Пиратский скрипт работает на команде, недоступной, когда владелец ПБ - это игрок.
Skleroz  [author] 16 Aug, 2022 @ 2:11am 
@shllyapnikov Я скорее пишу про то, что если для решения задачи использовать моды, то нет смысла ограничиваться внутриигровым скриптом, а сразу делать мод. Толку, если и так придется моды ставить, где один, там и несколько. Для того, чтобы получать координаты другого грида средствами внутриигрового программирования, на другом гриде должен тоже стоять ПБ, либо нужно как-то коннектиться и запоминать блоки. В таком случае проще пристыковать дрон и транспортировать его.
shllyapnikov 16 Aug, 2022 @ 1:43am 
@Skleroz Но все это лишь мои идеи, к сожалению я не программист.
shllyapnikov 16 Aug, 2022 @ 1:43am 
@Skleroz Главное то, что маяк, ЛА и Антенна могут транслировать свое местоположение ну или на худой конец наверное можно переделать родной скрипт пиратов (Был случай когда все блоки я передал на себя, а скрипт остался работать. Так этот дрон следовал за моим кораблем по всей карте даже прыжковый двигатель не спасал и немного стрелял когда догонял а потом переставал и висел рядом).
shllyapnikov 16 Aug, 2022 @ 1:41am 
@Skleroz Т.е на мой взгляд дрон должен по сути должен следовать за одним блоком на расстоянии (Например: дальность 1 км и высота 600 м от маяка или антенны) и если улучшенный сенсор фиксирует врага команда следовать за блоком сменяется командой лететь к врагу и обратно. Вместо сенсора можно использовать турель у нее дальность до 800м.
shllyapnikov 16 Aug, 2022 @ 1:40am 
@Skleroz (Т.к ЛА способна устанавливать линию связи между двумя блоками и передавать свои координаты и наверное можно привязать дрона как на веревочке до 200км),(А антенна как и маяк, способна транслировать свое местоположение до 50км).а улучшенный сенсор использовать только для обнаружения врагов.
shllyapnikov 16 Aug, 2022 @ 1:40am 
@Skleroz По поводу проблемы следования за гридом: А что если использовать кроме сенсора использовать маяк, (По сути маяк это путевая точка или навигационный маркер, дальность вещания до 200км, прыжковые двигатели могут использовать маяки в качестве цели для прыжка, наверное можно аналогичным образом использовать маяк как цель за которым следует дрон) лазерную антенну или антенну.
shllyapnikov 16 Aug, 2022 @ 12:36am 
@Skleroz Ну я бы так не сказал. Мод только добавляет блок сенсора с увеличенным радиусом чувствительности. А так это самый обычный сенсор и без скрипта который управляет блоками (Даже если они модифицированные) никуда. Скрипт принял этот мод как свой родной (И не только этот мод) и дрон смог просто обнаружить меня на большем расстоянии, чем при использовании ванильного сенсора.
Skleroz  [author] 15 Aug, 2022 @ 1:31pm 
Если с модами, то и скрипт не нужен, вся задача тогда решается намного проще =)
shllyapnikov 15 Aug, 2022 @ 7:56am 
Ну, что касается сенсора решение есть: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2311663286&searchtext=10+Sensor . Проверял на на дроне, работает.
Skleroz  [author] 15 Aug, 2022 @ 6:04am 
@shllyapnikov Со следованием за гридом владельца есть две проблемы - в отличе от персонажа, таких гридов в радиусе сенсора может быть несколько, и у грида могут быть больше габариты. Я пробовал изначально делать проверку и по персонажам, и по гридам, но как-то криво работало. Еще есть проблема с маленьким радиусом сенсора - реакция на изменения после обнаружения объекта следования. 50 метров часто не хватает, чтобы затормозить.
shllyapnikov 15 Aug, 2022 @ 5:24am 
Are there any plans to add a follow ship function? So that the drone could follow and guard the ship? (You can write in Russian).
Skleroz  [author] 15 Aug, 2022 @ 3:38am 
@shllyapnikov Hi! Unfortunately, it follows only character due to limitation within code.
shllyapnikov 14 Aug, 2022 @ 10:56pm 
Hello, please tell me how to make the drone follow you when you are in the cockpit of the ship?
Skleroz  [author] 10 Aug, 2022 @ 10:52am 
Super! Thank you!
Ejcreeper 9 Aug, 2022 @ 2:32pm 
Sure just make sure it has requirements LOL
Skleroz  [author] 9 Aug, 2022 @ 1:24am 
@Ejcreeper Nice drone, good acceleration! Glad to see this script still working in space XD
Can I add your drone to example list?
Ejcreeper 8 Aug, 2022 @ 11:25am 
Oh yeah it's meant for space LOL
Ejcreeper 8 Aug, 2022 @ 11:24am 
Hi, gravel uhhhh lol I just made a perfect drone for a swarmer but mostly its for following player and defending (buttons on back) thank u Skleroz though https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2846486943
Skleroz  [author] 9 Jun, 2022 @ 12:05pm 
@GravelGavel Hi. It is possible, but not practical due to short detection range of the sensor. For the big distances and big speed whole detection part should be done via raycast.
GravelGavel 8 Jun, 2022 @ 11:17pm 
Would it be possible to modify the script to have it follow a ship instead of a player? For something like a drone swarm. Ex: You have the lead ship remote piloted by a person then a bunch of these drones carrying turrets following the lead ship, lead the drones into range of an enemy and all the turrets open fire.
Skleroz  [author] 27 Apr, 2022 @ 11:00pm 
@Renegade Thanks! Try to do my best =)
Ren 27 Apr, 2022 @ 6:01pm 
So happy to see this is still being updated. Coming back after about a year and I always loved this script, I was never able to get something like this working on my on
Skleroz  [author] 19 Apr, 2022 @ 8:29am 
@Lord Death Pyro Looks like I didn't think too hard about clear command naming =) "stop" literally stops script execution (I forgot to add any king of clear_antenna_text task, sorry), to restart it will need "start" command. You can use "follow" to switch follow mode on and off, it was made to utilize only one button for simplified control
Пиро 19 Apr, 2022 @ 8:23am 
solved it adding iS = 0; at line 103 and replacing Upd_Me(0) to Upd_Me(2) to not pause the updatefrequency. Now it stops.
Пиро 19 Apr, 2022 @ 7:57am 
Yep, it solved the problem when remove the tag from the connector, but, now I found something strange, when I hit "stop" when in follow mode, it stops, but the antenna keeps displaying Follow Player and the follow command bugs out, is something wrong with how I'm triggering the commands?
Skleroz  [author] 19 Apr, 2022 @ 12:31am 
About "follow" from connector - it should fly directly up from connector face, if waypoints weren't set.
Skleroz  [author] 19 Apr, 2022 @ 12:29am 
@Lord Death Pyro Connector will not be used, if it hasn't name appendix. Without connector whole connection class should be skipped in the script. I'a afraid there are 20-30 instances in the script, where connector is used.
Пиро 18 Apr, 2022 @ 5:26pm 
Had to comment from line 221 to 259 to solve this issue, this happens when I use command "follow" while connected to a connector, it behaves so strange that resulted on many drones destroyed, put a condition where if arg is follow doesn't trigger that "case -1" scenario.
Пиро 18 Apr, 2022 @ 2:51pm 
Works really well but it conflicts with other scripts, is there a way to disable auto dock and flight/ascent after disconnecting?
Skleroz  [author] 15 Apr, 2022 @ 2:08am 
Well, yes =) I switched off forced range increase, it worked quite bad in some scenarios.
Пиро 14 Apr, 2022 @ 8:13pm 
I think I know why, you have to increase the detection values for the sensor.