Some scripts are not accepted by Celestia

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Frank Hunter
Posts: 8
Joined: 06.01.2005
With us: 19 years 10 months

Some scripts are not accepted by Celestia

Post #1by Frank Hunter » 08.01.2005, 05:05

Can anyone explain why most scripts work for me but a few cause a requester to report an invalid script file. When capturing from the Forum I just highlight and copy then paste in Textedit, saving as plain text. The last one, Harald's 'Script: The Nine Planets displayed on the Forum, was downloaded by clicking on his site URL. This required no modifications at all yet was rejected.

Another is this 'Mini Tour

# Start of Script ------------------------------------------------------------------
{
?  ? #---------------------------------------------------------------------------
?  ? # SolarMiniTour.cel?  Version 1.0.0?  Last updated on 1/22/2004
?  ? # By L2Cache
?  ? # With inspiration from the demo and other scipts and the script guide
?  ? # Designed as a brief introduction to the solar system for students, etc.
?  ? # Tested with Celestia 1.3.0 and 1.3.1-1 on 640x480 and 800x600 displays
?  ? # The Sun spots will not show in lowres mode
?  ? # In Celestia 1.3.1, make sure orbits for moons and planets are activated
?  ? # So that the script can show them later when it needs to. On the menu bar,
?  ? # Go to Render, View Options, Orbits/Lables and check Orbits for
?  ? # Moons and Planets. Leave other Orbits unchecked.
?  ? # To clear the extra text on the screen, press the v key a couple of times.
?  ? # Set full screen mode to hide the title bar.
?  ? #---------------------------------------------------------------------------

?  ? cancel { }
?  ? renderflags { clear "orbits|constellations|comettails|boundaries|markers" }
?  ? renderflags { clear "eclipseshadows|pointstars" }
?  ? renderflags { set "stars|planets|cloudmaps|nightmaps|ringshadows" }
?  ? renderflags { set "galaxies|atmospheres" }
?  ? labels { clear "stars|planets|moons|spacecraft|asteroids|constellations|galaxies" }
?  ? set { name "FOV" value 150}
?  ? set { name "AmbientLightLevel"?  ?  ?  ? value 1.0 }

?  ? select { object "Milky Way" }
?  ? goto { time 4 }
?  ? wait { duration 4 }
?  ? print { text "Solar System Tour...
?  ? Clear the extra text on the screen - press the v key
?  ? once or twice. Hide the menu bar - Set full screen mode.
?  ? If orbits don't show in Celestia 1.3.1, go to
?  ? Render, View Options, Orbits/Lables and check Orbits
?  ? for Moons and Planets. Leave other Orbits unchecked." row -7}
?  ? wait { duration 15 }
?  ? print { text " " row -2 }
?  ? wait { duration 1.0 }
?  ? set { name "FOV" value 140 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 130 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 120 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 110 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 100 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 90 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 80 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 70 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 60 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 50 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 40 }
?  ? wait { duration 0.1 }
?  ? set { name "FOV" value 27 }
?  ? print { text "Our Galaxy, the Milky Way . . .
?  ? If you can't see it, increase the monitor's brightness a little." row -3 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? set { name "AmbientLightLevel"?  ?  ?  ? value 0.1 }
?  ? print { text " " row -2 }
?  ? wait { duration 1.0 }
?  ? print { text "Starting Solar System Tour . . . Press ESC to end." row -2 }
?  ? wait { duration 4.0 }

?  ? labels { set "stars" }
?  ? print { text " " row -2 }
?  ? select { object "Sol" }
?  ? set { name "FOV" value 32 }
?  ? wait { duration 0.05 }
?  ? set { name "FOV" value 37 }
?  ? wait { duration 0.05 }
?  ? set { name "FOV" value 41 }
?  ? wait { duration 0.05 }
?  ? set { name "FOV" value 45 }
?  ? wait { duration 0.05 }
?  ? goto { time 10 }
?  ? wait { duration 10.0 }
?  ? print { text "Let's start at the Sun with it's spots. . ." row -2 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? labels { clear "stars" }
?  ? labels { set "planets" }
?  ? print { text "Now on to Mercury . . ." row -2 }
?  ? select { object "Sol/Mercury" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "Then Venus . . ." row -2 }
?  ? select { object "Sol/Venus" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "And now, our Earth . . ." row -2 }
?  ? select { object "Sol/Earth" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 20 }
?  ? wait { duration 2.0 }

?  ? print { text "Let's see the Moon . . ." row -2 }
?  ? select { object "Sol/Earth/Moon" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "Show orbits and on to Mars . . ." row -2 }
?  ? renderflags { set "orbits" }
?  ? labels { set "moons" }
?  ? select { object "Mars" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? renderflags { set "orbits" }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "And Jupiter . . ." row -2 }
?  ? select { object "Jupiter" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "Then Saturn and it's rings. . ." row -2 }
?  ? select { object "Saturn" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "Now Uranus . . ." row -2 }
?  ? select { object "Uranus" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "And Neptune . . ." row -2 }
?  ? select { object "Neptune" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "At last, Pluto . . ." row -2 }
?  ? select { object "Pluto" }
?  ? goto { time 15 }
?  ? wait { duration 15.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 15 }
?  ? wait { duration 2.0 }

?  ? print { text "And we head back home to Earth." row -2 }
?  ? select { object "Sol/Earth" }
?  ? goto { time 25 }
?  ? wait { duration 25.0 }
?  ? orbit { axis [ 0 1 0 ] rate 30 duration 25 }
?  ? wait { duration 2.0 }
?  ? renderflags { clear "orbits" }
?  ? labels { clear "planets|moons" }
?  ? print { text "The End." row -2 }
?  ? wait { duration 3.0 }
}
# End of script ----------------------------------------------------

Any ideas anyone.

cel://URL's work fine but Celestia has to be running otherwise Celestia starts and dies immediately.

G5 iMac, 1.6 GHz, 1GB Ram

Would someone try these on their machine to help pin down the problem
Thanks

    hank
    Developer
    Posts: 645
    Joined: 03.02.2002
    With us: 22 years 9 months
    Location: Seattle, WA USA

    Post #2by hank » 08.01.2005, 17:19

    Frank,

    I copied and pasted the script from your post into TextEdit and it failed to work. This was evidently caused by some bad characters (0xCA=non-breaking space?) in the code. It worked fine after I used "Zap Gremlins" in BBEdit to clean it up.

    It is a known problem that cel: urls do not launch Celestia properly. This should be fixed in the next release.

    - Hank

    Topic author
    Frank Hunter
    Posts: 8
    Joined: 06.01.2005
    With us: 19 years 10 months

    Post #3by Frank Hunter » 08.01.2005, 18:52

    Thanks Hank, I cleaned most of my 'dead' files so that they work OK but a few still are not working. I noticed that when I zapped the gremlins I could forcast whether they would work or not. For some reason not known to me, but possibly evident to most others, when I saved the zapped files some could be 'saved', these worked, others had to be 'saved as' and did not work. Which of the three 'zap' options should I be using? I have tried different combinations with no apparent difference in results. Move over Bob you have company, Ha Ha!
    I entered the computer world late in life and find that the difficult part is not in the learning but in finding out where to look for answers. Thanks again for your help.

    Frank H.

    Bob Hegwood
    Posts: 1048
    Joined: 19.10.2003
    With us: 21 years 1 month
    Location: Germantown, Ohio - USA

    Post #4by Bob Hegwood » 09.01.2005, 03:30

    Frank Hunter wrote:I have tried different combinations with no apparent difference in results. Move over Bob you have company, Ha Ha!

    Frank,

    The Celestia CEL parser is not very good at telling you exactly what is wrong
    with a script. It just tells you that it has an error somewhere. Most of the
    time, it's been my experience that something really simple is either missing,
    or has been mis-typed. You can forget a single quotation mark somewhere
    and the whole script is dead...

    The only thing you can do is go over it line by line to find the error.

    That's why I'm Brain-Dead. No one in their right mind would ever even
    consider doing something like this. :wink:

    Take care, Bob
    Bob Hegwood
    Windows XP-SP2, 256Meg 1024x768 Resolution
    Intel Celeron 1400 MHz CPU
    Intel 82815 Graphics Controller
    OpenGL Version: 1.1.2 - Build 4.13.01.3196
    Celestia 1.4.0 Pre6 FT1

    Topic author
    Frank Hunter
    Posts: 8
    Joined: 06.01.2005
    With us: 19 years 10 months

    Post #5by Frank Hunter » 09.01.2005, 16:54

    Thanks Bob, your explanation sounds logical except that Harald's 'Script: The Nine Planets displayed on the Forum, was downloaded by clicking on his site URL. This required no modifications at all yet was rejected.
    I'm sure I posted this reply last night but can't trace it, I guess I have a photographic memory, it's just not developed yet.

    Regards
    Frank H.
    Frank

    Bob Hegwood
    Posts: 1048
    Joined: 19.10.2003
    With us: 21 years 1 month
    Location: Germantown, Ohio - USA

    Post #6by Bob Hegwood » 12.01.2005, 22:03

    Frank,

    I just highlighted and copied the script above, and then saved it as a .CEL
    file using Notepad in Windows.

    Opened Celestia and ran the script with NO problems whatsoever.

    Have no idea what's going on at your end, but it may have something to do
    with either your text editor, or the way in which you're saving the file. :?:

    Are you saving it as a straight ASCII file? Sorry I can't be of any more help.

    Take care, Bob
    Bob Hegwood

    Windows XP-SP2, 256Meg 1024x768 Resolution

    Intel Celeron 1400 MHz CPU

    Intel 82815 Graphics Controller

    OpenGL Version: 1.1.2 - Build 4.13.01.3196

    Celestia 1.4.0 Pre6 FT1

    Harry
    Posts: 559
    Joined: 05.09.2003
    With us: 21 years 2 months
    Location: Germany

    Post #7by Harry » 13.01.2005, 01:21

    Frank, AFAIK the Mac version of Celestia doesn't support CELX scripts, so any script with the .celx suffix won't work. I hope the next release will support it, but I have no clue if this will actually become true.

    Harald


    Return to “Scripting”