Skip to content
Luiz Fellipe Carneiro edited this page Dec 9, 2017 · 10 revisions

Scripts Reference

APPROACH

Parameters:

  • None

This program is intended to be used as the last part of a rendezvous operation. Whenever your ship is near (about a few dozen km) from your target, you can run approach to match the speeds and get closer to about 150m of your target.

CIRC_ALT

Parameters:

Name Type Default value Description
alt Scalar - Desired orbit altitude in meters.

It will circularize your ship's orbit at the desired altitude. When starting in a circular orbit it will do a initial burn with node_alt and then use node_peri or node_apo to change periapsis or apoapsis respectively. When starting in an elliptical orbit, it will just adjust it with node_peri and node_apo.

CIRC

Parameters:

  • None

Circularizes the orbit in the next apsis. Just that simple.

DEPART

Parameters:

Name Type Default Value Description
DockPort DockingPort 0 The docking port you want to undock. If it's value is 0, depart will choose the port for you.

Undocks the ship and departs to a safe distance (Default: 100m). Can't make a good decision if your ship is docked to more than one other craft.

DOCK

Parameters:

  • None

Docks with your target vessel. To this works somethings must be noted:

  • Your ship and target vessel must have docking ports of the same size.
  • Your ship must be in the vicinity of the target ship.
  • If your ship is farther than the Unpack distance, dock will first run approach
  • The target must be selected beforehand with Kerbal Space Program interface or with set target to vessel("Name") command.

FLY

Parameters:

Name Type Default Value Description
KindOfCraft String Plane Set the ILS/Autoland profile. Use Planefor aeroplanes and Shuttle for space shuttles.
LandingGear String Taildragger Set the behaviour of the craft after touching the runway. Use Tricycle for crafts with tricycle style landing gear and Taildragger for crafts with conventional style landing gear.

The fly script is an atmospheric autopilot. It does have a graphic user interface (GUI) where you can adjust flight parameters and autopilot modes.

When KindOfCraft is Shuttle, the ILS mode will be engaged automatically and will try to land the craft on KSC runway.

LANDVAC

Parameters:

Name Type Default Value Description
LandMode String Targ Selects how landvac will find the landing site: Targ will try to land on the selected target. Coor will try to land on LandLat and LandLng. Ship will try to land in the coordinates that ship is flying over when the program start.
LandLat Scalar ship:geoposition:lat Target latitude for Coor mode.
LandLng Scalar ship:geoposition:lng Target longitude for Coor mode.

Lands your ship, warranty voids if try to use in a body with atmosphere (but it will try nevertheless, just can't account for it's effects). The landvac program will try to first do a plane change so the orbits pass over the target, than it will lower the periapsis right over the target to a minimum safe altitude, and finally will kill all orbital velocity over this periapsis. Not the most efficient way to deorbit but it works. During the fall, the craft will maintain a safe descent speed at the same time it will steer both to kill any remaining horizontal speed and to approach the desired target.

LAUNCH_ASC

Parameters:

Name Type Default Value Description
apo Scalar 200000 The desired apoapsis height, in meters.
hdgLaunch Scalar 90 The heading to fly during the launch. It's not the orbit inclination (But is related to it).

Launch a rocket (or shuttle) from the launch pad. It will do all the duties of a launching like staging, releasing the fairings, keeping a sane velocity during ascent, doing a gravity turn and so. Just sit back and relax.

LAUNCH_SSTO

Parameters:

Name Type Default Value Description
TGTApoapsis Scalar 150000 The desired apoapsis height, in meters.
TGTHeading Scalar 90 The heading to fly during the launch. It's not the orbit inclination (But is related to it).

Launch a SSTO (Single Stage To Orbit) craft from the runway. It will take off and climb, trying to maintain a minimum acceleration until reaches the desired apoapsis. It will also change multi mode engines to closed cycle when appropriate. Of course this program will not stage anything!

MATCH

Parameters:

  • None

Matches your speed with target's one. Just that!

NODE_APO

Parameters:

Name Type Default Value Description
alt Scalar - The desired new apoapsis altitude.

Calculates a maneuver node to establish new apoapsis by performing a burn at periapsis. It does not execute the node, run node for that.

NODE_ALT

Parameters:

Name Type Default Value Description
alt Scalar - The desired orbit altitude.

Calculates a maneuver node to establish a new orbital altitude opposite the burn point. It does not execute the node, run node for that.

NODE_HOH

Parameters:

Name Type Default Value Description
MaxOrbitsToTransfer Scalar 5 The maximum number of orbits you allow to wait until a transfer window.
MinLeadTime Scalar 30 A minimum interval before a transfer burn, in seconds.

Calculates a Hohmann transfer orbit to the selected target, if possible. It does not execute the node, run node for that.

NODE_INC_EQU

Parameters:

Name Type Default Value Description
target_inclination Scalar - The desired orbit inclination.

Calculates a maneuver node to change the orbit to the desired inclination. It does not execute the node, run node for that.

NODE_INC_TGT

Parameters:

  • None.

Calculates a maneuver node to match orbital planes with the selected target. It does not execute the node, run node for that.

NODE_PERI

Parameters:

Name Type Default Value Description
alt Scalar - The desired new periapsis altitude.

Calculates a maneuver node to establish new periapsis by performing a burn at apoapsis. It does not execute the node, run node for that.

NODE_VEL_TGT

Parameters:

  • None.

Calculates a maneuver node to match velocities with selected target at closest approach. The node will bring the ship to a stop when it meets up with the target. The accuracy of this program is limited; it'll get you into roughly the same orbit as the target, but fine-tuning will be required if you want to rendezvous. You can use approach for that. This script also does not execute the node, run node for that.

NODE

Parameters:

  • None.

Executes the next maneuver node. It will try to do the best to achieve a perfect burn, including compensating for crafts with engines off-center, like shuttles and also using RCS to fine tune the burn.

RENDEZVOUS

Parameters:

  • None.

Execute a complete rendezvous and dock maneuver, changing planes, doing Hohmann transfer, matching speeds, all the shebang.

ROVER_AUTOSTEER

Parameters:

Name Type Default Value Description
TargetToFollow See note - The target to drive to or follow. See notes below.
DistanceToFollow Scalar 30 The distance to keep from the target.
speedlimit Scalar 28 Maximum relative speed to target. Default is about 100km/h (62mph).
turnfactor Scalar 5 Value used to adjust steering with speed. Reduce for rovers prone to rollover.
BreakTime Scalar 3 Approximate time to stop the rover with brakes. Higher values will make the rover to brake sooner.

Drives a rover autonomously, either following another craft, driving to a waypoint or following a list of waypoints. The behavior is determined by the type of TargetToFollow parameter:

  • Vessel: When TargetToFollow is a vessel, rover_autosteer will follow that target, DistanceToFollow will determine the distance to keep from the desired vessel. Note that this is independent from the target vessel selected in KSP Interface.
  • GeoCoordinates: When TargetToFollow is a GeoCoordinate (usually defined by the LatLng() command) the program will drive the rover in a straight line to that point, and stops in a distance of DistanceToFollow.
  • List (Of GeoCoordinates): When TargetToFollow is a List of GeoCoordinates, the rover will drive to each one of the points, in the order they are listed. When reaching within a radius of DistanceToFollow, the rover will change to the next item in the list. It will stop within a distance of DistanceToFollow from the last waypoint.

The rover will drive respecting the speedLimit parameter. Notice that is the relative speed, so when following a moving target, the actual speed will be different from speedLimit.

When driving faster the turnfactor, the steering will be reduced by the turnfactor divided by the groundspeed. This effectively increases the turning radius of the rover and reduce the chance of a rollover. Smaller turnfactor increases the turning radius.

The program calculates the time to reach the target, and whenever this time is less than BreakTime it applies the brakes. That prevents rear collisions or overshooting waypoints. If your rover brakes aren't much effective, increase the value.

ROVER

Parameters:

  • None.

Provides a text-mode menu for the rover scripts.

ROVERCONVOY

Parameters:

  • None.

Provides a text-mode list of all rovers in the same body that your own vessel, and let you choose one to follow with rover_autosteer script.

ROVERDRIVE

Parameters:

Name Type Default Value Description
speedlimit Scalar 39 Maximum allowed speed. Default is about 140km/h (88mph).
turnfactor Scalar 5 Value used to adjust steering with speed. Reduce for rovers prone to rollover.

The roverdrive is an interactive rover autopilot with a Graphic User Interface (GUI). It can be used as an assist to manually drive rovers, as an autopilot, keeping an speed and heading of your choice and can also be used to save routes to use with roverroute script.

This script have a built-in stability assist mode, that engages automatically when the rover jumps over terrain or start a roll over. This stability mode will use reaction wheels and RCS system to try to make the vehicle land with all its wheels after a jump, or recover from a roll over.

ROVERROUTE

Parameters:

Name Type Default Value Description
WaypointTolerance Scalar 5 Allowed distance deviation from waypoints.
MaxSpeed Scalar 28 Maximum relative speed to target. Default is about 100km/h (62mph).

Provides a text-mode list of routes generated with roverdrive program, and let you choose one to follow with rover_autosteer script.

Those routes are saved as JSON files in 0:/routes directory.

TRANSFER

Parameters:

  • None.

Transfer your ship to another body with the same parent. It align planes, do Hohmann transfers and establishes a new orbit on target body. It can't transfer for bodies with different parent, i.e., if you are orbiting Kerbin, you can transfer to Mun and Minmus only. If you're orbiting the Sun, you can transfer to any planet, but none of their moons.

UTIL_MAKESTARTUP

Parameters:

  • None.

Creates a sample startup script for your ship.

WARP

Parameters:

Name Type Default Value Description
dT Scalar - Time, in seconds, to warp.

Warps the time to the desired amount of seconds.