Hello Everyone,
Listed below, is what I call a "Template Script" that can be used to start a new .cel script for use in Celestia version 1.3.0 and up. It sets Celestia to a "known state", as best as .cel scripting allows.
Here are a couple of ideas on how to use this script:
* It can be used every time you start writing a new script, providing you with pre-written commands to set-up Celestia the way you want to for the new script. Just change the commands and/or parameters to the way you want them and save the script. Then, anytime you start a new script, open the template and perform a File/Save As using the name for your new script.
* You can copy and rename the script to "start.cel", then move it to the main Celestia folder/directory so that it runs every time you start Celestia.
If you find a bug, or if you know of other items that can be set to a "known state" via .cel scripting, please post a message here so the script can be updated. Thank you!
Hope you find it useful.
__________________
-Don Goyette
Visit my Celestia web page
* Select the text in the code box, copy it, then paste it to your own text file
--or--
* Click this link and then save the file to your computer: CelScriptTemplate_v1_2.cel.txt. When you save this file to your computer, remove the ending ".txt" from the filename. It's there in case someone left-clicks the link instead of right-clicking it.
Code: Select all
{
#****************************************************************************
#* Template .CEL Script for Celestia (version 1.2) *
#****************************************************************************
# How to use this template
# ------------------------
# 1. Open this file with a text editor
# 2. File/Save As the file with YOUR script file name and the .cel extension
# 3. Change any of the commands or parameters to suit your needs
# 4. Add your own Script Body code
#----------------------------------------------------------------------------
# Set Celestia to a "known state"
#----------------------------------------------------------------------------
# Cancel follow and goto commands, and set Coordinate System to Universal...
cancel { }
# Note: cancel in ver 1.3.0 does NOT clear Track, Lock or Chase, like the ESC key does,
# so we must do it manually (version 1.3.1 does this automatically)...
# select { object "" } # this works
# track { } # this works
# chase { } # this does not work
# lock { } # this does not work
# Clear the display of any left-over text from the print command...
cls { }
# Do not render the following objects...
renderflags { clear "boundaries|comettails|constellations|eclipseshadows" }
renderflags { clear "markers|orbits|pointstars|ringshadows" }
renderflags { clear "automag|grid" } # version 1.3.1+
# Render the following objects...
renderflags { set "cloudmaps|galaxies|nightmaps|planets|stars" }
renderflags { set "atmospheres" } # version 1.3.1+
# Do not label the following objects...
labels { clear "planets|moons|spacecraft|asteroids|constellations" }
labels { clear "stars|galaxies" }
# Label the following objects...
# labels { set "planets|moons|spacecraft|asteroids|constellations" }
# labels { set "stars|galaxies" }
# Unmark any objects that are currently Marked and disable Marker display...
unmarkall { } # version 1.3.1+
# Set Minimum Orbit Size...
set { name "MinOrbitSize" value 1.0 }
# Set Ambient Light Level...
# (0.0 to 1.0 is a good Lo-Hi range)...
set { name "AmbientLightLevel" value 0.10 }
# Set Field of View...
# (Celestia 1.3.0 default value is 45)
# (Celestia 1.3.1 default value is 25)
set { name "FOV" value 25.0 }
# Set Star Distance Limit...
# (Celestia default value is 1000000)
set { name "StarDistanceLimit" value 1000000 }
# For the next two Magnitude settings, Selden Ball reminds us of the following:
# "A magnitude limit of 6.5 corresponds to what you can see with the naked eye
# on a very dark night away from city lights."
# Set visible star Magnitude...
# (Celestia UI: 0.8 to 15.2, default is 6.0)
setvisibilitylimit { magnitude 6.50 }
# Set Faintest Auto-Magnitude Brightness...
# (Celestia default value is 8.5)
setfaintestautomag45deg { magnitude 8.5 }
# Set Time Rate (1x, 100x, 1000x, etc.)...
# (A negative value = Reverse Time
# 0 = Pause Time
# 1.0 = Real Time (default)
# 1000.0 = Good moon orbit motion)
timerate { rate 1.0 }
# Set Date and Time...
# U.S. Navy Calendar Date/Time to Julian Date/Time converter:
# http://aa.usno.navy.mil/data/docs/JulianDate.html
# time { jd JulianDay.JulianTime }
#----------------------------------------------------------------------------
# Start at Earth/USA (or anywhere else you want to start). You can simply
# delete this code if you don't want to use it.
#----------------------------------------------------------------------------
# Select the Earth...
select { object "Earth" }
gotolonglat { time 2
distance 5
longitude -94.82394
latitude 35.28109 }
print { text "Going to Earth..."
row -3
column 25
duration 3 }
wait { duration 3 }
track { }
print { text "Now Tracking Earth."
row -3
column 25
duration 3 }
wait { duration 3 }
#----------------------------------------------------------------------------
# Script Body - Your code goes here ...
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# End of Script - Let the user know the script is done running ...
#----------------------------------------------------------------------------
print { text "The script is finished."
row -3
column 25
duration 5 }
wait { duration 5 }
}