Few CEL commands ?

All about writing scripts for Celestia in Lua and the .cel system
Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 21 years
Location: Montreal

Few CEL commands ?

Post #1by Cham » 12.09.2009, 16:10

I need some CEL commands. Anybody has an idea what they are ?

1. How to preload some models in a CEL script (not just the textures) ?

2. How to turn ON/OFF the HUD ?

3. How to set time and date to "now" ?

Thanks.
"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!"

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 20 years
Location: Nancy, France

Re: Few CEL commands ?

Post #2by Vincent » 13.09.2009, 10:56

Cham wrote:I need some CEL commands. Anybody has an idea what they are ?
Martin,

You'll find an up-to-date list of the CEL commands, along with some examples, on the French Celestia wiki:
http://www.ikiru.ch/celestia/wiki/index.php/Script

It'd be great if someone was willing to add this list -- and keep it up-to-date -- to the English Celestia Wikibook...

1. How to preload some models in a CEL script (not just the textures) ?
http://www.ikiru.ch/celestia/wiki/index.php/Preloadtex

2. How to turn ON/OFF the HUD ?
This is not possible in CEL scripting. You can use the setoverlayelements CELX command, though:

Code: Select all

celestia:setoverlayelements{Time = false, Velocity = false, Selection = false, Frame = false}


3. How to set time and date to "now" ?
This is not possible in CEL either. You must use the following CELX lines:

Code: Select all

now = celestia:getsystemtime()
celestia:settime(now)
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 21 years
Location: Montreal

Re: Few CEL commands ?

Post #3by Cham » 13.09.2009, 12:10

Vincent wrote:
1. How to preload some models in a CEL script (not just the textures) ?
http://www.ikiru.ch/celestia/wiki/index.php/Preloadtex

Thanks Vincent.

But on this command (preloadtex), will it preload models too ?
"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!"

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 20 years
Location: Nancy, France

Re: Few CEL commands ?

Post #4by Vincent » 13.09.2009, 15:34

Cham wrote:But on this command (preloadtex), will it preload models too ?
Martin,

Sorry, I misread your question. This command will only load the texture(s).
To preload a model, I usually display the object for a few seconds at the
beginning of the script, e.g., using a celURL...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 21 years
Location: Montreal

Re: Few CEL commands ?

Post #5by Cham » 13.09.2009, 15:40

Vincent wrote:Sorry, I misread your question. This command will only load the texture(s).
To preload a model, I usually display the object for a few seconds at the
beginning of the script, e.g., using a celURL...

DARN ! :evil:
"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!"

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 20 years
Location: Nancy, France

Re: Few CEL commands ?

Post #6by Vincent » 13.09.2009, 15:47

Hmm, I'm not that sure anymore that models are not preloaded using the preloadtex command.
I just checked out in render.cpp and I discovered the following code in the loadTextures method:

Code: Select all

GetGeometryManager()->find(body->getGeometry());

Maybe Chris or some other devs can help here...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

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

Re: Few CEL commands ?

Post #7by chris » 14.09.2009, 15:58

Vincent wrote:Hmm, I'm not that sure anymore that models are not preloaded using the preloadtex command.
I just checked out in render.cpp and I discovered the following code in the loadTextures method:

Code: Select all

GetGeometryManager()->find(body->getGeometry());

Maybe Chris or some other devs can help here...

Right--the model is loaded, but not any textures used by the models. I've got some code that does load model textures. I'll check that in today.

--Chris

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 21 years
Location: Montreal

Re: Few CEL commands ?

Post #8by Cham » 14.09.2009, 18:04

chris wrote:Right--the model is loaded, but not any textures used by the models. I've got some code that does load model textures. I'll check that in today.

So the preloadtex command will load both the model's geometry and all its textures into memory ? This is a must have feature.
"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!"

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

Re: Few CEL commands ?

Post #9by chris » 15.09.2009, 03:53

Cham wrote:
chris wrote:Right--the model is loaded, but not any textures used by the models. I've got some code that does load model textures. I'll check that in today.

So the preloadtex command will load both the model's geometry and all its textures into memory ? This is a must have feature.

Exactly. The change is in SVN now: revision 4865.

--Chris


Return to “Scripting”