Jump to content
hdparm

[Lua] [Script] Basic space-only autopilot

Recommended Posts

Dual_2020_09_16_19_57_03_204_-_Lua_basic_space_autopilot_to_Alioth.png

 

About

This is a basic autopilot script that can accelerate your construct towards a planet and later apply brakes to stop. Vertical space engines are used to control drift.

 

Requirements

  • Space brakes, 1.5+ g.
  • Vertical space engines (pointing down), 0.3+ g.
  • A remote controller or a separate hovercraft seat.

Limitations

  • No manual piloting. Use another script to get to space and to land.
  • No collision avoidance. Make sure there are no planets, moons, asteroids, space stations or pirates between you and the destination.
  • Planet positions are stored in the script. If NQ moves the planets, the script will have to be updated.

Set-up

With an auto-configuration schema (recommended)

  1. Download this file to Game\data\lua\autoconf\custom in your Dual Universe installation directory. By default it's C:\ProgramData\Dual Universe\Game\data\lua\autoconf\custom
  2. Right-click the control unit (a remote controller or a hovercraft seat) and select "Update custom autoconf list". This needs to be done only once.
  3. Right-click the control unit and select "Actions for this element", "Run custom autoconfigure", "Basic Space Autopilot".

With a pasteable script configuration

  1. Open this link and copy everything to clipboard.
  2. Right-click the control unit (a remote control or a hover seat) and select "Actions for this element", "Paste Lua configuration from clipboard".
  3. The game should display a "Lua script loaded" message. If it did not, restart the game and copy the script configuration again.
  4. Link the core (required) and fuel tanks (optional) to the control unit.

Credits

Many planet positions were provided by @meigrafd from Hyperion.

The script was bundled (amalgamated from multiple .lua files) using amalg.

 

Change log

2020-09-23. Fixed heavy constructs not accelerating past 29997 km/h. A radar widget will be displayed if a PVP radar is linked (not available on remote controllers). Tested in r0.22.2.

2020-09-16. Posted the first version outside the NDA forums section. Tested in r0.21.6.

Share this post


Link to post
Share on other sites

Hi, sounds great. Is there also another LUA script available for on planet autopilot, i.e. atmospheric flight?

 

I want to automate the transport from home base to a market and back.

 

Cheers

 

realMoD

Share this post


Link to post
Share on other sites
26 minutes ago, realMod said:

Hi, sounds great. Is there also another LUA script available for on planet autopilot, i.e. atmospheric flight?

Many autopilot scripts exist, but most are not shared publicly. You may have to script it yourself :)

Share this post


Link to post
Share on other sites

@hdparm -- Love it.  

 

On a return flight to Sanctuary Moon, I noticed it still showed 100km to Sanctuary, however I was 30km from the surface.  The difference caused me to be a bit high on speed as it didn't slow early enough. Is this user error, or is it possible the coordinates for Sanctuary Moon are off slightly? 

 

Thanks.

Share this post


Link to post
Share on other sites

It's possible. What planet were you flying from? Could you record a video next time it happens? Also check the Lua chat tab for errors.
EDIT: adding more vertical space engines apparently fixed this for Sunfyre.

Share this post


Link to post
Share on other sites
8 hours ago, Keimond said:

do you think it's possible to make this work with a gravity engine ?

This script stops your construct 80 km above a planet and holds it there with brakes. You lose less than 0.3 km of altitude per hour, so you can AFK for a day or two :) The script could be modified to use an AGG, but would it be useful?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...