Voyager 1 Flyby script

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Oniisan
Posts: 16
Joined: 26.11.2003
With us: 20 years 11 months

Voyager 1 Flyby script

Post #1by Oniisan » 26.11.2003, 10:24

***** Updated script 11-30-2003 ****

First Post!

New to scripting, but have been following and enjoying the Celestia program/forum since version 1.25 or so. Currently using Celestia version 1.3.1 pre 11. Since I've taken so much from this forum I decided I'd try to give something back in return, small as it may be.

My current PC is a HP Pavilion 650 Mhz (so slow!) with nVanta 8 meg video card and 128 meg Ram running Windows 98. I hope to upgrade very soon! :-)

Thought I'd try my hand at the scripts and see what I could learn. I found out I didn't know very much :-) After many hours of trial and error and various other tests I think I'm getting the hang of it, though I have a good ways to go yet. Many thanks to Don for his scripting documentation! It really helps and I hope to see it completed.

So here is my first "real" script for better or worse. I welcome any comments.

I saw a few posts mentioning the lack of Voyager 1 and 2 scripts and such so I decided to try those first. The cel script for Voyager 1 is pasted below. Not sure if there is a better way to get this posted or not, the paste wrapped around on the message screen, maybe it'll be ok. Still working on Voyager 2 script.



{

# Script Start ---------------------------------------------------------------------------

# Voyager 1 Flybys by Andr? Smith 11/24-26/2003 Version 4
# Created using screen resolution of 1024 x 768

# Celestia Program by Chris Laurel
# http://ennui.celestiaproject.net/celestia/

# Requires Voyager trajectory xyz files available from "Jack's Celestia Add-ons" web site.
# http://homepage.eircom.net/~jackcelestia/

# Requires Voyager Model produced by Kalaus Gierloff.
# Can be found on Darkmiss site as of November 26,2003
# http://www.bt.homepage.btinternet.co.uk/Celestia.htm


# Stop Time

timerate { rate 0 }

# Preload Textures

preloadtex { object "earth" }
preloadtex { object "jupiter" }
preloadtex { object "io" }
preloadtex { object "ganymede" }
preloadtex { object "europa" }
preloadtex { object "callisto" }
preloadtex { object "saturn" }
preloadtex { object "titan" }

wait { duration 4 }

# Clear Labels, Render Flags and Unmark everything.

labels {clear "galaxies|moons|asteroids|constellations|stars|planets|spacecraft" }
renderflags {clear "stars|galaxies|orbits|constellations|markers|planets|spacecraft"}
unmarkall {}
cancel {}

# Set Field of View and Ambient Light values

set { name "FOV" value 45.0 }
set { name "AmbientLightLevel" value 0.3 }

# Set date to September 5, 1977

time { jd 2443392.24619 }

# Select Voyager 1, position to View Earth after Launch and follow Voyager for 20 seconds

select { object "sol/Voyager 1" }
gotolonglat {distance 3 longitude -90 latitude 10 up [0 1 0] time 2}
wait { duration 2 }
follow { }

renderflags { set "planets|spacecraft"}

timerate { rate 1 }

select { object "Earth" }

print { text "Voyager 1 Launch Date - September 5, 1977" origin "left" duration 15 row -12 column 18 }

timerate {rate 2500}

wait { duration 20 }

#--------------------------- On To Jupiter ------------------------------------------

# Turn on Labels, Mark Voyager 1 and Jupiter, Zoom out and speed up timerate.

labels { set "planets" }

select { object "Voyager 1" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 7}
wait { duration 8 }
track {}

orbit { axis [ 1 0 0 ] rate 45 duration 2 }

renderflags { set "orbits|markers" }
labels { set "spacecraft" }

mark { object "Voyager 1" color [1 1 1] symbol "diamond" }
mark { object "Jupiter" color [1 0 0] symbol "square" }

changedistance { duration 6.3 rate 4.0 }

print { text "Timerate 1 Month per second" origin "left" duration 7 row -12 column 18 }

timerate { rate 2592000 }

wait { duration 17.5}

labels {clear "planets|spacecraft" }
renderflags {clear "orbits|markers|planets"}
unmarkall {}

timerate {rate 7500}

# Set date to March 1979, return to Voyager and Track Jupiter for the Flyby

time { jd 2443936.02403 }

select {}
track {}
select { object "Voyager 1" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 1}
wait { duration 1 }
chase {}

select { object "jupiter" }
track {}

renderflags { set "planets"}

print { text "Jupiter Flyby - March 1979" origin "left" duration 25 row -12 column 18 }

wait { duration 30 }

#--------------------------- On To Saturn ------------------------------------------


# Turn on Labels, Mark Voyager 1 and Saturn, Zoom out and speed up timerate.

labels { set "planets" }

select {}
track {}

select { object "Voyager 1" }
gotolonglat {distance 3 longitude 100 latitude 10 up [0 1 0] time 8}
wait { duration 8 }
track {}

orbit { axis [ 1 0 0 ] rate 45 duration 2 }

renderflags { set "orbits|markers" }
labels { set "spacecraft" }

mark { object "Voyager 1" color [1 1 1] symbol "diamond" }
mark { object "saturn" color [1 0 0] symbol "square" }

changedistance { duration 6.3 rate 4.0 }

print { text "Timerate 1 Month per second" origin "left" duration 7 row -12 column 18 }

timerate { rate 2592000 }

wait { duration 20}

labels {clear "planets|spacecraft" }
renderflags {clear "orbits|markers|planets"}
unmarkall {}

timerate {rate 7500}

# Set date to November 1980, return to Voyager and Track Saturn for the Flyby

time { jd 2444554.02403 }

select { object "Voyager 1" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 1}
wait { duration 1 }
chase {}

select { object "saturn" }
track {}
lock {}

renderflags { set "planets" }

print { text "Saturn Flyby - November 1980" origin "left" duration 25 row -12 column 18 }

wait { duration 35 }

#--------------------------- Leaving System ------------------------------------------

select {}
track {}
lock {}

renderflags {set "orbits"}
labels { set "planets|spacecraft" }

select { object "saturn" }

timerate { rate 2592000 }

wait { duration 4 }

print { text "Tour Complete - Leaving System" origin "left" duration 20 row -12 column 18 }

select { object "Voyager 1" }
gotolonglat {distance 5 longitude 25 latitude 30 up [0 1 0] time 3}
wait { duration 3 }
center { time 3 }
wait { duration 3 }
lock { }

select { object "sol" }
center { time 5 }
wait { duration 5 }
lock { }

timerate { rate 25920000 }

wait { duration 26 }

timerate {rate 1}

# Set date to November 27, 2003. Turn on Stars and Galaxies. Clear Orbits and Labels

time { jd 2452970.92623 }

renderflags {set "stars|galaxies"}
wait { duration 2 }

renderflags {clear "orbits"}
wait { duration 2 }

labels {clear "planets|spacecraft"}
unmarkall {}
select {}
track {}

select { object "sol" }
wait { duration 4 }

print { text "Returning to Earth" origin "left" duration 7 row -12 column 18 }

select { object "earth" }
goto { time 10 }
wait { duration 10 }

print { text "End of Script" origin "left" duration 4 row -12 column 18 }
wait { duration 4 }

cancel {}

# Script End ---------------------------------------------------------------------------

}

What you're supposed to see when it's run:

Clears all stars, galaxies, etc.
Sets the date to September 1977
Positions the viewer with Voyager 1 and Earth visible.
Follows and Tracks Voyager 1 for a few seconds.
Zooms out to view solar system while tracking Voyager 1
As it approaches Jupiter, jumps back to view and track Jupiter in the first flyby.
Zooms out again.
Jump back to view and track Saturn on second flyby.
Tracks Voyager 1 and Sol as it leaves the system.
Returns to Earth
Ends Script

Things I know need to be fixed:

Is there any way yet to capture user settings and restore them after a script is run? If not maybe they'll be added later?

Would love to see more modifications to this script, maybe some split screens, better/more info in the texts etc. Perhaps more stops along the way to view the moons, etc.

Plenty of things can be added. As it is now it's pretty basic.


Enjoy! Voyager 2 flying by now!
Last edited by Oniisan on 30.11.2003, 20:56, edited 3 times in total.

JackHiggins
Posts: 1034
Joined: 16.12.2002
With us: 21 years 11 months
Location: People's Republic Of Cork, Ireland

Post #2by JackHiggins » 26.11.2003, 15:44

VERRY good... :D

Nice use of the "mark" command there too! :wink:

One thing though- when doing flybys of planets, I find that using both the "lock" and "track" commands, shows them better than just tracking. Using both means that things don't flip over after you fly past them (like what happens with saturn in your script). What you've set to be "up" stays "up"! :)

The dish on Voyager 1 is pointing the wrong way. Anyone know how to fix that?

They voyagers were 3 axis stabilised, not spin stabilised. This means that they are constantly changing orientation depending on what they're doing (sending data, taking photos etc) and this would be very hard to duplicate using current rotation systems in celestia. Until we get something better, it's probably just easier to leave it alone...!!
- Jack Higgins
Jack's Celestia Add-ons
And visit my Celestia Gallery too!

Topic author
Oniisan
Posts: 16
Joined: 26.11.2003
With us: 20 years 11 months

Thanks Jack!

Post #3by Oniisan » 26.11.2003, 19:41

Thanks for the helpful info there Jack! Yes I do want the planets to stay "up" and be able to remove some rotation correcting code as well. I'm not too very concerned about Voyager's orientation, but it would be nice to at least have the main dish pointed back "home". I'm guessing that was how the radio transmissions were received and maybe transmitted back. Just seems odd to have it pointing everywhere other than back to Earth :-) Of course I could be wrong, not a Voyager expert. I see my pasting of the code also removed the indents I had to make it easier to read.

Just found out on my system when I run the script as Celestia is first started it doesn't always place Voyager and Earth together, Earth may be 206 au's away! It runs fine all the times after that first run. I'll be scripting Voyager 2 the same way with the zoom outs, marking and tracking. At some point I'd like to make the split screens (if it's possible in scripting) and track some of the moons at each flyby. Much to learn yet. But all that will have to wait a few days until after the holiday. Happy Thanksgiving everyone!

JackHiggins
Posts: 1034
Joined: 16.12.2002
With us: 21 years 11 months
Location: People's Republic Of Cork, Ireland

Post #4by JackHiggins » 26.11.2003, 21:23

I'm guessing that was how the radio transmissions were received and maybe transmitted back.
You'd think that, wouldn't you... :wink:

Nah- that is what they did for Voyager 1, but Voyager 2's HGA (High gain antenna- the big dish) broke down after a few months, and they have been forced to use the low gain, omnidirectional antenna for the rest of the mission. (It's still being used!) Sort of the same thing as what happened on galileo, although an electrical, rather than mechanical fault.

Earth may be 206 au's away!

That's the standard start position for celestia. If you didn't have start.cel, you'd stay there every time you start up!

I'd like to see Don G's opinion on this...! :)
- Jack Higgins

Jack's Celestia Add-ons

And visit my Celestia Gallery too!

Topic author
Oniisan
Posts: 16
Joined: 26.11.2003
With us: 20 years 11 months

The Lock worked!

Post #5by Oniisan » 27.11.2003, 05:39

Once again, thanks Jack for all the info. I was unaware of the HGA problems Voyager 2 had. It's little facts like that I'd like to add to the scripts somehow. I'll have to do more research on the Voyagers now :-)


I tried the lock command at Saturn and it worked great! So here is the revised section. The first post of the script has been updated as of 11-30-2003.


select { object "saturn" }
track {}
lock {} <------- add this command

renderflags { set "planets" }

print { text "Saturn Flyby - November 1980" origin "left" duration 25 row -12 column 18 }

wait { duration 35 }
#--------------------------- Leaving System ------------------------------------------

select {}
track {}
lock {} <------ add this command

*** deleted this section -----------------------------------------------------------
select { object "Voyager 1" }
gotolonglat {distance 4 longitude 120 latitude 45 up [0 1 0] time 6}
chase {}
wait { duration 6 }
*** ---------------------------------------------------------------------------------

Topic author
Oniisan
Posts: 16
Joined: 26.11.2003
With us: 20 years 11 months

Voyager 2 script

Post #6by Oniisan » 30.11.2003, 21:11

Back from the holiday and back to scripting :-) Just finished version 2 of the Voyager 2 script. It uses the same style as the Voyager 1 script I made earlier. I hope now to add more commands to view moons close up as we fly by the planets. The script is below. Feel free to make any comments, suggestions, corrections, etc! Use copy/paste to a notepad .txt file and save as .cel. I have mine saved as Voyager 2 Flyby.cel

{

# Script Start ---------------------------------------------------------------------------

# Voyager 2 Flybys by Andr? Smith 11/24-30/2003 Version 2
# Created using screen resolution of 1024 x 768

# Celestia Program by Chris Laurel
# http://ennui.celestiaproject.net/celestia/

# Requires Voyager trajectory xyz files available from "Jack's Celestia Add-ons" web site.
# http://homepage.eircom.net/~jackcelestia/

# Requires Voyager Model produced by Kalaus Gierloff.
# Can be found on Darkmiss site as of November 26,2003
# http://www.bt.homepage.btinternet.co.uk/Celestia.htm

# Stop Time

timerate { rate 0 }

# Preload Textures

preloadtex { object "earth" }
preloadtex { object "jupiter" }
preloadtex { object "saturn" }
preloadtex { object "titan" }
preloadtex { object "uranus" }
preloadtex { object "titania" }
preloadtex { object "neptune" }
preloadtex { object "triton" }

wait { duration 4 }

# Clear Labels, Render Flags and Unmark everything.

labels {clear "galaxies|moons|asteroids|constellations|stars|planets|spacecraft" }
renderflags {clear "stars|galaxies|orbits|constellations|markers|planets|spacecraft"}
unmarkall {}
cancel {}

# Set Field of View and Ambient Light values

set { name "FOV" value 45.0 }
set { name "AmbientLightLevel" value 0.3 }

# Set date to

time { jd 2443376.201389 }

# Select Voyager 2, position to View Earth after Launch and follow Voyager for 20 seconds

select { object "sol/Voyager 2" }
gotolonglat {distance 3 longitude -75 latitude 10 up [0 1 0] time 2}
wait { duration 2 }
follow { }

renderflags { set "planets|spacecraft"}

timerate { rate 1 }

select { object "Earth" }

print { text "Voyager 2 Launch Date - August 20, 1977" origin "left" duration 15 row -12 column 18 }

timerate {rate 2500}

wait { duration 20 }

#--------------------------- On To Jupiter ------------------------------------------

# Turn on Labels, Mark Voyager 2 and Jupiter, Zoom out and speed up timerate.

labels { set "planets" }

select { object "Voyager 2" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 7}
wait { duration 8 }
track {}

orbit { axis [ 1 0 0 ] rate 45 duration 2 }

renderflags { set "orbits|markers" }
labels { set "spacecraft" }

mark { object "Voyager 2" color [1 1 1] symbol "diamond" }
mark { object "Jupiter" color [1 0 0] symbol "square" }

changedistance { duration 6.3 rate 4.0 }

print { text "Timerate 1 Month per second" origin "left" duration 7 row -12 column 18 }

timerate { rate 2592000 }

wait { duration 22.4}

labels {clear "planets|spacecraft" }
renderflags {clear "orbits|markers|planets"}
unmarkall {}

timerate {rate 7500}

# Set date to July 7, 1979, return to Voyager and Track Jupiter for the Flyby

time { jd 2444061.72903 }

select {}
track {}
select { object "Voyager 2" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 1}
wait { duration 1 }
chase {}

select { object "jupiter" }
track {}

renderflags { set "planets"}

print { text "Jupiter Flyby - July 1979" origin "left" duration 25 row -12 column 18 }

wait { duration 35 }

#--------------------------- On To Saturn ------------------------------------------

# Turn on Labels, Mark Voyager 2 and Saturn, Zoom out and speed up timerate.

labels { set "planets" }

select {}
track {}

select { object "Voyager 2" }
gotolonglat {distance 3 longitude 0 latitude 10 up [0 1 0] time 8}
wait { duration 8 }
track {}

orbit { axis [ 1 0 0 ] rate 45 duration 2 }

renderflags { set "orbits|markers" }
labels { set "spacecraft" }

mark { object "Voyager 2" color [1 1 1] symbol "diamond" }
mark { object "saturn" color [1 0 0] symbol "square" }

changedistance { duration 6.3 rate 4.0 }

print { text "Timerate 1 Month per second" origin "left" duration 7 row -12 column 18 }

timerate { rate 2592000 }

wait { duration 25.4}

labels {clear "planets|spacecraft" }
renderflags {clear "orbits|markers|planets"}
unmarkall {}

timerate {rate 7500}

# Set date to August 24, 1981, return to Voyager and Track Saturn for the Flyby

time { jd 2444840.72903 }

select { object "Voyager 2" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 1}
wait { duration 1 }
chase {}

select { object "saturn" }
track {}
lock {}

renderflags { set "planets" }

print { text "Saturn Flyby - August 1981" origin "left" duration 20 row -12 column 18 }

wait { duration 35 }

#--------------------------- On To Uranus ------------------------------------------

# Turn on Labels, Mark Voyager 2 and Uranus, Zoom out and speed up timerate.

labels { set "planets" }

select {}
track {}

select { object "Voyager 2" }
gotolonglat {distance 3 longitude 110 latitude 10 up [0 1 0] time 8}
wait { duration 8 }
track {}

orbit { axis [ 1 0 0 ] rate 45 duration 2 }

renderflags { set "orbits|markers" }
labels { set "spacecraft" }

mark { object "Voyager 2" color [1 1 1] symbol "diamond" }
mark { object "uranus" color [1 0 0] symbol "square" }

changedistance { duration 6.5 rate 4.0 }

print { text "Timerate 1 Month per second" origin "left" duration 7 row -12 column 18 }

timerate { rate 2592000 }

wait { duration 53}

labels {clear "planets|spacecraft" }
renderflags {clear "orbits|markers|planets"}
unmarkall {}

timerate {rate 7500}

# Set date to January 22, 1986, return to Voyager and Track Uranus for the Flyby

time { jd 2446452.72903 }

select { object "Voyager 2" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 1}
wait { duration 1 }
chase {}

select { object "uranus" }
track {}
lock {}

renderflags { set "planets" }

print { text "Uranus Flyby - January 1986" origin "left" duration 25 row -12 column 18 }

wait { duration 35 }

#--------------------------- On To Neptune ------------------------------------------

# Turn on Labels, Mark Voyager 2 and Neptune, Zoom out and speed up timerate.

labels { set "planets" }

select {}
track {}

select { object "Voyager 2" }
gotolonglat {distance 3 longitude 180 latitude 10 up [0 1 0] time 8}
wait { duration 8 }
track {}

orbit { axis [ 1 0 0 ] rate 45 duration 2 }

renderflags { set "orbits|markers" }
labels { set "spacecraft" }

mark { object "Voyager 2" color [1 1 1] symbol "diamond" }
mark { object "neptune" color [1 0 0] symbol "square" }

changedistance { duration 6.5 rate 4.0 }

print { text "Timerate 1 Month per second" origin "left" duration 7 row -2 column 18 }

timerate { rate 2592000 }

wait { duration 42.7}

labels {clear "planets|spacecraft" }
renderflags {clear "orbits|markers|planets"}
unmarkall {}

timerate {rate 3500}

# Set date to August 24, 1989, return to Voyager and Track Neptune for the Flyby

time { jd 2447762.72903 }

select { object "Voyager 2" }
gotolonglat {distance 3 longitude 120 latitude 10 up [0 1 0] time 1}
wait { duration 1 }
chase {}

select { object "neptune" }
track {}
lock {}

renderflags { set "planets" }

print { text "Neptune Flyby - August 1989" origin "left" duration 20 row -12 column 18 }

wait { duration 35 }

#--------------------------- Leaving System ------------------------------------------

select {}
track {}
lock {}

renderflags {set "orbits"}
labels { set "planets|spacecraft" }

select { object "neptune" }

timerate { rate 2592000 }

wait { duration 4 }

print { text "Tour Complete - Leaving System" origin "left" duration 20 row -12 column 18 }

select { object "Voyager 2" }
gotolonglat {distance 5 longitude -160 latitude -15 up [0 1 0] time 3}
wait { duration 3 }
center { time 3 }
wait { duration 3 }
lock { }

select { object "sol" }
center { time 5 }
wait { duration 5 }
lock { }

timerate { rate 25920000 }

wait { duration 15.9 }

timerate {rate 1}

# Set date to November 30, 2003. Turn on Stars and Galaxies. Clear Orbits and Labels

time { jd 2452973.92623 }

renderflags {set "stars|galaxies"}
wait { duration 2 }

renderflags {clear "orbits"}
wait { duration 2 }

labels {clear "planets|spacecraft"}
unmarkall {}
select {}
track {}

select { object "sol" }
wait { duration 4 }

print { text "Returning to Earth" origin "left" duration 7 row -12 column 18 }

select { object "earth" }
goto { time 10 }
wait { duration 10 }

print { text "End of Script" origin "left" duration 4 row -12 column 18 }
wait { duration 4 }

cancel {}

# Script End ---------------------------------------------------------------------------

}

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Re: Thanks Jack!

Post #7by don » 03.12.2003, 14:50

WOW! Very nice scripts Oniisan/Andr?!

I enjoyed them both. :D

I too have the start problem, where it starts with Earth at a distance of 207 au. On my system (3.06 GHz Dell), using large textures, I set the wait time after preloadtex to 10 seconds and it worked fine. So, you might consider changing this time in both scripts (to 10 or 15 seconds), and maybe adding a message before the preloadtex lines that informs the user that textures are being pre-loaded.


Oniisan wrote:I see my pasting of the code also removed the indents I had to make it easier to read.
After you paste your code into the message box, select it and then click the "Code" button above the message box. This will post it in a fixed-pitch font.


Oniisan wrote:At some point I'd like to make the split screens (if it's possible in scripting) and track some of the moons at each flyby.

I don't know of any way to utilize the multiple view function of Celestia in .CEL scripting, so if anyone does, please let us know!

Thanks again for the great new scripts Oniisan!

-Don G.

Topic author
Oniisan
Posts: 16
Joined: 26.11.2003
With us: 20 years 11 months

Thanks Don!

Post #8by Oniisan » 03.12.2003, 19:21

Thanks for the info Don! I used your cel scripting documentation to help figure this all out anyway. I'll have to try that longer wait time during texture preloads. At first I thought it was only happening on my slow system at home, but after running the same script at work on a 1 Ghz Dell it sometimes did the same thing, placed us way out at 207 au's. I made a script of the 2002MN near miss with Earth and it does the same thing, but not always at the same spot?! I made that one to show the same event from 3 different locations, but not all at once (yes I'd love to see multiple screens supported in cel scripting too!). Sometimes it would put us at 207 au's at the beginning, sometimes in the middle or sometimes at the end. Most of the time if I've run the script once or twice it seems to do fine after that.

I'm sure this has also been brought up before too, but will there at some point be any way to control sounds in scripting? I think it would be great to have it play the sounds/radio waves Voyager picked up or even some of the recordings on the disc that was attached to each. I know I could create a sound file and with careful timings have it play at the same time as the script, but then that means we'd have to start the sound file playing then start the script, not the best solution. Having the script control the start/stop of sounds would be much better. Just a wish list I guess :-)

Would also be nice to capture user settings at the beginning of a script and return them at the end, not everyone uses the same prefferences.

Could use an "on cancel goto label" command too so things could be returned to normal if a user cancels a script that has modified their options. In the case of some of my scripts if a user cancels it while the planets, stars, etc are turned off then they are left with a blank screen.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Re: Thanks Don!

Post #9by don » 03.12.2003, 20:05

Oniisan wrote:Thanks for the info Don!
You are welcome.


Oniisan wrote:I used your cel scripting documentation to help figure this all out anyway.
It's nice to know it helps folks <smile>. Thank you. The final version will be out once 1.3.1 is finalized.


Oniisan wrote:I made a script of the 2002MN near miss with Earth and it does the same thing, but not always at the same spot?!
Could texture loading timing be causing that one? Or maybe it's something else?


Oniisan wrote:I made that one to show the same event from 3 different locations, but not all at once (yes I'd love to see multiple screens supported in cel scripting too!).
That sounds like a fun script too <smile>!


Oniisan wrote:... will there at some point be any way to control sounds in scripting?

Aside from music, one could imagine narration along with music <smile>. However, this capability would first need to be developed for Celestia itself. I'm not sure what kind of processing hit Celestia would take, when playing a WAV, MP3, etc. It would probably make slow systems even slower.

Your other ideas are good ones too. Yes, it would be nice to see scripting (probably Lua-based) much enhanced in Celestia, and I'm sure little bits will come with each new release. Especially since Harald is adding some new things to the Lua side of scripting, making it a bit more usable -- thank you Harald <big smile>!

Sticky messages are not available here in the Scripting forum, but if they were, I'd start one for "enhancement requests".

Keep those great scripts coming Oniisan!

-Don G.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #10by don » 03.12.2003, 20:27

A thought just came to me regarding multi-view in scripting ... Christophe was kind enough to recently add several commands to .CEL scripting that allow a Cell://URL as input (see http://ennui.shatters.net/forum/viewtopic.php?t=3800&postdays=0&postorder=asc&start=15). If you can compile the source code from Source Forge, then you can use these commands right now. They don't allow us to control the Multi-View functions, but we can at least display a saved position and setting <smile>.

Hope this helps,

-Don G.

Guest

Re: Thanks Don!

Post #11by Guest » 04.12.2003, 05:35

Oniisan wrote:I made a script of the 2002MN near miss with Earth and it does the same thing, but not always at the same spot?!

Don wrote:Could texture loading timing be causing that one? Or maybe it's something else?

Must be something else I'm missing. I do have a preloadtex at the beginning of that script, but it also happens at other places in the script. Seems to happen after I change the date and/or location, but it's not the same every time. And then there are times when it runs fine, got me stumped.

I tried adding more wait time to the preload textures (as you mentioned) of the voyager scripts and it still starts up 207 au's from earth, in fact even more so now...interesting. Have also tried selecting earth, going to that then starting the script and it once again puts us at 207 au's away...hmmmm. Could it be a bug in version 1.3.1 pre 11 or maybe my script? Anyone else having that same problem with it?

Oniisan wrote:I made that one to show the same event from 3 different locations, but not all at once (yes I'd love to see multiple screens supported in cel scripting too!).

Don wrote:That sounds like a fun script too <smile>!

I'll post it as soon as I'm happy with it :-) It's pretty basic too, nothing fancy.

Don wrote:Aside from music, one could imagine narration along with music <smile>. However, this capability would first need to be developed for Celestia itself. I'm not sure what kind of processing hit Celestia would take, when playing a WAV, MP3, etc. It would probably make slow systems even slower.

Oh yes, narration, music, sound effects, etc! Would be good for educational scripts. Not sure if it would be a big processing hit either, but I can run winamp at the same time as celestia and have it play music while exploring, even on my slow 650 Mhz. Of course I'm not using the 8-32k textures either :-) Tried a test with it playing some music during the voyager flybys and it worked ok. Maybe there could be some way to send commands to a separate player such as winamp or media player, etc.

Don wrote:Your other ideas are good ones too. Yes, it would be nice to see scripting (probably Lua-based) much enhanced in Celestia, and I'm sure little bits will come with each new release. Especially since Harald is adding some new things to the Lua side of scripting, making it a bit more usable -- thank you Harald <big smile>!

Haven't tried LUA yet myself, but it sounds good from what I've seen of it. I'm also sure we'll get more enhanced scripting as time goes on. I've watched Celestia get better with each release.

Don wrote:Keep those great scripts coming Oniisan!


Thanks for the encouragement Don! As a beginner I need it :-) I hope I'll really create a script people can call "great" one day. :-)

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Re: Thanks Don!

Post #12by don » 05.12.2003, 01:25

Oniisan wrote:
Don wrote:Could texture loading timing be causing that one? Or maybe it's something else?
Must be something else I'm missing.
Very strange indeed. When you find out what it is, please let us know if it's something in scripting that needs to be fixed.


Oniisan wrote:Tried a test with it playing some music during the voyager flybys and it worked ok. Maybe there could be some way to send commands to a separate player such as winamp or media player, etc.
Good to know that both can run together <smile>.

I don't know if any players have the ability to receive control commands from other programs, as I'm not a programmer in this regard. I would think that some type of embedded player might need to be used, but I don't know for sure.


Oniisan wrote:Thanks for the encouragement Don! As a beginner I need it :-) I hope I'll really create a script people can call "great" one day. :-)

You're welcome Oniisan. Right now, with Celestia's limited scripting capabilities, I personally think *every* script (that runs) is a GREAT script <big smile>!

-Don G.

RND
Posts: 57
Joined: 21.12.2003
With us: 20 years 10 months
Location: Cambridge, UK
Contact:

Post #13by RND » 21.12.2003, 01:40

Just tried your voyager 2 cel and it came up with the following error: unknown command name 'unmarkall'. Are you scripting for 1.3.1? Im using 1.3.0.
� RND �
Insert RaNDom comment here

Guest

unmarkall error

Post #14by Guest » 21.12.2003, 02:50

Yes, it was written with 1.3.1 pre 11. I don't know what types of problems it may have on the previous versions of Celestia.

Just got my new pc (3.2Ghz, 512mb ram, 160Gb Hd, GeForce 5600) set up and tried Celestia. Looks great! Now I have a reason to download all those high res textures and models :-) Interesting, the script I wrote for the Voyagers still has problems at the beginning. Still putting us at 207 au's from Earth, must be something wrong with my script. Will continue to try fixes and see if I can get it working right.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #15by don » 21.12.2003, 03:18

RND wrote:Just tried your voyager 2 cel and it came up with the following error: unknown command name 'unmarkall'. Are you scripting for 1.3.1? Im using 1.3.0.

Howdy RND,

1.3.1 final is due out any day now.

If you want pre 11 (which is quite stable) you can get it here ...

Direct download link: http://63.224.48.65/celestia/files/celestia-win32-1.3.1pre11.exe (11.7 MB)

Files page link: http://63.224.48.65/celestia/files/

There are indeed some changes between 1.3.0 and 1.3.1 pre 11 scripting. In addition, the final version will have a couple of extra commands for both, .cel and .celx (Lua) scripting.

There is now a complete .CEL Scripting Guide that explains all the commands and parameters here: http://www.donandcarla.com/Celestia/

Happy Holidays!

-Don G.

RND
Posts: 57
Joined: 21.12.2003
With us: 20 years 10 months
Location: Cambridge, UK
Contact:

Post #16by RND » 21.12.2003, 03:45

Thanks Don, downloading update now.

On another note, I am an avid space scene creator (mainly in Bryce) and wonder if its acceptable to get avice for that work here in the relevant thread.
� RND �

Insert RaNDom comment here

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #17by don » 21.12.2003, 07:35

Howdy RaNDom,

8O Wow, I LOVE your ART(wallpaper)WORK! You certainly are one creative and talented person.

It would be great to see some of your work converted to 3ds format (one that Celestia uses) and used as Sci-Fi add-ons for some new worlds. :D

Oh yeah, about your question <smile> ... the Textures and Add-Ons forums are where most of the Celestia artists hang out. I know they use several different tools, but off the top of my head, I'm not sure about Bryce. Never hurts to ask.

Happy Holidays!

-Don G.

RND
Posts: 57
Joined: 21.12.2003
With us: 20 years 10 months
Location: Cambridge, UK
Contact:

Post #18by RND » 21.12.2003, 13:01

Thanks Don for your kind words and Im glad you enjoyed my work. Im currently reworking my Solar System Project and the stumbling blocks are always The Sun and Saturn's rings. Ill ask for help in the other thread as you suggest :)
� RND �

Insert RaNDom comment here

TourqeGlare
Posts: 100
Joined: 07.05.2005
With us: 19 years 6 months
Location: Wherever Vger went

Post #19by TourqeGlare » 31.05.2005, 01:21

Dont mean to gravedig, but I came across this thread for a school project.


I cant get the scripts to work.

When I start them, an error message pops up saying:


'{' Expected at start of script.


... 8O OK, a "{" IS at the begging of the script!
WTF?

I dont know how to be more specific
unless certain questions are asked that I didn't address here.


EDIT:Nevermind...It was saved in the wrong text format...
(Hits self playfully :P )

Margüello
Posts: 5
Joined: 02.05.2005
With us: 19 years 6 months
Location: Pe?±afiel, Spain

Post #20by Margüello » 05.06.2005, 08:41

The scrip file must be saved in utf8 format. I had the same problem two weeks ago. I save the scripts files in format utf8 with the Windows XP Notepad and the error message: ('{' Expected at start of script) come up.
Now I use this program: http://www.flos-freeware.ch/zip/notepad2.zip and everything works correctly.


Return to “Scripting”