Disabling tracking without losing selection (CEL)

All about writing scripts for Celestia in Lua and the .cel system
Topic author
amoroso
Posts: 50
Joined: 07.06.2003
With us: 21 years 5 months

Disabling tracking without losing selection (CEL)

Post #1by amoroso » 27.08.2006, 18:14

I am utterly confused, in CEL scripting, on how to disable tracking on a selected object without losing the selection. The Celestia CEL Scripting Guide says the following about track{}:
If the currently selected object has track enabled, as of Celestia version 1.3.1 you can use the following code to cancel a track command:

Code: Select all

select { object "" }
track  { }
If I understand correctly, the above code should only disable tracking without losing the currently selected object. But consider this script:

Code: Select all

{
 cancel {}
 select { object "Sol/Earth" }
 goto { time 0.1 }
 wait { duration 0.1 }
 track {}
 wait { duration 1 }
 select { object "" }
 track {}
}

If I run the script with the Earth unselected, I would expect it to end with the Earth selected. Yet it is not.

How can I preserve selection under these circumstances? Should I alway explicitly reselect the object after disabling tracking on it?

I am using Celestia 1.3.2. Are there any changes with respect to this issue in later versions of Celestia?


Paolo Amoroso

Return to “Scripting”