Suggested Demo script improvements

All about writing scripts for Celestia in Lua and the .cel system
Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Post #21by Chuft-Captain » 17.09.2006, 09:18

Malenfant wrote:
Chuft-Captain wrote:
Malenfant wrote:...distances are measured in radii...
There's a very good reason for this. It makes script writing easier. (Have another think about it). :wink:

I don't think it does, if you write in km then at least that's the same for all bodies... if you use radii then you never know quite how far you're going to be from the object in km.

I guess it just depends on what you're doing... ;)

All things being equal, the moon at 4.5 radii will subtend the same angle onscreen, as the earth at 4.5 radii... so when writing a script you don't have to be constantly looking up physical details of things, if you want them to appear a certain size on screen, just keep the same radii distant. An experienced script writer would get a feel for this from experience.
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #22by t00fri » 17.09.2006, 10:49

A long time ago, I simply created a scripts directory 'scripts' by hand and put my scripts therein. You may even put your start.cel, start.celx and demo.cel scripts in there, if you adapt celestia.cfg:

Code: Select all

 
 InitScript  "scripts/start.celx"
 DemoScript  "scripts/demo.cel"


Why does one have to have a GUI clicker for everything??

Since there is a 'Open Recent' entry in the menue this acts like a GUI script starter if you use your scripts regularly ;-)


Bye Fridger
Image

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

Post #23by Christophe » 17.09.2006, 12:00

With the current demo script I don't have a problem seing the Earth and the Moon entirely. The thing is that the zoom to fov conversion is system dependent, so there isn't one distance which is right for everyone. There are two solutions to this problem: either set the fov to some value (which will give you a zoom factor != 1), or work out the correct distance from the current fov (which can only be done in celx).

But I think this is a minor issue, the main problem with the demo script is that it doesn't show half the features of Celestia. It was last changed in 2001 for the 1.1.1 release, so none of the features introduced since then are showcased.

I think the new demo script should be done in celx and introduce as many features as possible. It should also restore the state Celestia was in before starting.
Christophe

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #24by ElChristou » 17.09.2006, 12:48

Malenfant wrote:...A nice interface in Celestia to access them wouldn't go amiss either. Maybe that could bring up a separate window (like the Star or Eclipse Finder) that lists the scripts that can be run, along with a brief one line summary (taken from a specific comment line in the script?) saying what the script does.


Completely agree here; I have proposed this very same idea a few months ago to Dirkpitt (for the osX side) but seems we need first to be agree for all platform...
Image

buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 1 month
Location: Massachusetts, USA

Post #25by buggs_moran » 17.09.2006, 14:14

t00fri wrote:Why does one have to have a GUI clicker for everything??

Since there is a 'Open Recent' entry in the menue this acts like a GUI script starter if you use your scripts regularly ;-)

Bye Fridger


I agree with Fridger here. A GUI interface would be nice for new users, but I find it no problem to open a celx script from another window or use the Open Recent.

If anyone were going to spend time on a GUI interface of some kind, it might be nice to have a script maker for new users to click on systems they would like to visit, how long and in what fashion.

The interface would be separate from Celestia and generate a celx script. It could read the ssc and stc files a particular user has in their folders and give them a list of possibilities on places to visit grouped by catagories. The user could define any of the definable parameters in a celx script without having to write their own.

This isn't to say that writing the scripts is overly difficult, but to many of the potential users, the ability to do it quickly, without the learning curve associated with even simple programming would be a benefit.
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M

Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #26by Malenfant » 17.09.2006, 15:28

t00fri wrote:A long time ago, I simply created a scripts directory 'scripts' by hand and put my scripts therein. You may even put your start.cel, start.celx and demo.cel scripts in there, if you adapt celestia.cfg

That's great, but most people wouldn't know that you can do that. If that was set by default so that all versions of Celestia looked in a script folder for scripts, that would be better.

t00fri wrote:Since there is a 'Open Recent' entry in the menue this acts like a GUI script starter if you use your scripts regularly ;-)


I have never seen an "Open Recent" entry in the menu of Celestia, and I don't see one anywhere now either - whenever I run a script it just runs, it doesn't show up anywhere else afterwards (not in the file menu, like recently opened documents would in other programs). Something like that would be useful though. So where is this "Open Recent" thing?!

Nobody has any comments on the modified demo script?
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #27by Cham » 17.09.2006, 15:40

I don't have an "Open Recent" menu either on the OS X version.

If people are concerned about the number of menus on the menu bar (small screen size, for example), we could simply place the scripts menu in the "File" menu, where there already are some options about scripts (Open script, etc...). The script menu could simply be a sub-menu in the File menu, or simply list all the scripts (in the scripts folder) directly at the end of the File menu (that menu is pretty small, right now). I advocate locating the Demo in the File menu also, since it's just a cel file.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #28by selden » 17.09.2006, 16:27

Malenfant wrote:
t00fri wrote:Since there is a 'Open Recent' entry in the menue this acts like a GUI script starter if you use your scripts regularly ;-)

I have never seen an "Open Recent" entry in the menu of Celestia, and I don't see one anywhere now either - whenever I run a script it just runs, it doesn't show up anywhere else afterwards (not in the file menu, like recently opened documents would in other programs). Something like that would be useful though. So where is this "Open Recent" thing?!
I think it's a Linux-only option, maybe KDE specific?

Nobody has any comments on the modified demo script?
I think it got lost in the flurry of other comments.

I just tried it. It seems reasonable, but has a few flaws. The one I noticed in particular is that it does not set the "Magnitude Limit" value. I happened to have it turned all the way up and couldn't recognize most of the constellations. Their lines and names were buried among the stars.

I noticed that the plane of the Milky way wasn't centered while traversing it. I think it'd help if it were.

It'd be nice, I think, to turn off the star labels while mentioning the constellation names. The star and constellation name colors are very similar and there are many star names on the screen, making it hard to pick out the constellation names.
Selden

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Post #29by Chuft-Captain » 17.09.2006, 16:32

Why does one have to have a GUI clicker for everything??

I agree with Fridger on this occasion. A GUI is probably going to interfere with the ability for the user to organise their scripts in their own way. For example Fridger has a top-level scripts directory. I have the same where I have demo.cel etc, but I also like to organise scripts associated with specific addons in a sub-directory (named "scripts" strangely enough) of the actual addon directory. This is important because 2 different addon creators might create a script to demo their addon, and both may call it "demo.cel". Now these are best to reside in their own subdirectory to avoid 1. overwriting the default demo.cel, and 2. to avoid name conflicts with each other.
I would reccomend that addon creators distribute scripts (if they have any) in a "scripts" sub-folder (at same level as the "models" folder).

JM2CW
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

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

Post #30by hank » 17.09.2006, 16:32

Personally, I'd like to see Celestia support a user-configurable cross-platform UI. Some recent experiments suggest this might be possible using Lua.

- Hank

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #31by Cham » 17.09.2006, 16:39

Chuft-Captain wrote:addons in a sub-directory (named "scripts" strangely enough) of the actual addon directory. This is important because 2 different addon creators mightJM2CW


What I'm suggesting is compatible with this : all the scripts folder could be shown in the "File" menu of Celestia, with sub-menus associated to your sub-folders included in the "Scripts" folder. Of course, if an addon contains some scripts, you'll have to put them in your "general" scripts folders, with sub-folders if you wish.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #32by Malenfant » 17.09.2006, 16:50

selden wrote:I just tried it. It seems reasonable, but has a few flaws.

Well, it was just a quick and nasty fix to the things that were bugging me ;).

The one I noticed in particular is that it does not set the "Magnitude Limit" value. I happened to have it turned all the way up and couldn't recognize most of the constellations. Their lines and names were buried among the stars.

OK... I can see if I can fix that.

One thing I can't seem to get rid of is the orbits when it starts. I have renderflags set to clear the orbits at the start, but when I go to Earth, I still see an orbit going through it. Unless that's a bug with the 1.5.0 exe I have.


I noticed that the plane of the Milky way wasn't centered while traversing it. I think it'd help if it were.

Yeah, I got it close but have no idea how to get it actually centred.

It'd be nice, I think, to turn off the star labels while mentioning the constellation names. The star and constellation name colors are very similar and there are many star names on the screen, making it hard to pick out the constellation names.


I didn't even realise the star names were on! Not that there's a lot of star names anyway... there's just that short list in the cfg isn't there?
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Post #33by Chuft-Captain » 17.09.2006, 16:56

Cham wrote:
Chuft-Captain wrote:addons in a sub-directory (named "scripts" strangely enough) of the actual addon directory. This is important because 2 different addon creators mightJM2CW

What I'm suggesting is compatible with this : all the scripts folder could be shown in the "File" menu of Celestia, with sub-menus associated to your sub-folders included in the "Scripts" folder. Of course, if an addon contains some scripts, you'll have to put them in your "general" scripts folders, with sub-folders if you wish.
I don't want to have to drag scripts folders around everytime I install or re-install an addon. I like everything to be self-contained and installed the way the designer intended. Also makes for easier upgrades.
I'd rather see an ADDON menu, which would perhaps allow enabling/disabling of addons, as well as access to a scripts sub-directory to run any scripts included with the addon. (I think however this is likely to be something for 1.6.0 or later)

Hank wrote:Personally, I'd like to see Celestia support a user-configurable cross-platform UI. Some recent experiments suggest this might be possible using Lua
LUA = Lets the User do Anything. :lol:
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #34by selden » 17.09.2006, 18:13

Malenfant wrote:One thing I can't seem to get rid of is the orbits when it starts. I have renderflags set to clear the orbits at the start, but when I go to Earth, I still see an orbit going through it. Unless that's a bug with the 1.5.0 exe I have.
It's a bug in the version you have. It's fixed in later cvs code.
I noticed that the plane of the Milky way wasn't centered while traversing it. I think it'd help if it were.

Yeah, I got it close but have no idea how to get it actually centred.
Selecting Milky Way and then centering it should work :)

It'd be nice, I think, to turn off the star labels while mentioning the constellation names. The star and constellation name colors are very similar and there are many star names on the screen, making it hard to pick out the constellation names.

I didn't even realise the star names were on! Not that there's a lot of star names anyway... there's just that short list in the cfg isn't there?

It's been made more generalized in v1.5 as I recall. Unfortunately, I forgot to make a note of the details :( I'll have to try to find them...

but there were enough on the screen that I couldn't easily pick out the constellation names.
Selden

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

Post #35by hank » 17.09.2006, 18:45

Chuft-Captain wrote:
Hank wrote:Personally, I'd like to see Celestia support a user-configurable cross-platform UI. Some recent experiments suggest this might be possible using Lua
LUA = Lets the User do Anything. :lol:

I like it!

Seriously, there are two significant benefits from a user-configurable GUI. First, it makes it unnecessary for users to agree (or have endless debates) about the GUI design. If someone doesn't like the way it works, they can change it to suit themselves. One size doesn't have to fit all. Second, it allows prototyping of proposed alternatives. People often change their minds after they actually try something.

- Hank
(Resident Lua-natic)

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #36by selden » 17.09.2006, 19:39

A fully configurable user interface does have one major problem: when naive users report problems with whichever interface they're using, very few people will be willing/able to help if that interface's author is unreachable.

"It doesn't work like that for me!!!"
will be a common complaint.

I think there would have to be at least one such interface that is formally supported by a Celestia developer.

The major advantage that I see is that, like all Lua/Celx code, no development software would be required other than Celestia itself. It might be reasonable to consider including a Lua IDE with Celestia, however.
Selden

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #37by dirkpitt » 18.09.2006, 01:15

From my experience using Maya, user configurable interfaces can definitely be a big win. However, like many "cross-platform" GUI attempts (e.g., Java Swing, Qt), what looks great on one platform has a regular tendency to end up looking weird on other platforms. I'd advocate limiting this reconfigurability to just the menus because of this issue.

Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #38by Malenfant » 18.09.2006, 01:52

selden wrote:Selecting Milky Way and then centering it should work :)


Duh. Why didn't I think of that ;). (I did that at the end though!). That said, how can you actually pan around the sky and follow the milky way? Centering it won't be much use on its own.

Though it's odd, I can't get star labels to even turn on so I can see what they look like - I've got the star label checkbox ticked in the Render Options, and I can see Stars, so what else do I need to do?
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #39by selden » 18.09.2006, 09:46

Malenfant wrote:
selden wrote:Selecting Milky Way and then centering it should work :)

Duh. Why didn't I think of that ;). (I did that at the end though!). That said, how can you actually pan around the sky and follow the milky way? Centering it won't be much use on its own.
I'm sure there's a way... For example, you should be able to specify a coordinate system centered on the selected body, change the viewpoint orientation to be parallel to its Y axis and then rotate the viewpoint. (but that's somewhat dull) In principle you should be able to tilt the viewpoint at an arbitrary angle relative to the selected object's coordinate system and then rotate the viewpoint around a different arbitrary axis, but the math for that is beyond me right now.

Though it's odd, I can't get star labels to even turn on so I can see what they look like - I've got the star label checkbox ticked in the Render Options, and I can see Stars, so what else do I need to do?
Now I can't get them to turn on, either. I checkmarked all the options in the Render/View Options panel. The new star labelling code obviously has bugs :( (I didn't try to specify "label stars" in a script, though.)

But that brings up another question: how many of the rendering options should the demo script specify or demonstrate? The display looks quite different depending on which options happen to be enabled when the Demo starts.
Selden


Return to “Scripting”