Script: the nine planets

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Script: the nine planets

Post #1by Harry » 18.02.2004, 00:42

Hi,

I've written a script which uses some of the new CELX-features available in Celestia 1.3.2pre1 or newer, notably MultiViews. It's short (~ two minutes), not a tour.

Have a look:
http://www.h-schmidt.net/celestia/nineplanets_v1.0.celx

(please report problems and bugs, but make sure you are using Celestia 1.3.2pre1)

If somebody cares about what new features are used:
- MultiViews
- table-based renderflag and location labels get/set
- the really overdue gotodistance, as well as getfov and preloadtexture
- Cleanup Callback (should avoid changing your settings when you run the script)

Harald

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

Post #2by Bob Hegwood » 18.02.2004, 04:29

Harry,

Cool script. 8)

Just so you know about though... It caused my Intel graphics display to go Blooey! All kinds of neat colors for stars and planets.

That's just because my graphics are limited though. It really is a cool script.

Thanks for the "I'll show you!" :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

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #3by chris » 18.02.2004, 09:35

Cool! That's the first time I've seen your multiview script functions in action, and I'm very impressed. Great work! I like the new table-based method of setting render flags . . . I think it's much more in the spirit of the Lua language.

--Chris

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

Post #4by JackHiggins » 18.02.2004, 19:27

I'm not usually big into scripts, but as an example of what celx can do, this one is pretty good!
- Jack Higgins
Jack's Celestia Add-ons
And visit my Celestia Gallery too!

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

Re: Script: the nine planets

Post #5by don » 19.02.2004, 02:12

Harry wrote:If somebody cares about what new features are used:
- MultiViews
- table-based renderflag and location labels get/set
- the really overdue gotodistance, as well as getfov and preloadtexture
- Cleanup Callback (should avoid changing your settings when you run the script)

EXCELLENT MultiView script Harald! :D

It shows off the new features in Celx quite nicely. 8O

I especially like the Cleanup Callback. Sure wish CEL and cel://urls had this.

Tested with 1.3.2 p1, as I've not been able to get Chris' second p2 version from shatters.net. It is very slooooow and then at 7MB or 8MB it thinks the download is "complete" <sigh>. I'll get it eventually. Is the link on your site to the first or second release of pre2?

Thanks for sharing this script with us Harald!

Cheers,

-Don G.

ADDED LATER ... Seems to work fine in pre2 as well -- both on WinXP.

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

Re: Script: the nine planets

Post #6by Harry » 19.02.2004, 14:47

Thanks for the "thumbs-up"! 8)

Chris, I am glad you like the table-based getrenderflags. While it adds to the bloat I thought this would be the best solution for having a pair of get/set methods for renderflags.

Harald

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Re: Script: the nine planets

Post #7by Christophe » 19.02.2004, 16:28

don wrote:I especially like the Cleanup Callback. Sure wish CEL and cel://urls had this.


cel:// urls do have it, the 'setting' mode was introduced just for that.

The problem is that there is no way to use those from the Windows interface, the best way for now is simply to use a 'location' with your preferred settings.
Christophe

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

Re: Script: the nine planets

Post #8by don » 19.02.2004, 19:24

Christophe wrote:cel:// urls do have it, the 'setting' mode was introduced just for that.

The problem is that there is no way to use those from the Windows interface, the best way for now is simply to use a 'location' with your preferred settings.

Isn't this a KDE-only feature? Or is it also in the GTK version?

-Don G.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #9by Christophe » 20.02.2004, 08:40

Since Pat is trying to keep the GTK version as close as possible to the Windows version, I think it's only available in KDE.

To take full advantage of it, you'd need to replace locations with cel:// url bookmarks as it is done for KDE.
Christophe

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

Post #10by don » 20.02.2004, 19:00

Okay, now I remember -- KDEs built-in bookmark stuff. Sorry, my memory just isn't what it used to be <frown>.

Thanks Christophe.

-Don G.

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Re: Script: the nine planets

Post #11by ANDREA » 14.11.2004, 16:46

Harry wrote:Hi, I've written a script which uses some of the new CELX-features available in Celestia 1.3.2pre1 or newer, notably MultiViews. It's short (~ two minutes), not a tour. Harald

Hello Harald, I enjoyed your tour when issued, but I didn't use it for public shows up to now. :?
I've decided to do it, but for this I should need some change, i.e.:
1- at the end of the script I would like to have ALL the nine windows open and available, in order to have the possibility to make operations on the single planets (e.g. turn one planet to have its sunlight side on view, etcetera) :wink:
2- I would like to start it from an icon on desktop, and with full screen at my screen resolution (1024x768), but the system used for .cel scripts (spacespace--fullscreen in WIN XP) doesn't work. :cry:
Any other solution? 8O
Thanks a lot for your help.
By

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

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

Re: Script: the nine planets

Post #12by Harry » 14.11.2004, 19:03

ANDREA wrote:1- at the end of the script I would like to have ALL the nine windows open and available, in order to have the possibility to make operations on the single planets (e.g. turn one planet to have its sunlight side on view, etcetera) :wink:
Just delete the block (about 10 lines) at the end of the script, i.e. everything below

Code: Select all

celestia:print("Enough!", 2, 0, 0, -2, -2)
.
Does this do what you want?

Note that the script also resets renderflags, time etc. to the setting before the script started. If you don't want that, simply delete the function "celestia_cleanup_callback" at the top of the script.

2- I would like to start it from an icon on desktop, and with full screen at my screen resolution (1024x768), but the system used for .cel scripts (spacespace--fullscreen in WIN XP) doesn't work. :cry:
Any other solution? 8O

What happens when you try it?

If it doesn't work, you could try to start the script by replacing the "start.cel" in celestia.cfg with the path to the nineplanets.celx script, i.e. use it as the start-script.

Harald

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Re: Script: the nine planets

Post #13by ANDREA » 14.11.2004, 23:18

Harry wrote:
ANDREA wrote:1- at the end of the script I would like to have ALL the nine windows open and available, in order to have the possibility to make operations on the single planets (e.g. turn one planet to have its sunlight side on view, etcetera) :wink:
Just delete the block (about 10 lines) at the end of the script, i.e. everything below

Code: Select all

celestia:print("Enough!", 2, 0, 0, -2, -2)
.Does this do what you want? Note that the script also resets renderflags, time etc. to the setting before the script started. If you don't want that, simply delete the function "celestia_cleanup_callback" at the top of the script.
What happens when you try it? If it doesn't work, you could try to start the script by replacing the "start.cel" in celestia.cfg with the path to the nineplanets.celx script, i.e. use it as the start-script. Harald

Hello harald, thanks for the quick reply. :D
I modified the script, and now it works as I need, appreciated. :wink:
Regarding the display mode, you gave me the idea, and I applied it on the contrary, i.e. I named in the .cfg file the "InitScript" as "start.celx" instead od "start,cel", and in the desktop icon I gave the command as usual, i.e.
E:\CelestiaNinePlanetsTour\celestia.exe --fullscreen 8O
It works, and now the script starts with full screen at 1024x768 resolution. :D
Thank you very much.
By

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO


Return to “Scripting”