Page 1 of 2

Just thought I'd ask!

Posted: 09.03.2004, 04:25
by Bob Hegwood
Sorry, but does anyone have any interest in new cel scripts? I know you all are having wet dreams with celx, but I simply don't like the damned things thus far.

I'd like to be able to continue writing more of my touring scripts, but if no one wants them, I'm not going to waste my time. Wanted to do Neptune and Uranus next. Yes? No?

Just thought I'd ask.

Thanks, Bob

Posted: 09.03.2004, 06:15
by don
Bob,

Your tour scripts are EXCELLENT, and there is no reason to "throw in the towel".

It really doesn't matter which of the Celestia scripting languages a person uses, as long as it meets their needs. The end-user (viewer) could care less whether it's a Cel or Celx script, as long as they are entertained / educated. See what I mean?

Celx scripting doesn't replace Cel scripts. Rather, it goes above and beyond Cel by using a third-party, full-blown, object-oriented type of language plug-in (Lua). Cel is fairly straight forward and simple to grasp the basics (with a guide) for most non-programmers. Celx, on the other hand, is easy only if a person has experience in the world of OOP. Ollie Oop maybe? :lol:

The decision as to which scripting language to use is based primarily on a person's experience, either as a script writer, or as an OO programmer. So, pick the one you LIKE and use it. :D

Chris wrote in the past that new additions to Cel scripting will be limited, but that Celx additions will continue. Not sure why this is, because Cel is much easier for non-programmers to understand and use. We'll see as time goes on.

Maybe Harald will come up with a way to allow each language to call the other language. By doing this, Celx gurus could write Celx scripts as functions to be called from a Cel script.

Keep those tour scripts comin' Bob! :D

Cheers,

-Don G.

Posted: 09.03.2004, 06:52
by Bob Hegwood
Appreciate the moral support, Don...

You know, I have experimented with the celx scripts, and I've downloaded over 15 of them altogether just to see what all the fuss is about. I see that you can do some really spectacular and sexy graphics-type thingys with them, but I have yet to find one that performs as expected. Again, the only celx scripts I have downloaded which actually did what I thought they'd do are yours.

I expect a script to educate me in some manner, not to wow me with the very latest in technology. Oh well, I'm just an old geezer, so this is to be expected I guess. At any rate, I'm still playing with celx. I'd much rather be providing some more tours though.

Anybody else?

Thanks, Bob

Posted: 09.03.2004, 07:08
by don
Bob Hegwood wrote:Appreciate the moral support, Don...
You are quite welcome Bob. I'm sure there are other Cel script-writers that feel just like you do. I'm no expert so I too have to learn Lua/celx one method (function) at a time. It takes time.


Bob Hegwood wrote:Anybody else?

If you keep stats on your web site activity, check the number of times your tour script files have been downloaded. LOTS of people actively seek and download new materials, but simply do not post to the forums.

Cheers!

-Don G.

Posted: 09.03.2004, 10:59
by Harry
don wrote:Maybe Harald will come up with a way to allow each language to call the other language. By doing this, Celx gurus could write Celx scripts as functions to be called from a Cel script.

Argh. I really looked for a technical reasons why this couldn't work. But oh horror: it does work. And as Bob already threatened to kill me, I had to do something, right?

Great, it's possible (currently for me only) to execute CEL-scripts within CELX-scripts. To be more precise: it's possible to execute any string which contains a valid CEL-script in Lua. You can even execute two (or three, four, ...) CEL-scripts at the same time. What a mess.

But wait, what would you want to do with it? This won't bring Keyboard-input or MultiViews to CEL :( It may be nice for those who already know CEL, but it does not really add functionality.

How it works:

Code: Select all

cel_source = [[
{ ... }
]]
script = celestia:createcelscript(cel_source)
while script:tick() do
  wait(0)
end

First you need a string (here: "cel_source") which contains the sourcecode of the CEL-script. Then you create a script from it, by calling celestia:createcelscript( ... ).
Then you can pass control to this script (script:tick() ), which will then do whatever it should have done in the time that has passed since you last called script:tick(). I.e. if the script would run a minute, and you wait a minute until you call tick(), the script will instantly reach it's end - so you better call tick() often, like for every frame (which is what Celestia does internally).
script:tick() will return true as long as it's running, and false once it has reached it's end.

Harald

Added Later: The code will for some time not be in CVS, I will wait until the discussion about background-scripts has come to some conclusion (changes are currently mixed).

Posted: 09.03.2004, 12:54
by MB
Bob,
I learned a lot with your script. I can only repeat the comment of Don. They are EXCELLENT. Please Go On,
I also wrote Cel and CELX scripts (With the help of Harry!) concerning the Galileo trip. I also agree with your feeling and the comments of Don.

So please Go on!
MB

Posted: 09.03.2004, 13:16
by jestr
Yeah,please keep the scripts coming Bob they are really cool,Jestr

Posted: 09.03.2004, 18:00
by Bob Hegwood
Jestr, MB...

Thanks for the comments. I like creating the tours, but if no one wanted them, there wouldn't be much point. :wink:

Take care, Bob

Posted: 10.03.2004, 06:04
by don
Sorry guys ... spent the day in town today. So, I'm just catching up now...

Harry wrote:Great, it's possible (currently for me only) to execute CEL-scripts within CELX-scripts.
Good work Harald! Glad to know you can get it working in this direction (run cel from celx).

Have you played with the other direction at all -- running a celx script from cel? I think this would be the most-used direction, as noted in an earlier message.


Harry wrote:But wait, what would you want to do with it?
One thing that comes immediately to mind ... This direction (run cel from celx) will allow folks to create a celx menu of existing cel scripts that can be run at the press of a button -- without having to re-write the cel scripts in celx.


Harry wrote:How it works:
Looks clean and simple, thank you Harald! :D


Harry wrote:The code will for some time not be in CVS, I will wait until the discussion about background-scripts has come to some conclusion (changes are currently mixed).

Agreed. It is good to look at and play with different variations, to find what will be the safest, quickest running, most robust, etc. -- within Chris' specified constraints.

Cheers,

-Don G.

Posted: 10.03.2004, 06:08
by don
Bob Hegwood wrote:I like creating the tours, but if no one wanted them, there wouldn't be much point. :wink:

Now you know there are at least three forum members who ENJOY your scripts Bob! :lol: ... But, as we all know, the REAL number is probably in the hundreds or thousands.

So ... when were you planning on releasing that Uranus tour? Or was it Neptune, my old mind forgets? :wink:

-Don G.

Posted: 10.03.2004, 06:15
by Bob Hegwood
don wrote:So ... when were you planning on releasing that Uranus tour? Or was it Neptune, my old mind forgets? :wink:


Started the basic research and a preliminary script for Neptune yesterday. Already run into a snag though. Seems that Neptune no longer has a Great Dark Spot... After looking for different textures, I found that we're pretty much stuck with the one we have.

Sooo... I'm thinking that I'll keep the texture as it is, and just provide an explanation to the effect that it's no longer there.

I've been researching this topic all day now. Fun stuff. :wink:

I am still surprised that no one has mentioned this before. Especially since the scientists on the forum almost certainly know that the GDS is no longer there. Where is the outcry? :lol:

Seems that you can "fake" it when it's convenient eh?

Take care, Bob

Posted: 10.03.2004, 07:21
by Harry
I am surprised there is any doubt about this, so:
I too like your scripts, Bob! And I really don't mind if they aren't written in Lua. :D

Harald

Posted: 10.03.2004, 07:44
by Harry
don wrote:Have you played with the other direction at all -- running a celx script from cel? I think this would be the most-used direction, as noted in an earlier message.

I tried to point out (must have been in some other thread) that this actually isn't needed. Say you have this CEL-script, and want to wait for a keypress after the first goto by calling some CELX-code:

Code: Select all

{
        select { object "Io" }
        goto { time 5 }
        celx { "---> Wait for keypress (Lua code)  <---" }

        select { object "Earth" }
        goto { time 5 }
        ....

It's IMHO trivial to rewrite this as:

Code: Select all

function CEL(str) { something copy & pasted }
CEL([[
{
        select { object "Io" }
        goto { time 5 }
}
]])
        ---> Wait for keypress (Lua code) <---
CEL([[
{
        select { object "Earth" }
        goto { time 5 }
        ....
]])

I know it doesn't look quite as nice. But once you try to add Lua-code within a string in a CEL-script this could quickly change.

And I just noticed there would be a serious problem: keyboard-input wouldn't work at all, because Celestia would only know it's currently executing a CEL-script (which doesn't use keyboard-input), and doesn't know there is a CELX-script hidden inside which is actually interested in keypresses.

Harald

Posted: 10.03.2004, 08:16
by don
Hi Harald,

Let's just use the other thread / topic for this discussion about calling cel from celx and celx from cel, so we don't double-post. :)

-Don G.

Posted: 10.03.2004, 08:20
by don
Bob Hegwood wrote:Started the basic research and a preliminary script for Neptune yesterday. Already run into a snag though. Seems that Neptune no longer has a Great Dark Spot...

Say what?! 8O ... Where did it go? The storm just plain stopped? Or maybe it was a smudge on someone's telescope lens all along? :lol:

I'm amazed that both Fridger and Grant missed this one.

When did it go away?

You are quite the explorer / researcher Bob! :D

-Don G.

Posted: 10.03.2004, 08:32
by Guest
don wrote:Where did it go? The storm just plain stopped? Or maybe it was a smudge on someone's telescope lens all along? :lol:

I'm amazed that both Fridger and Grant missed this one.

When did it go away?

You are quite the explorer / researcher Bob! :D

Has been missing from Neptune since 1994. During that year, the HST was used to do a thorough search of Neptune, and the Great Dark Spot was no longer on its surface. :wink:

How about that. You mean us dummies know something that the scientists don't? :lol: I doubt that. Probably it was just more convenient to not mention it, because of the reasons I have identified earlier. Apparently, Neptune likes to change its face frequently.

Take care, Bob

Posted: 10.03.2004, 08:41
by don
It's been gone for TEN YEARS?

Amazing.

Posted: 10.03.2004, 08:54
by don
One reason why the existing texture is being used ... to replay the Voyager encounter ...

http://shatters.net/forum/viewtopic.php?t=1583

-Don G.

Posted: 10.03.2004, 14:06
by Toti
Bob:
I enjoy your scripts, too. Please, keep making them.
But now that you ask, I think that you should take a look at the new Lua scripting support. Harald's work is impressive, and it will make your job easier.
I know cel scripting is tedious: you need to adjust delays so the text messages doesn't dissapear out of time, but taking care of overall script lenght, tweaking the viewer's movements so they flow smoothly, etc. In short words, a lot of trial and error testing.
With Lua, instead, you can define:
    * a constant, let's say SECONDS_PER_CHARACTER = 0.5
    * a function that takes one of your text messages and counts its characters. Then multiplies this number by the constant that you already defined and saves into a variable, say 'delaytime'
    * a function that takes your text message and the variable 'delaytime' and prints it on screen and waits 'delaytime' seconds
This way longer messages will have more time on screen than shorter ones, but without annoying manual tweaking. As you see, thanks to a few lines of code, the computer does all the job, and you are free of one boring, trial-and-error task. If you notice that the script is too fast, you only need to change SECOND_PER_CHARACTER value to, let's say 0.6
Another example:
You can define a simple structure:
    body, lat., long., altitude, message

And then fill this structure with data, regarding interesting features for certain bodies:

Code: Select all

Mars         56.875       43.893         1232          "look at this..."
Enceladus    23.234       12.192         589           "look at that..."
...
...
...

And then, using a function (that you need to define) make a tour to all this bodies, showing the interesting features specified on the list, and displaying the corresponding messages.
This function can be as complex as you want: it can do smooth, elegant moves when going from one location to another, it can signal the specified location with intermittent markers, etc.
Note how simple is to add a new location to this script: one more entry:

Code: Select all

Europa       22.773      43.761          786           "look at those..."

..and that's all.
Even more, you can add code to split the text message into small pieces, so it doesn't get cut by screen limits, etc.
As you see, a lot of added functionality. (Please note that this examples might need some extra Lua internal support within Celestia that might be not present today. Harald has the knowledge here)

Of course, learning a programming language is not an easy task, but there should be a beginner's scripting guide out there.
Anyway, keep the good job! :)

Bye

Posted: 11.03.2004, 03:01
by Bob Hegwood
Toti wrote:Bob:
I enjoy your scripts, too. Please, keep making them.
But now that you ask, I think that you should take a look at the new Lua scripting support.

Toti,

I have looked at celx and all it's done so far is give me a headache! :oops:

Hell, I can't even concentrate on your message long enough to understand what you're even trying to tell me. I just plain-old don't like celx. What can I tell ya? When you start defining things in terms of OOP, my mind just says "To Hell with this," and you lose me.

I'm Brain-Dead remember?

I'll keep trying to use it, but it'll have to be in small doses for now.

Take care, Bob