Celestia Scripting Stuff

Documentation and Scripts for Celestia-scripting (CELX).
Introduction

To quote the Celestia homepage: "Celestia is a free real-time space simulation that lets you experience our universe in three dimensions.". If you haven't heard of it already, you are probably wrong here, but you really should download and try Celestia - it's great. You can find many screenshots here.

Celestia offers two scripting languages: first the original celestia-scripts (suffix: .cel), which don't offer any control-structures, and in recent versions Lua-scripting (suffix: .celx), a complete programming language which was designed for being embedded in applications. I contributed some enhancements for Lua-scripting, which are available since Celestia v1.3.1, and here you will find a summary about Lua-scripting and some example scripts which use the new functionality.

For comments or questions post in the scripting-forum at shatters.net, or write me a Mail:

CELX Documentation
If you want to create CELX-scripts for Celestia, you'll have to learn some Lua first. Lua is the programming language used for CELX-scripts. You can find documentation for Lua at the Lua-website at http://www.lua.org/.

The Celestia-specific functionality of CELX is described in the
Scripts
Solarsystem Tour

This scripts does a tour through the solar-system, visiting all planets and some asteroids in one smooth and continuous movement without stopping. Version 1.0 always has the camera pointed in direction of movement, while version 1.1 keeps the camera on the planets during flyby.

Click here: solarsystemtour_v1.1.celx, solarsystemtour_v1.0.celx

Lua-console (Celestia 1.3.2 or newer)

Enter Lua-commands directly in celestia. Backspace is the only available line-editing capability.

New in 1.1: Use CTRL-P and CTRL-N to bring back already entered commands.

Each line is executed as a separate function. You can return values, which are then displayed on screen, and access global variables.

Click here: lua-console_v1.1.celx (old: lua-console_v1.0.celx)

Around-the-earth

Small and simple script which moves the camera around earth in a spiral. Should be easy to understand, in case you want to write your own scripts. The second script is a minor variation of the first one.

Click here: around-the-earth_v1.0.celx

Click here: around-the-earth_far_v1.0.celx

Random Motion

Slowly and randomly changing directions this script will lead you on a tour through the galaxy.

Click here: random_motion_v1.0.celx

The Nine Planets (Celestia 1.3.2 or newer)

This is an example for MultiView-scripting, showing all nine planets.

Click here: nineplanets_v1.0.celx

Timestep keys (Celestia 1.3.2 or newer)

Change time by one solar day ('d'/'D'), sidereal day ('s'/'S') or year ('a'/'A') for the currently selected planet (Only planets can currently be used).
New in v1.1: A short description is displayed on start

Click here: timestepkeys_v1.1.celx

Frames Of Reference (Celestia 1.3.2 or newer)

This script may help understanding the various frames of reference implemented in Celestia. When started, the script will always set the observer on one of the axis for the currently active frame of reference. The used axis can be chosen by pressing "X", "Y" or "Z" (capital letters). The frame can either be changed by normal keyboard commands for follow, synchronous, ... or by pressing "F" to select the next frame and "G" for the previous frame.
New in v1.1: A short description is displayed on start

If you prefer slower or faster changes of axis, you can modify the variable "change_duration" in line 36.

Click here: FramesOfReference_v1.1.celx

Show Azimuth and Elevation (Celestia 1.3.2 or newer)

Displays the azimuth and the elevation of the direction the observer is looking to. Note: all keyboard-commands are capital letters, so they don't intefere with normal Celestia usage.

Changes in v1.1: Displays RA and Dec as well. Azimuth and Elevation is always displayed and computed relative to the surface of Earth, unless the user changes the base-planet by selecting another planet and then pressing "S".

Changes in v1.2: You can now enter Azimuth and Elevation: Press "A".
You can now force the horizon to stay horizontal, i.e. to make up always point away from ground: Press "F".

Changes in v1.3: A short description is displayed on start.

Click here: show-azimuth-elevation_v1.3.celx (v1.2, v1.1, v1.0)

Stopclock (Celestia 1.3.2 or newer)

Displays simulation time between two keypresses. Press Shift-X to start and stop the clock.

Click here: stopclock_v1.0.celx

Mark stars with planets

Checks for each star if it has planets, and if so marks it.

Click here: mark_stars_with_planets_v1.0.celx