'Space Opera' script

All about writing scripts for Celestia in Lua and the .cel system
Topic author
AuReality
Posts: 45
Joined: 05.12.2003
With us: 20 years 11 months
Location: Groningen, The Netherlands

'Space Opera' script

Post #1by AuReality » 10.01.2004, 14:32

I have written my first Celestia script, a small 'Space Opera'.
You can find it at my website (sorry, I do not have custom Celestia pages yet)

The script will take you from outside the Milky Way to the solar system.
In the solar sytem the nine planets are visited.
The script ends with zooming out the solar system and leaving the Milky Way at the opposite side.

With 25 minutes it is a rather lengthy script. Therefore I have also cut it in three parts that can be run separately.
All scripts are available as versions with and without informative text.

I have tried to build in many variations.
For example, for Jupiter there is a 'moonhopping' script, at Mercury you will see a double sunrise, and for Earth there are three scenario's.

The scripts have been developed in version 1.3.1 but are also tested for 1.3.1. pre 11. For ealier versions I can not guarantee compatibility.

All feedback is welcome.

Paul
(p.a.m.swennenhuis@eccoo.rug.nl)

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

Re: 'Space Opera' script

Post #2by Harry » 10.01.2004, 17:50

AuReality wrote:I have written my first Celestia script, a small 'Space Opera'.


Wow 8O It's great! You must have done an amazing amount of tweaking to get that worked out... Really nice :)

A minor remark (I have to write something, right?):
- the phase before going to pluto is a bit rough (orbits switched off and on again) and has no explanation. Could you add some text there?

Oh, and could you reset the timescale at the end? I'm not sure if all users know how to reset it to 1 ;)

Thanks a lot for your script!

Harald

Topic author
AuReality
Posts: 45
Joined: 05.12.2003
With us: 20 years 11 months
Location: Groningen, The Netherlands

Re: 'Space Opera' script

Post #3by AuReality » 10.01.2004, 18:09

Harry wrote:Wow 8O It's great! You must have done an amazing amount of tweaking to get that worked out... Really nice :)
Thanks Harald.
And yes, it was a lot of tweaking. And time-consuming since you have to play the script over and over again when you make changes :)
But I learned a lot about the commands while working on it.

A minor remark (I have to write something, right?):
- the phase before going to pluto is a bit rough (orbits switched off and on again) and has no explanation. Could you add some text there?
You are right Harald. This part must have remained there as result of splitting the file in 3 parts. I will correct it.

Oh, and could you reset the timescale at the end? I'm not sure if all users know how to reset it to 1 ;)

Also a good point. Of course more settings are changed in the script.
Too bad you can't store the current settings when starting the script and then reset them when it is finished...
Anyway, I will add the timerate reset.

Thanks for your comments.

Paul

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

Re: 'Space Opera' script

Post #4by Harry » 10.01.2004, 19:58

AuReality wrote:Also a good point. Of course more settings are changed in the script.
Too bad you can't store the current settings when starting the script and then reset them when it is finished...

Time for a little advertisement: Lua-scripting can do this partially already, and will hopefully be able to do it reliable for all settings soon. :D

Harald

Topic author
AuReality
Posts: 45
Joined: 05.12.2003
With us: 20 years 11 months
Location: Groningen, The Netherlands

Re: 'Space Opera' script

Post #5by AuReality » 10.01.2004, 20:28

Harry wrote:Time for a little advertisement: Lua-scripting can do this partially already, and will hopefully be able to do it reliable for all settings soon. :D

Harald

I do intend to change over to Lua.
However, until recently Lua was neither very reliable nor complete, and I was already well on my way with the Space Opera script when the Celestia version with Lua support was released.

Paul

Matt

Sounds?

Post #6by Matt » 27.01.2004, 00:28

Greetings,
I'm planning on using the Space Opera script in a planetarium show for some home schoolers.. but I'd like to narrate instead of the text.. is there anyway to make the scripts play .wav or .mp3 files? or do I just need to narrate the text into a large .wav and play it in the background?

Topic author
AuReality
Posts: 45
Joined: 05.12.2003
With us: 20 years 11 months
Location: Groningen, The Netherlands

Re: Sounds?

Post #7by AuReality » 27.01.2004, 09:17

Matt wrote:Greetings,
I'm planning on using the Space Opera script in a planetarium show for some home schoolers..
Well thanks Matt, I feel honoured..
Matt wrote:but I'd like to narrate instead of the text.. is there anyway to make the scripts play .wav or .mp3 files? or do I just need to narrate the text into a large .wav and play it in the background?

Unfortunately the script language does not allow execution of external programs, so yes, you will have to play the audio in the background. To ensure better synchronization you could consider a batch file that opens the CEL script and then starts playing the WAV file, or vice versa.

Paul

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

Re: Sounds?

Post #8by Harry » 27.01.2004, 15:33

AuReality wrote:Unfortunately the script language does not allow execution of external programs

I consider this a good thing. While I agree this would offer some nice possibilites, I would be very worried if any script could execute external programs. Same goes for file Input/Output.

Adding commands for execution of external programs would be a trivial one-line change for Lua-scripting, see the chapter "5.7 Operating System Facilities" in the Lua reference manual - but I am not sure if this includes asynchronous execution.

Harald

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

Re: Sounds?

Post #9by don » 27.01.2004, 20:23

Harry wrote:... I would be very worried if any script could execute external programs. Same goes for file Input/Output.

I agree, wholeheartedly!

Does the text "Your disk drive has now been erased ..." come to mind?

It's called a virus <frown>.

Matt

Post #10by Matt » 28.01.2004, 17:34

hehe.. I didn't say launch a program just play a wav file =)

anywhoo..

Does anyone know why when I add rings to Jupiter it now seems that the 'tour' of jupiter is not working correctly? The moons seem to be off center and sometimes are hardly able to be seen. If I recall the first time I ran this thing the moons basically covered the screen.

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

Post #11by Bob Hegwood » 28.01.2004, 19:11

Matt,

I already replied to your e-mail, but your message here makes it sound as though maybe your Field of View settings are different from the settings that my JupiterTour sets.

I set mine up so that the scripts work on an 800 x 600 display. Are you using a different (maybe larger) display? This may account for why your moons are no longer visible. If this is the case, simpy change your FOV settings either in the script, or while in Celestia itself.

If you want to see if this is the problem, simply run your script (The one that doesn't display the moons properly) and press the . (period) button to see if this helps. The period will widen your field of view, and the , (comma) will narrow it.

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

Matt

Post #12by Matt » 28.01.2004, 22:26

Hrmm... I'm also running at 800x600...

what I did notice.. however.. is that in the beginning the SM and the LM galaxies seem to be smacked togethor more then they used to be... only thing I've done is ALT-ENTER to run in full screen...
could this cause a problem?

Matt

Post #13by Matt » 28.01.2004, 22:30

Does your script setup the FOV at the beginning? because now that you meantion it it does sound like I have a field of view issue different then what was intended...

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

Post #14by don » 29.01.2004, 02:14

Matt wrote:hehe.. I didn't say launch a program just play a wav file =)

Well, the easiest (and least code) would be to launch the default player for the selected file type. In order to play various formats (WAV, MP3, etc.) would require a whole new library of code be added to Celestia. The tough part might be finding a cross-platform library to do this. Then again, folks here love to prove me wrong, so maybe Chris will just whip one up tonight. :lol:

Cheers,

-Don G.

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

Post #15by Bob Hegwood » 29.01.2004, 04:12

Matt wrote:Does your script setup the FOV at the beginning? because now that you meantion it it does sound like I have a field of view issue different then what was intended...


Yes, it does Matt...

Simply use Notepad to have a look at the script and you'll see the following:

# Set Field of View (Celestia 1.3.1 dflt = 25)...
set { name "FOV" value 35.0}

If you don't like this setting, you can easily change it to whatever you want. Just change the value from 35.0 to whatever works best for you.

If you like, you can also add/change your FOV value in Celestia's start.cel so that your display is always setup where you want it.

Hope that helps.

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


Return to “Scripting”