About labels

All about writing scripts for Celestia in Lua and the .cel system

Moderator: selden

About labels

Postby guillaume_2k3 on Mon Apr 03, 2006 3:38 pm

Hi There,

I'm looking for a script command to mark or unmark some features like a user can do through the "Render" -> "Locations" -> "Label Features" menu.

What command allows to do that in a script ?
I tried with unmarkall() and set labels stuff, but it doesn't work the way I want.

Thanks for your suggestions.
guillaume_2k3
 
Posts: 8
Joined: Mon May 02, 2005 5:38 am

Postby cpotting on Wed Apr 12, 2006 2:32 pm

If you are referring to .cel scripts, the command you want is mark.

For .celx scripts, you should use the object:mark() method.

guillaume_2k3 wrote:I tried with unmarkall() and set labels stuff, but it doesn't work the way I want.

Exactly what did you try? And how is it that you wanted it to work?
Clive Pottinger
Victoria, BC Canada
User avatar
cpotting
 
Posts: 164
Joined: Thu Mar 18, 2004 8:42 am
Location: Victoria, BC Canada

Postby amaury on Sat Apr 22, 2006 4:20 am

Hello Guillaume,
you can try this:


http://asolignac.free.fr/celestia/the_marker_beta.celx.txt


It's a first version, but it works.
bugs/suggestions from anyone else are welcome

Tu es français au fait ?

Amaury :)
User avatar
amaury
 
Posts: 30
Joined: Sat Mar 04, 2006 8:47 pm
Location: paris

Postby BrainDead on Mon May 01, 2006 3:16 am

Just thought I'd mention that the MARK function will not work within
either CEL or CELX if the location you're trying to mark is not referenced
somewhere in an accessible locations .SSC file.

In other words, if you do not have a MarsMoonLocs.ssc file on your system
to describe where the locations on Phoebe and Deimos are actually
positioned on the moons, then neither a label display nor a mark will work.

FYI.
Brain-Dead Bob

Windows XP-SP2, 256Meg 1024x768 Resolution
Intel Celeron 1400 MHz CPU
Intel 82815 Graphics Controller
OpenGL Version: 1.1.2 - Build 4.13.01.3196
Celestia 1.4.1
User avatar
BrainDead
 
Posts: 238
Joined: Sat Aug 27, 2005 5:12 am
Location: Germantown, OH

Postby eburacum45 on Wed Jun 21, 2006 11:02 am

Perhaps this is the best place to ask;
What I am looking for is a way of marking all the stars I am interested in.
I can easily find all these stars individually, but if I can make a script which marks them all at once it would be very useful.

If I modified amaury's script to include the stars I am interested in, how would I use it? What commands would work with such a script?
User avatar
eburacum45
 
Posts: 666
Joined: Thu Nov 13, 2003 11:29 am

Postby amaury on Wed Jun 21, 2006 2:16 pm

Hi eburacum,

thanks for your post. If you have any suggestion on the script, feel free to tell.

Regarding your question, you can try this (newer) version
it is ready for star support (a few code uncommenting is necessary, but it's all documented in the code).

The problem i ran into is that Celestia will crash (not enough memory ?) when trying to mark all stars, around 90,000 stars. So i disabled unconditional star marking in my script.

The other problem is that marking a big number of objects is very slow if a wait() is involved.
I tried removing the wait() command from my marking loop :
it works fine with a low number of objects (even 800 asteroids) and it draws all markings at once (looking cool ;))
Unfortunately, with stars, the script returns to Celestia after 5 seconds.

So, i tried to include a small increment function, looking at the elapsed script time, and inserting a wait() command only if 4 seconds have passed since the last one was issued.

Code: Select all
if (c:getscripttime() - last_wait > 4) then
  wait()
  last_wait = c:getscripttime()
end


I don't understand why, but it works three or four times, and then crashes...
If anyone has an idea...

Amaury

You should also have a look at toti's MarkMultiSpectralTypes.celx
It uses a specific function to scan stars to mark, while my script builds a table of all stars and runs through it (which is kind of dumb dumb, but was easier than rewriting most of my functions)

Another place to go is MostlyHarmless, a SQL client modified Celestia which allows you to issue SQL commands to select and mark stars. It looks like it is discontinued, but it is a great work...
User avatar
amaury
 
Posts: 30
Joined: Sat Mar 04, 2006 8:47 pm
Location: paris

Postby guillaume_2k3 on Mon Jul 03, 2006 3:07 pm

amaury wrote:Hello Guillaume,
you can try this:


http://asolignac.free.fr/celestia/the_marker_beta.celx.txt


It's a first version, but it works.
bugs/suggestions from anyone else are welcome

Tu es français au fait ?

Amaury :)


Oui, de Marseille, et toi ?
guillaume_2k3
 
Posts: 8
Joined: Mon May 02, 2005 5:38 am

Postby guillaume_2k3 on Mon Jul 03, 2006 3:27 pm

Thanks to everyone for your answers.

First of all, I'd like to apologize for this very late reply. I was very busy since the last months...anyway...

I don't make celx scripts, I just want to make a simple cel script that shows the "places names" onto a planet.

I tried to solve my problem with the mark{} method but I can't find further explanations to use this method as well...

I Just want to force Celestia to display the locations names onto a planet if the user didn't make it himself in the "parameters" menu.

I'm making a script about Apollo 11 mission and I don't want to show the sea of tranquility location using a small cross or something .. I'd like to show the place's name in green and the names of the closest areas appearing suddenly.
guillaume_2k3
 
Posts: 8
Joined: Mon May 02, 2005 5:38 am

Postby amaury on Tue Jul 04, 2006 1:50 am

Hello Guillaume,

i found this document on DonG scripting pages. It is about marking objects, not labelling features of objects (cities, geological sites, etc).

I found nothing about labelling of planetary features in Cel scripts.
Will tell you if i find anything.

This is what you want to do, right ? Label moon features such as planitiae, crater names, landing sites, etc ?

Amaury
User avatar
amaury
 
Posts: 30
Joined: Sat Mar 04, 2006 8:47 pm
Location: paris

Postby guillaume_2k3 on Tue Jul 04, 2006 8:42 am

amaury wrote:Hello Guillaume,

i found this document on DonG scripting pages. It is about marking objects, not labelling features of objects (cities, geological sites, etc).

I found nothing about labelling of planetary features in Cel scripts.
Will tell you if i find anything.

This is what you want to do, right ? Label moon features such as planitiae, crater names, landing sites, etc ?

Amaury

Ok Thank you Amaury for the link, je verrai ca tout à l'heure à tête reposée ;) I'm just coming back from work and I have some stuff to do ...
And Yes, I wish I want to label features like cities, etc..

Thanks again.
guillaume_2k3
 
Posts: 8
Joined: Mon May 02, 2005 5:38 am

Postby hank on Tue Jul 04, 2006 9:29 am

There are two issues here. One issue is defining the locations, which is done in an ssc file. The other issue is turning the labels on and off, which I believe in CEL would be done with the "labels" command. But unfortunately, I don't think the "locations" keyword for that CEL command has been implemented yet.

- Hank
User avatar
hank
 
Posts: 645
Joined: Sat Feb 02, 2002 9:28 pm
Location: Seattle, WA USA

Postby guillaume_2k3 on Tue Jul 04, 2006 12:08 pm

hank wrote:There are two issues here. One issue is defining the locations, which is done in an ssc file. The other issue is turning the labels on and off, which I believe in CEL would be done with the "labels" command. But unfortunately, I don't think the "locations" keyword for that CEL command has been implemented yet.

- Hank


Ok so, Imagine I want to show "Budapest" on the earth map

I have the following lines in a ssc file :
Code: Select all
Location "Budapest" "Sol/Earth"
{
LongLat [ 19.0833 47.5 0 ]
Importance 354.31
Type "City"
}


Do you think it's possible to focus the camera above this city, with a bit of cel code ?

I agree, you may be true, there may be no implemention for city labels In Celestia scripting yet, but, I rather ask to be sure.

Again, Thanks
guillaume_2k3
 
Posts: 8
Joined: Mon May 02, 2005 5:38 am

Postby guillaume_2k3 on Wed Jul 05, 2006 12:03 pm

I found the answer myself. Everything is in the Bo Hegwood's EarthTour.cel
First you could define the locations in a ssc, then you can point to these custom locations like "sol/earth/anywhere" . Not exactly what I expected, but it suits my needs anyway.

Thanks to everyone for the help. :D
guillaume_2k3
 
Posts: 8
Joined: Mon May 02, 2005 5:38 am


Return to Celestia Scripting

Who is online

Users browsing this forum: No registered users and 1 guest