.CEL Script Problem

Report bugs, bug fixes and workarounds here.
Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 7 months
Location: Colorado, USA (7000 ft)

.CEL Script Problem

Post #1by don » 09.08.2003, 08:21

.CEL script problem ...

Windows ver 1.3.1 pre9.

If Celestia is not currently running, and you run the following script, it does not work. It flys right past the moon out to 207 au:

Code: Select all

{
select { object "Sol/Earth/Moon" }
goto   { distance 7 time 3 }
wait   { duration 3 }
chase  { }
}


This code works (note the wait command after the select command):

Code: Select all

{
select { object "Sol/Earth/Moon" }
wait   {}
goto   { distance 7 time 3 }
wait   { duration 3 }
chase  { }
}


This code works (note the longer wait command after the goto):

Code: Select all

{
select { object "Sol/Earth/Moon" }
goto   { distance 7 time 3 }
wait   { duration 4 }
chase  { }
}


This code works (note the moved chase command):

Code: Select all

{
select { object "Sol/Earth/Moon" }
chase  {}
goto   { distance 7 time 3 }
wait   { duration 3 }
}


Why doesn't the first code example work as expected?
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

jamarsa
Posts: 326
Joined: 31.03.2003
With us: 21 years 10 months
Location: San Sebastian (Spain)

Post #2by jamarsa » 09.08.2003, 10:04

Perhaps if the wait time is equal or less than the goto time, it stops the 'goto' before arriving to the moon (hence the 207 AU distance). Just my guess...

don wrote:It flys right past the moon out to 207 au


Do you mean you see the moon passing by? If so, my previous hypothesis is wrong...

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

Post #3by don » 09.08.2003, 17:24

jamarsa wrote:Do you mean you see the moon passing by? If so, my previous hypothesis is wrong...

Yep, sometimes you go right through the moon to the other side. Other times, you never even see the moon.

My understanding of the way .CEL scripting is supposed to work is that for every command that has a time parameter, you must code a wait command after it, with the duration equal to or greater than the amount of time the previous command used.

If this is true, then placing a wait after a select command should not be necessary because select does not have a time parameter.

My thought is that Celestia is doing some kind of start-up initialization tasks while the script is also trying to execute -- since this happens only when running the script when Celestia is not currently running.

My suggestion would be for the developers to put a longer "hold time" on script execution until Celestia is fully initialized at startup.
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

jamarsa
Posts: 326
Joined: 31.03.2003
With us: 21 years 10 months
Location: San Sebastian (Spain)

Post #4by jamarsa » 09.08.2003, 20:20

don wrote:My thought is that Celestia is doing some kind of start-up initialization tasks while the script is also trying to execute -- since this happens only when running the script when Celestia is not currently running.


The default start point of Celestia before running the script is located (at least for me) at 207.137 AU from the moon, current time (I just put an empty start.cel to check this). The problem could be as you say: it selects the initial coordinates after starting the script and executing the goto command, therefore it changes it's behaviour.

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

Post #5by don » 10.08.2003, 02:14

Bingo, that is exactly the same au I get when running the script.

So, it appears that Celestia does in fact need to wait when executing a script upon startup. Thanks for the debugging help Javier <smile>.

Hope one of the developers can fix this.
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.


Return to “Bugs”