1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Follow ship or escort script?

Discussion in 'Programming (In-game)' started by Spets, Apr 19, 2015.

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

    Spets Master Engineer

    Messages:
    3,214
    Is it possible to make a program using the laser antenna maybe, to keep a drone ship following your ship everywhere keeping a distance and position you want? I don't know... like keep a flying formation or maintaining a relative position from your ship, like a satellite or escort ship
     
  2. Gloin the Dark

    Gloin the Dark Apprentice Engineer

    Messages:
    129
    Currently the only way to communicate between ships is via the laser antenna hack.
    https://forum.keenswh.com/threads/data-transfer-using-laser-antennas.7329187/
    While that method is very cool, it has some drawbacks.
    1. Laser antennas can lose contact with the connected antenna if the ships turn so that the laser antenna cannot face towards the other ship.
    2. The data connection seems to be a bit laggy. From the description it takes at least 700 game ticks to send a message one way. If you add another 700 ticks for a return acknowledgement message, that adds up to 1400 ticks (over 23 seconds) round trip.
    If you were to turn your ship it may take quite a while for the drone ship to respond.

    The the lead ship could simply send a LA message to the follower indicating a location a safe distance behind the lead ship. The follower ship could auto-pilot to that location. The problem here is that given the message lag, if the lead ship were to turn around 180 degrees, the follower ship could plot a course directly through the lead ship.

    On the other hand....
    If your lead ship had a pre-planed course that it was going to take then the follower ship would only have to follow the same course but start at a delayed time. But I don't think that was what you were intending by your original post.

    I think the answer is, until we get reliable low-latency ship-to-ship data communication, quick response formation flying is highly impracticable.
     
  3. Gloin the Dark

    Gloin the Dark Apprentice Engineer

    Messages:
    129
  4. Gloin the Dark

    Gloin the Dark Apprentice Engineer

    Messages:
    129
    OK, I have now used the AutoPilot mod (a little bit). It is very cool. I haven't tested the ship to ship communication part yet though. I will do that tomorrow.
     
  5. Spets

    Spets Master Engineer

    Messages:
    3,214
    oh tanks, I will take a look too
     
  6. Spets

    Spets Master Engineer

    Messages:
    3,214
    wow, that Autopilot program is just what I needed. I saw it a while ago but didn't tried because it seemed to be too complicated, turns out it wasn't that complicated. Very well done and noob friendly. So awesome! Thanks!
     
  7. billyd

    billyd Trainee Engineer

    Messages:
    36
    So is there no way to do this in Vanilla? Want something I can use on any server. Keep searching forum but can't find anything :(
     
  8. Sinbad

    Sinbad Senior Engineer

    Messages:
    2,788
    I had an idea to have the mother ship write its position (with an added offset to help avoid collisions) into the LA hack method, then have the drone recieve them and use them as waypoints for the autopilot (scripted one as I don't know if you can programmatically control vanilla one). bread crumbs...
     
  9. soknorb

    soknorb Trainee Engineer

    Messages:
    65
    Look up WIP Drone Conquest, Once im done you have a lot of commands to choose from
     
  10. paradineai

    paradineai Apprentice Engineer

    Messages:
    247
    I use the autopilot script a lot and have it set up to keep a group of fighters in a formation around my larger ships. I have it set up there is 1 text panel on the ship and the autopilot looks for it and gets the orders from that. It allows me to not only have the fighters escort my larger ship but when I stop moving or dock to a station they can land and resupply as well. I don't move my larger ships very much though so it works for me. Although the few cargo ships I have setup on the AP system that go from station to station moving stuff for me do have an escort that is setup to follow them and their escorts are setup with 1 solar panel, 1-2 battery (controlled by a script), and 1 text panel. This allows them to get the commands from the text panel so they can follow the cargo ship and when the cargo ship is docked they are sitting nearby waiting. While they are waiting the script is making the battery recharge for the next trip (though most of the time it won't need it). This way if it gets into combat and loses the solar panel it will still have power from the battery. The only time they ever dock is when they run out of ammo (another script that changes the name of the remote/autopilot block). This allows it to keep track of its ammo supply and when depleted it will dock to the cargo ship it is escorting (if these got into combat then they would really just be distracting the enemy long enough for my cargo ship to get away).
     
    • Like Like x 1
  11. ghofmann

    ghofmann Trainee Engineer

    Messages:
    19
    Hey there, sounds like you're solved this problem. Would you be willing to help me set this up or give a detailed description of how to program a ship to follow another ship?
     
  12. Klaern

    Klaern Apprentice Engineer

    Messages:
    296
    This is doable now with IMyRemoteControl::GetFreeDestination() where the Drone would be autonomous and not need coordinates passed by a control ship.

    Check out this thread by Pennywise, his script is slick and the technique could be used for formations, follow, etc: https://forums.keenswh.com/threads/long-range-lock-on-concept-no-turrets.7370088/

    It's also currently legit as the API allows for it without this being a bug, but it does bypass some game mechanics (sensor range, LOS).
     
  13. soknorb

    soknorb Trainee Engineer

    Messages:
    65
    ghofmann, just take apart other mods and work something out.
    my mod droneconquest has code like what you want. class file drone, and dronenavigation
    just find it in the workshop
     
  14. GeneralApathy

    GeneralApathy Apprentice Engineer

    Messages:
    273
    There are other ways of doing this; I'm working on one myself. A lot of them are based off of the Remote.GetFreeDestination(), but there are definitely other methods to do so.
     
  15. Sero93

    Sero93 Trainee Engineer

    Messages:
    47
    I had this idea too, extended by the ability to get always up to date GPS locations for your capital ship connectors.. i copy paste here the request form other forum:

    A Script to:
    -Get current GPS Coordinates, and a way to offset these by a fixed Value ( best would be multiple gps coordinates with diffrent offsets)
    -writing these to individual LCD's for each coordinate. old coordinates get deleted on those LCD's ( as bonus maybe you can store several gps in one LCD to generate a flying path )
    -transferring coordinates from Specified LCD panel into Keen's autopilot... (and manipulation the autopilot with clearWaypoints/enable/disable autopilot or as Bonus giving a approach path at given gps points)

    (using every function as option and not as mandatory would be even better)

    as help i have 2 links here:
    https://steamcommunity.com/sharedfiles/filedetails/?id=450483680 ( a coordinate manipulation script... but quiet stupid to set up and only one offset value)
    https://steamcommunity.com/sharedfiles/filedetails/?id=447360835 ( BROKEN GPS recorder)

    My idea is the following:
    Together with the script to copy LCD Content via laser antennas, i want to transfer my coordinates of my mothership to other ships.
    for a miner for example, i will offset the generated GPS coordinate to always fit a connector on the outside of the ship. The other ship gets via laser antenna (on button press) the updated LCD content and puts this (via the same script) into it's autopilot. all other way points are optionale deleted so the ship comes automatically home to up to date GPS coordinates.
    A fleet following a few hundret meters around the capital ship would be possible...
    or if you can store the GPS in a certain order to your autopilot, you could generate a uptodate landing passage, for your more complex hangars. ( ofcourse during movement of big ship the gps up to date is probably too slow, but at least you dont have to set them when you change your current pos to another pos)
     
Thread Status:
This last post in this thread was made more than 31 days old.