Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Autopilot crashing ship on planets

Discussion in 'Gameplay Help' started by SilentShadow, Mar 5, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. SilentShadow Apprentice Engineer

    Messages:
    286
    While in space i used to setup a timer block on small ships that would start a one way Autopilot back to base. This way if i died or got separated from my ship it would return home.

    I tried this on the alien planet a few times from about 40km away, but my ship never makes it. First time i had just one waypoint, and it eventually crashed into a cliff. 2nd time i set an intermediate point, it still crashed. 3rd i had a string of waypoints. I basically went looking for it before issuing Space Master to find it falling into the planet.

    Can someone tell me what I'm doing wrong with autopilot on planets?
     
  2. Ronin1973 Master Engineer

    Messages:
    4,955
    Autopilot can reasonably avoid obstacles... but not an entire planet. If the planet lies between you and your base... chances are the ship will crash into the planet.

    In order to get back home, your ship will have to be able to circumnavigate the planet. You'll have to use an advanced script. There's a way to get the planet's center from the remote block @Whiplash141 told me the magic once in a thread, but I've lost track of it.

    Once you have the planet's center, you have to create what I call a "fan-tail" script, that makes the ship fly up to a ceiling altitude away from the planet and then make its way around the planet.

    Step one is to locate the ship's remote in the world and the planet's center, then draw a line between the two and find a point that's X meters away. Then draw a line between a point near your base and the planets center. Find a point on that line that's X meters away from the planet's center on that line as well. Now draw a line between those two points you just found. Divide the distance into something like 10,000 meters and find the POINTS that are on that line at every 10,000 meters. Now draw a line between the planet center that goes through those points that is also X meters long and note that point.

    Now feed all of those points that are X meters away from the planet's center and the final destination into the remote blocks waypoints.

    Sounds like a pain in the ass? It is.

    But I made a script just like that for long range pirate drone attacks while on a planet.

    It's a good way to learn some vector math. :)
     
    • Informative Informative x 1
  3. SilentShadow Apprentice Engineer

    Messages:
    286
    Wow. All i was trying to do is travel 40km from one spot on the planet to another without hitting the ground. So far the results are not good.

    Thanks
     
  4. Ronin1973 Master Engineer

    Messages:
    4,955

    Well the cheap and dirty* be to use @MMasterSK 's breadcrumb system and then have your ship set to download the breadcrumb trail in reverse order to the waypoint system and set itself to autopilot. I think MMaster's script takes care of 90% of the work. You just need to integrate the part of your solution that triggers the autopilot to engage.

    Oh, breadcrumbing is following the basic path that you traveled in reverse order.

    *By no means is ANY of MMaster's code cheap and dirty, just using it would be easier than what I previously suggested.

    http://steamcommunity.com/sharedfiles/filedetails/?id=447360835
     
Thread Status:
This last post in this thread was made more than 31 days old.