Space Engineers

Space Engineers

SAMv2 - Sam's Autopilot Manager version 2
857 Comments
TechCoder May 10 @ 4:30am 
the version you download here is non-maintained and is VERY old.

Use https://steamcommunity.com/sharedfiles/filedetails/?id=2892105352 instead
lolodu38 May 9 @ 2:01pm 
lot of issue, cannot let it run alone
TechCoder Feb 8 @ 2:25pm 
you mean "when I asked an automated pilot to fly my ship and it uses thrusters in all directions to keep it in line during flight?" - nope..... This script (and I presume you mean vs. the very old original SAM script - well, really any autopilot is likely true...) will fly the ship and use thrust to keep it as steady as possible... (i.e., I don't see any "problem" to "fix" here!)
SirFlutternutz Feb 8 @ 11:49am 
Does this script fix the problem with autopilot rapidly flickering thrusters in all directions even when at max speed?
jarhead Jan 22 @ 5:53pm 
Patrol mode will use either gravity or "dock" direction to "orbit" at a set distance from the "dock". If in gravity then it goes to set altitude then flies at set horizontal distance from "dock". If in space the "patrol drone" "dock" -> station/ship "dock" will be how it decides what is "down" for orbit. This makes the ability to have a connector on back, top, side, bottom, and even front of drone available. The altitude is "above" "dock" instead of ground.
jarhead Jan 22 @ 5:53pm 
What about a patrol mode or a shuttle mode?
Shuttle mode will be this but have several stations or ships that will have a PB, antenna/beacon, and a "call" button. If your at a station/ship and hit the "call" button then it sends a command in the script that then goes to the "shuttle" and the shuttle then adds your "dock" (connector) to its list and starts navigation. If other connectors are already on the list then it goes to them first and as it leaves each dock it will remove it from the list. It will only leave after set time (adjustable). Inside the shuttle you would be able to "scroll" to select your destination and it will be added to the end of the list.
TechCoder Nov 24, 2024 @ 12:40pm 
Not sure what/how that is, but the URL is really screwed up on that link!

It has TWO "http" parts - which is not right....

copy/paste JUST the https://steamcommunity.com/sharedfiles/filedetails/?id=2892105352 part into a browser - it will work fine.
Frogmaster Nov 24, 2024 @ 10:12am 
@TechCoder, when I hit your link steam says:

Link Blocked!
This link has been flagged as potentially malicious.
http://(https://steamcommunity.com/sharedfiles/filedetails/?id=2892105352) has been flagged as being potentially malicious. For your safety, Steam will not open this URL in your web browser. The site could contain malicious content or be known for stealing user credentials.
TechCoder Aug 21, 2024 @ 6:45am 
No problem - it happens to us all (and not just because we're old - but I've got plenty of that to go around...! :P - quite often you rebuild after a slight 'ding' and forget to tag the stuff for SAM again - got lots of those T-shirts myself.

Glad you found it so quick.
PvtClip Aug 21, 2024 @ 6:33am 
I cant believe it I didnt tag the front camera, tagged everything else. I also cant believe I didnt see that. Sucks to get old....lol. Thanks so much. I will get a link to your discord soon, got to run at the moment. Again Thanks.
TechCoder Aug 21, 2024 @ 5:47am 
Sounds like a camera issue - either missing a camera, not tagged properly or view is blocked....
If SAM can't "see", it can't do the collision avoidance 'magic'.

If you continue to have issues:
1. Upgrade to my version of SAM (https://steamcommunity.com/sharedfiles/filedetails/?id=2892105352) - this won't likely change anything but you will have more features and I can support that version better.
2. Get on my Discord (link in my Workshop page) and we can discuss at length.
PvtClip Aug 21, 2024 @ 5:40am 
I have this issue I cant seem to resolve. Im flying the ISL-1280-IQ Mining barge. I have 2 ISL Callisto cargo drones 548b I think. 2 miners and a shuttle. Everything is working just fine with 1 exception. The 2nd cargo drone does fine until it gets back to the barge. It docks and loads up but when it takes off, it just slides off of the connector and bangs into the ship and gets stuck there. Cant figure out why. The other identical drone and all other ships fly exactly as expected. Driving me crazy. Considering destroying that one and making another. If I take over the drone, move him up off the barge, I can send him on his merry way until he returns and it does it again. Got any ideas as to what may be going on?
TechCoder Jul 30, 2024 @ 2:28pm 
If you are having issues with nav points/docks being removed it is LIKELY (as in 98%+ chance...) that it is some MOD you have that was affected by some recent Keen change.

We are using several mods on a server and S.A.M. works just fine. Of course, I use my updated version (https://steamcommunity.com/sharedfiles/filedetails/?id=2892105352) , though nothing is that drastically different about waypoints.

As for "dropping to manual", etc. SAM will START, twisting toward the direction and such, but if it decides the ship is not balanced enough to finish, it will just STOP. See https://youtu.be/6o-AR44UEI8
Null Jul 30, 2024 @ 12:27pm 
I assume this would not work well with very little reverse thrust but a large amount of forward thrust? As in it won’t flip the ship around the use the main drive to slow down?
Zerg Jul 25, 2024 @ 7:14pm 
I'm unsure if its just me on my server as I'm the only person using this script but my docks also all vanish each server restart among a few other strange bugs I've never had before such as I'm able to descend from a space station but once I load with ore it only aligns with gyro and doesn't ascend infact I'm able to manually thrust which sam never let me do before
Dubi23 Mar 29, 2024 @ 2:56pm 
Has anyone had issues with their navigation points unloading from the program? I have had to reset my Nav points several times after my ship sits at base for a day or two all of my points will unload and the NAV & CONF screens will be empty. Is there a way to fix this or at least save the points/stance to quickly re-add them ?
TechCoder Mar 28, 2024 @ 11:46am 
If you want a ship to 'hover' at an altitude, I would suggest you look for that keyword on the workshop. I have used a few and none are 'standout' though I would say one to try is from jTurp - if nothing else, it gives one heck of an 'amusement park' ride!
Saa044 Mar 26, 2024 @ 12:01am 
Hi there. Is there a way to add a minimum altitude from ground line to the script?
TechCoder Feb 23, 2024 @ 12:37pm 
Also, you need to define "something in the way" better - if it is just a post or something, the camera likely won't see it - but mountains..... Get on Discord and we can discuss this better.
TechCoder Feb 23, 2024 @ 12:35pm 
Other than that (sorry, you did say you tagged them...), then it is likely a weight/power problem. Gotta have enough lift (in all directions) to get it flying. Maybe you have atmos and think you don't need a 'down' one - that would be common, and wrong.... - thrust in all 6 directions, and enough that the autopilot has time and power to compensate.
TechCoder Feb 23, 2024 @ 12:33pm 
SAM tag in the CD of the Camera. If SAM can't know where it's 'eyes' are, it can't see where it is going!
Bobbers Feb 21, 2024 @ 4:54pm 
I've got SAM working great for nav I think. However, I wanted to test the collision avoidance. I've added the SAM tag to the cameras in the forward, down, and up directions and the SAM.LOG shows it finds 3 cameras. However, if I try to nav where there is something in the way it flies straight into it pretty every time from what I can tell. Is there a test someone can suggest to show if it's working correctly or not (that it should be fine with if it's working)?
TechCoder Feb 12, 2024 @ 4:45am 
Did you note that (GPS Coordinate) is much like <GPS> in that the data is surrounded by 'punctuation' (of a sort...) - like this sentence, you don't really read nor say them, but they point out important bits.

Try the command (in your example)
START GPS:Jump point 4:-46543.66:91438.58:25245.93:#FFF175CE:
The Funk Feb 10, 2024 @ 6:53pm 
so i followed the steps exactly as Airomis stated in his post about going to GPS coords, it just tell sme invalid gps format. clairifacation would be great!

start (GPS:Jump point 4:-46543.66:91438.58:25245.93:#FFF175CE:)
start (-46543.66:91438.58:25245.93)
neither worked, honestly ive done about ever combo i could try and i gace up after 45 minutes.
KnightReaver Jan 10, 2024 @ 12:59pm 
Here is a script to limit cargo weight so SAMv2 ships don't get too Heavy.
https://steamcommunity.com/sharedfiles/filedetails/?id=3136445571
Airomis Oct 1, 2023 @ 1:25pm 
The steps are the same but I'd also look into the tec coder version as he is maintaining the script
Airomis Oct 1, 2023 @ 1:24pm 
Go to the GPS menu,
Copy to clipboard
Go to the sam PB

#1 Type start (paste GPS) dose not save one time use only

#2 type add ( paste GPS) then add to navigation menu like normal
juk-bug Oct 1, 2023 @ 1:10pm 
I have the coordinates of the point where the ship should get to! There is nothing there but coordinates))) How to use this script in such a case?
Mechanical Sep 9, 2023 @ 5:24am 
@TechCoder I did the needful, and the cargo drone is zipping in an out with deliveries due to the huge backlog.
TechCoder Sep 4, 2023 @ 4:36am 
@Mechanical - see the docs - SAM does not do inventory management, yet has some features to assist you in moving cargo. Many people use Isy's Inventory Manager, some others - lots of ways to move inventory (even without scripts, but it is more difficult).
I recommend you 1. read the docs about cargo 2. Consider IIM or other inventory manager. 3. Get on my Discord to read how others do it. 4. if you still need help, ask on Discord - lots of 'assistance' help there.
Mechanical Sep 4, 2023 @ 3:28am 
I was trying to use this to automate moving cargo, but the script seems to only pull 100? or so items at a time, and could spend a half hour picking up 20k items.
TechCoder Jun 14, 2023 @ 6:39pm 
rGlory - see my latest version, it has this issue fixed.
coolfarmer - to just what functions/features are you referring? what does the current script not do that you think the AI block(s) would enhance?
lkcarfrey - no - you might want to visit my discord to see quite a bit of discussion on that topic.
lkcarfrey Jun 13, 2023 @ 7:08pm 
is there a way to adjust the orientation the ship connects
coolfarmer Apr 20, 2023 @ 12:24pm 
Imagine having this script updated to add functions/features to the current AI Block, would be very nice! :O
rGlory Mar 27, 2023 @ 11:02pm 
Thanks for the great script! Can that annoying error message in log of other SAM be fixed, that is produced when a connector is marked as main?
TechCoder Mar 22, 2023 @ 4:21pm 
@Rambo - check your cameras (I know, you said 'all is fine', but it obviously isn't...) - likely you don't have a camera with a clear view, or {more often} you replaced a camera and forgot to put SAM. back in the Custom Data, etc... - I often crash-land on manual flying, put a new one on and forget it - pretty common issue....).

There is also an 'edge case' where the mountain is 'straight up' (I mean really steep...) and SAM does have some troubles. Best thing there is to slow the speed and start as far away as possible.

if you need other help, get on my discord - can't really walk through stuff here.
Rambo Mar 22, 2023 @ 12:30pm 
So my configuration seems to be fine, but SAM is unable to see a montain and hit it all the time. In 6 attempts it just dodge it once
TechCoder Feb 13, 2023 @ 8:07am 
@kinngrimm - IF your 'carrier' is STOPPED, SAM works great. If it is 'in motion', SAM can't find it (i.e., it doesn't work for moving targets, but if they stop......) The reason for this is the intense 'loop' to look at and find the moving Connector. It _could_ be done, but the amount of code 'tics' is limited in SE (ok, too much techie info, so let's just say it doesn't work that way right now)
kinngrimm Feb 13, 2023 @ 5:24am 
How about none-stationary locations or a fixed location and a carrier, could transports automaticly redirect themselves with new coordinates should a carrier or a refinery ship change its location? Is a transport ship between a carrier and a refinery ship doable?
skiittz Jan 21, 2023 @ 1:24pm 
Hope you dont mind - I linked your script on my defense drone script as I added the ability to override the keen navigation model with yours (i did not take your code, I created an interface that sends commands from my script to yours). Awesome work, 100 times better than keen's remote controls!
TechCoder Nov 19, 2022 @ 7:23pm 
Depending on the mod you use for PBs, there is at least one 'micro' that has a keyboard (I made SAM work with it for another guy) - but, again, you have to get my patch - and, yes, it is only on Discord (which is 'the' place that gamers go to chat - Steam is ok for short stuff, but can't do antyhing but text here - Discord allows you to share files and such (basically it is a chat room like this is, but with a lot more features). Try it, you just might like it! https://discord.gg/f2FmxjyPNu

SAM is not hard to get going, but it does take some attention to detail in all the parts, making sure you have cameras, etc.... (that's why I did the videos..) but it can be frustrating at first, that is for sure!
liquid_confidence Nov 19, 2022 @ 6:39pm 
I use micro program blocks mod not regular ones so maybe that's my issue, they have no keyboard. I put SAM. in the custom data of every item on my base as to avoid any missing blocks for the script. I don't know what Discord is but I think if I had been mining for a week instead of working on a script I probably would have had tons of resources by now.

Thanks for the help though.
TechCoder Nov 19, 2022 @ 6:23am 
@liquid_confidence - you have WAY too many different settings. Stick with either doing it in the Name of the things (with []) or (my preferred way - simple to see and config and not so much 'clutter' on naming) in the Custom Data where you MUST start each command with SAM. (see the video...)

The Remote Commands go in the LCD (again, easier IMHO, but you have to have my version of SAM from my Discord channel...) or in the Keyboard of the PB (NOT the screen - see the instructions on the keyboard.......)

It looks like you also have an issue with the base name info tab - all you need is the name of the base.....

Follow the instructions, but be careful to only set either [] or CD stuff.

Get on Discord for more help - it is much simpler to help there.
Raxus 88 Nov 18, 2022 @ 10:05pm 
@TechCoder - Yes! Thank you, I was using the version from this page, applied your patch and now have a functioning CAP patrol of Viper Mk IIs around my station, thanks again
liquid_confidence Nov 18, 2022 @ 9:27pm 
I've watched the video a number of times but I am not understanding how a drone can be controlled from a base, versus in a cockpit on a drone as the video shows. I put this in my Base Program Block:

SAM.ADVERTISE
[SAM ADVERTISE Name=Orbiter00]
SAMv2 cmd# start
DRONE

I used info tab and renamed Base grid: [SAM ADVERTISE Name=Orbiter00]

I renamed my drone in the program block on the drone : [SAM Name=DRONE]

I renamed my connector in the connector name, and the custom data: [SAM Name=Conn 01]

Base antenna has SAM. as a name and custom data.

DRONE antenna has SAM. as a name and custom data.
TechCoder Nov 17, 2022 @ 5:12pm 
@Raxus 88 - when you say "Latest version" do you mean the one from this page or my patch that fixes bugs about ships getting 'stuck'?

@liquid_confidence - https://youtu.be/6o-AR44UEI8
liquid_confidence Nov 17, 2022 @ 4:56pm 
How are you naming your ship? I read through the guide but must be missing it. SAMv2 cmd# start
ShipName

Where do i put "ShipName" ?
Raxus 88 Nov 17, 2022 @ 3:11pm 
I'm having an issue with some drones i'm using for a patrol route.They're getting stuck "waiting" forever. Prog. block s tagged {SAM LOOP} What am I doing wrong?
Latest version installed
liquid_confidence Nov 16, 2022 @ 7:12pm 
I am playing single player. I will read through the guide again and try to figure out where those commands go. Thanks.
TechCoder Nov 16, 2022 @ 3:33am 
@liquid_confidence - see 'Remote commands' in the guide https://steamcommunity.com/sharedfiles/filedetails/?id=1947156145
If you are running on a server, you will need my patch (see link in various comments below) as the file here does not work.