Space Engineers

Space Engineers

27 vurderinger
NavOS 2
2
   
Utmerkelse
Favoritt
Favoritter
Fjern som favoritt
Merkelapper: autopilot
Filstørrelse
Lagt ut
Oppdatert
471.895 KB
5. sep. 2023 kl. 23.12
1. juli 2024 kl. 20.59
18 endringslogger ( vis )

Abonner for å laste ned
NavOS 2

Beskrivelse
A script I made for automating some long distance travel, matching speed to a locked weaponcore target, and some other things. The main feature is that most operations (except target speed lock) uses the primary (forward) thrust most of the time. Oh, and it's super accurate. Usually with <1 meter error

I use this script on the draconis expanse server but it should work anywhere pbs are allowed.

Source Code: https://github.com/StarCpt/SE-NavOS-2

v2.14.7:
Fixed journey failing to restore properly on recompile
Set default offset to 500 meters when installed without an existing config

v2.14.6:
Fixed slow reaction times for Retroburn and Speedmatch
Fixed script going into sleep unintentionally

v2.14.5:
Added sleep mode, entered if idle for 10 seconds
Added proper units for distance and speeds
Fixed directional dampening bug
Fixed crash on startup when an older config is present

v2.14.4:
Fixed a bug causing side thrusters to rapid fire
Fixed MaintainDesiredSpeed always turning on regardless of the config
Significantly improved cruise accuracy
Decreased average script runtime

v2.14.1, 2.14.2, 2.14.3:
Fix insufficient sideways dampening in Cruise

v2.14:
Add Journey mode
Added config option to maintain desired speed on servers with RTS
Fixed a bug that would make cruise mode enter OrientAndDecelerate mode on nexus seamless transfers and game reloads
Made cruise offset require side offset to also be nonzero to prevent crashes on overshoot situations
Minified script due to character count - source is available on github

Config (In the customdata of the pb):
You must recompile when the config is changed.
  • PersistStateData: DO NOT TOUCH

  • ShipControllerTag: Put this tag in the name of the controller you want to use for orientation

  • ThrustGroupName: Only use thrusters in this group for navigation. Uses all thrusters on the ship if the group doesn't exist

  • GyroGroupName: Same as above but for gyros. Uses the first gyro in the group.

  • ConsoleLcdName: Name of the LCD you want some navigation information to be written to

  • CruiseOffsetDist: For GPS and X:Y:Z cruise commands, come to a stop this many meters earlier than the target
  • CruiseOffsetSideDist: For GPS and X:Y:Z cruise commands, offset the target by this many meters to the side (side = a random perpendicular direction to the target from your current position)

  • Ship180TurnTimeSeconds: How long it takes the ship to do a 180 degree turn in seconds.
    You need to set this to equal to or more than the actual 180 turn time. It determines when to turn for deceleration in case it can't get up to full cruise speed. This field is not calculated automatically, run CalibrateTurn to calculate this field. Recalibration is required whenever the mass of the ship changes significantly.

  • MaintainDesiredSpeed: Keeps the ship oriented to the target during cruise and maintains the desired speed if possible (resists RTS friction) until deceleration time.

  • [Journey Start] and [Journey End] (Experimental!)
    This is where journey data is input. Waypoint Format: <DesiredSpeed> <StopAtWaypoint> <GPS>
    StopAtWaypoint: Whether to stop at the destination or pass thru the point at speed
    Example:

    [Journey Start]
    200 true GPS:StarCpt #2:-17787:48220:-29137:
    550 false GPS:StarCpt #3:-17933:48686:-29105:#FF75C9F1:
    150 true GPS:StarCpt #4:-17995:48270:-29421:#FF75C9F1:
    [Journey End]

    Note: The ship will be brought to a stop at the last waypoint regardless of the StopAtWaypoint flag

Commands:
  • Cruise <DesiredSpeed> <ForwardDistanceMeters>
    Automatically travels the set distance in the forward direction of the ship controller (cockpit) at the desired speed.
    Example: Cruise 500 20000

  • Cruise <DesiredSpeed> <X:Y:Z>
    Automatically travels to the set coordinates (plus the offset in config) at the desired speed.
    Example: Cruise 500 15000:70000:17000

  • Cruise <DesiredSpeed> <GPS>
    Same as above for GPSes
    Example: Cruise 500 GPS:target:15000:70000:17000:FFFFFF

  • Retro/Retrograde
    Points the ship in the opposite direction of travel

  • Prograde
    Points the ship in the direction of travel

  • Retroburn
    Points the ship to retrograde and stops the ship

  • Match
    Matches speed to CURRENT WeaponCore lock, stays on that target even if locked target changes.
    Rerun the command to change speed match target to current WeaponCore lock.

  • Orient <GPS>
    Orients the ship to point in the direction of the gps with no thruster controls applied.

  • Abort
    Aborts any ongoing navigation routines. Disables all gyro and thrust overrides and reloads the config. Does not enable dampeners

  • Reload
    Reloads the config from PB Custom Data. Must be run whenever the config is edited (recompilation also works)

  • ThrustRatio <ratio>
  • MaxThrustOverrideRatio <ratio>
    Sets the MaxThrustOverrideRatio config value. Input a value between 0 and 1. This is an alternative to editing the config.
    Using either ThrustRatio or MaxthrustOverrideRatio commands will do the same thing.
    Example: ThrustRatio 0.6

  • Thrust Set <ratio>
    Sets thrust override ratio on forward thrusters. Example command will set forward thrusters on 50% override.
    Example: Thrust Set 0.5

  • CalibrateTurn
    Measure and set the Ship180TurnTimeSeconds variable in the config. Make sure the ship is not moving or rotating when this command is used.

  • Journey Load (Experimental!)
    Loads the journey setup from config

  • Journey Start (Experimental!)
    Starts the journey if waypoints are loaded
    18 kommentarer
    Corki99 27. feb. kl. 10.52 
    Is there a command to make my ship go at a consistent acceleration? As in, if I wanted my ship to go at a constant 1G worth of thrust?
    Oz 4. des. 2024 kl. 6.05 
    Some turn commands would be really great which just point your ship left or right and hold it there as your vector changes. Simple ones for perfect right/left turns which hold the vector-result from prograde crossed with shipUp. Also accelerating/decelerating turns in degrees like "right 20" for 90 degrees right plust 20 degrees prograde (effectively 70 degrees away from prograde. Along with the opposite "right -20" for decelerating right turn.
    Kriosiss 18. okt. 2024 kl. 11.05 
    another issue ive been having/seeing is even in a slow zone in the draconis expance server the prograde and retro grade are not accurate and cause a TON of drift if you have your dampeners on because of the angle being wrong
    Kriosiss 14. okt. 2024 kl. 12.40 
    this is a major issue, because most people i know are using it only use it for that purpose of turning around automatically
    Mr.NiceGuy 14. okt. 2024 kl. 9.55 
    Having a similar issue as Kriosiss,

    I can turn 180 in 1-2 seconds manually but if i calibrate turn it takes a litte over 30 seconds.

    I have a NavGyros group setup, Ive tried with and without the group. Ive added only 1 gyro to the group and all gyros to the group.
    It keeps setting override on every single gyro no matter what.

    Ive removed the pB block and put a new one in and recompiled...etc nothing seems to work.
    The closet I can get is starting calibrateTurn and manually turning off all gyro override which it then turns it back on and I spin around quickly.

    Only issue is that I would have to always turn it on and off every single time, and it wont turn my dampeners back on afterwards if I do
    Kriosiss 6. okt. 2024 kl. 13.02 
    for some reason my gyros dont turn me at their full speed, when i manually turn it is 20 times faster then with the program... did something change it or am i bugged?
    Squeech 26. sep. 2024 kl. 11.40 
    Amazing script, thank you!
    SPECTRE 4. aug. 2024 kl. 3.45 
    Can you give an example of CruiseOffsetDist? Cant get it to work
    Cobra Commander 1. aug. 2024 kl. 10.11 
    I echo the sentiment of others; I don't know what we'd do without this fantastic piece of code.

    It's probably out of your control, but I'd love to know how we may set a <max_override> via config as opposed to having to manually set it on the thruster / group basis.

    e.g.
    When retroburn only use max 20% <some_thruster_group>
    archiea 1. juni 2024 kl. 14.16 
    anyway we can have the ConsoleLcdName command go to a cockpit or a console LCD? thanks!

    hey sinari! thanks for the help before on the expanse server!