Scripting Commands

wait
Parameters:
float duration = 1.0
Description:
Pause for a number of seconds specified by the duration parameter.
select
Parameters:
string object = ""
Description:
Set the selection to the specified object. Names can be in 'path' form, e.g. "Sol/Earth/Moon" Otherwise, the object selected may depend on the location of the camera. Just using "Moon" works fine within our solar system, but the full path form is favored.
goto
Parameters:
float time = 1.0
float distance = 5.0
string upframe = "observer"
vector up = [ 0 1 0 ]

Description:
Go to the currently selected object. Trip duration is controlled with the time parameter. The distance parameter specifies how far away from the object to stop in units of the object's radius. The goto command executes instantaneously so that you can use other commands such as print while the camera is moving toward the destination. In order for goto to complete, there should be wait commands with a combined duration equal to the value of the time parameter.

Example:
For example, consider this script:
{ select object "Sol/Earth" }
{ goto time 1.5 }
{ select object "Sol/Mars" }
{ goto time 2.0 }
{ wait duration 2 }
It will not take you to Earth . . . instead, you'll zoom off immediately toward Mars. In order to make this script work as expected, there needs to be a wait with duration 1.5 after the first goto command.
gotolonglat
Parameters:
float time = 1.0
float distance = 5.0
vector up = [ 0 1 0 ]
float longitude = 0
float latitude = 0

Description:
gotolonglat works exactly the same as goto except that you can specify coordinates on the surface of the object as well as a distance. Since the distance is in object radii, a distance of 1.0 will put you right on the surface. Typically, you want to be just above the surface, so giving a radius of 1.001 is a better idea. Latitude is negative for the southern hemisphere and positive for the northern hemisphere. Longitude is negative for the western hemisphere and position for the eastern hemisphere.
center
Parameters:
float time = 1.0
Description:
Center the currently selected object in the field of view. Time specifies how many seconds it should take to slew the camera.
follow
Description:
Follow the currently selected object. This causes the camera to stay in the same place relative to the center of an object.
synchronous
Description:
Sync orbit the currently selected object. This causes the camera to stay in the same position and orientation relative to a location on the object's surface.
cancel
Description:
Stop a currently running goto command . . . like pressing the ESC key.
print
Parameters:
string text = ""
Description:
Show a line of text on the screen
time
Parameters:
float jd = 2451545.0
Description:
Set the time to the specified Julian day.
timerate
Parameters:
float rate = 1.0
Description:
Set the rate at which simulation time advances relative to real time. A negative value for rate will cause time to go backwards (but only in the simulation.)
changedistance
Parameters:
float rate = 0.0
float duration = 1.0
Description:
Exponentially change the distance between the camera and the selected object over some duration. A negative rate will move closer to the object, a positive rate moves farther out.
orbit
Parameters:
float rate = 0.0
float duration = 1.0
vector axis = [ 0 0 0 ]

Description:
Orbit the selected object around a given axis. The rate is in units of degrees per second. (Still need to specify which coordinate system the axis is defined in.)
move
Parameters:
float duration = 0.0
vector velocity = [ 0 0 0 ]

Description:
Move at a constant velocity for an amount of time. The velocity is given in units of kilometeres per second.
renderflags
Parameters:
string set = ""
string clear = ""
Description:
Change rendering options. Possible options include: orbits, cloudmaps, constellations, galaxies, planets, stars, nightmaps. Multiple options can be enabled in a single command by listing several names separated by the | character.
Example:
This will turn on orbits and constellations:
{ renderflags set "orbits|constellations" }
This will turn off cloud maps and night maps, so that you can enjoy clear, dark skies for stargazing.
{ renderflags clear "cloudmaps|nightmaps" }
labels
Parameters:
string set = ""
string clear = ""

Description:
Change labeling options. This command works in a manner similar to renderflags. Options are: planets, moons, spacecraft, asteroids, constellations, stars, galaxies. The moons, spacecraft, and asteroids options are only available in Celestia 1.2.4+.
setvisibilitylimit
Parameters:
float magnitude = 6.0
Description:
Display only stars brighter than the specified magnitude.
setambientlight
Parameters:
float brightness = 0.0
Description:
Set the amount of additional light used when rendering planets. For realism, this should be set to 0.0. Setting it to 1.0 will cause the side of a planet facing away from the sun to appear as bright as the lit side. Only available in Celestia 1.2.4+.