Celestia/Cel Scripting

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

[edit] CEL scripting

CEL scripts are short text-based programs that Celestia can read. They contain simple commands that take control of Celestia (once it is launched) and enable a script writer to design a specific journey or set of scenes that a user of the script will see and experience. For example, a script may take the user on a short tour of the solar system, pausing briefly at all of the planets. In that way, a cel script is used to change the position of Celestia's viewpoint.

CEL scripting is basically a sequence of commands similar to key-presses, which are executed in specific timing and at a particular speed to give viewers a visual experience that the script writer wants to display. There is no interactivity.
They take users to very specific locations in the Celestia universe. For example, a script can be written to take the viewer into orbit around Venus, or take them outside the Milky Way to view it from intergalactic space. What happens when they get there is controlled by the script as well. There may be a 30 second pause, then movement on to another location. There may be text displayed to teach the user some information about that particular place. Recently, CEL scripts have been given the ability to also command sound and music files to play. As such, scripts can be designed which choreograph complex movements of planets or spacecraft, while moving to music.

A script can be launched and it will run until it is complete, or it can be stopped by the user at any time by pressing the [Esc] key.

Anyone can write a CEL script. Some knowledge of how to do so is required and is summarized below, but you do not have to be a very experienced Celestia user to write a script.

CEL scripts offer a Celestia user several key advantages. First, a Celestia script writer can give inexperienced users a beautiful visual tour of a particular Celestia environment. Secondly, important celestial events can be displayed for a user, controlled by script. For example, a script can take a user to 1957 to see Sputnik 1 orbiting Earth on its maiden flight. The script can put the viewer into a position just 10 meters from Sputnik, and pace it as it flies over the Soviet Union, then display a paragraph of text explaining the significance of Sputnik. If no script were available, it might take a user many minutes to set up Celestia to go to the same spot at the same time. Also, no text would be displayed.

A main advantage of CEL scripting is that it's MUCH easier to use than CELX scripting. The syntax is easy due to the simple structure of the commands, and most of the time it's very easy to translate keyboard-commands directly into their CEL counterparts.

The primary disadvantage in using CEL-scripting is its limited flexibility, its inability to respond to keyboard commands, and a lack of support for many of the new Celestia features that appear in Celestia version 1.6.0 (still under development).

[edit] External Links

A slightly out-of-date summary of .CEL commands.

A list of more of the .CEL scripting commands, somewhat cryptically organized.

An example .CEL script

Some helpful .CEL and .CELX scripts for Celestia are available on Don G's Celestia Scripting Resources