Launching a cel script from a celx script
Posted: 29.10.2007, 11:06
As discussed by Andrea in the following thread, launching a Cel script from a Celx script is not possible yet: http://celestiaproject.net/forum/viewtopic.php?t=11607&start=8
Of course, one can already include Cel commands into a celx script. However, with the new possibilities to set the line and label colors, or to map functions to specific keys via celx scripting, I think that it could be useful and above all handier to have the ability to run one or several celx scripts in a row before launching a start.cel script.
I've already implemented a celestia:runscript command in one of my Celestia builds. Adding this command at the end of a celx script allows launching whatever celx or cel script once the original celx script is done.
Here's a concrete example:
Would you find such a feature useful ?
Of course, one can already include Cel commands into a celx script. However, with the new possibilities to set the line and label colors, or to map functions to specific keys via celx scripting, I think that it could be useful and above all handier to have the ability to run one or several celx scripts in a row before launching a start.cel script.
I've already implemented a celestia:runscript command in one of my Celestia builds. Adding this command at the end of a celx script allows launching whatever celx or cel script once the original celx script is done.
Here's a concrete example:
Code: Select all
-- Title: Alternate color palette
celestia:setlabelcolor("stars", 0.500, 0.500, 1.000)
celestia:setlabelcolor("planets", 0.150, 0.740, 1.000)
celestia:setlabelcolor("moons", 0.450, 0.576, 0.612)
celestia:setlabelcolor("asteroids", 0.460, 0.440, 0.360)
celestia:setlabelcolor("comets", 0.840, 0.620, 0.280)
celestia:setlabelcolor("spacecraft", 0.750, 0.740, 0.670)
celestia:setlabelcolor("locations", 0.220, 0.940, 0.440)
celestia:setlabelcolor("galaxies", 0.190, 0.850, 0.710)
celestia:setlabelcolor("nebulae", 0.850, 0.350, 0.290)
celestia:setlabelcolor("openclusters", 0.620, 0.480, 0.540)
celestia:setlabelcolor("constellations", 0.385, 0.280, 0.567)
celestia:setlabelcolor("equatorialgrid", 0.318, 0.439, 0.361)
celestia:setlinecolor ("starorbits", 0.500, 0.500, 0.800)
celestia:setlinecolor ("planetorbits", 0.000, 0.360, 0.900)
celestia:setlinecolor ("moonorbits", 0.220, 0.330, 0.400)
celestia:setlinecolor ("asteroidorbits", 0.280, 0.240, 0.216)
celestia:setlinecolor ("cometorbits", 0.520, 0.320, 0.128)
celestia:setlinecolor ("spacecraftorbits", 0.360, 0.360, 0.360)
celestia:setlinecolor ("constellations", 0.234, 0.090, 0.576)
celestia:setlinecolor ("boundaries", 0.192, 0.079, 0.151)
celestia:setlinecolor ("equatorialgrid", 0.192, 0.248, 0.184)
---------------------------------
runscript("start.cel")
---------------------------------
Would you find such a feature useful ?