Page 1 of 1

About labels

Posted: 03.04.2006, 22:38
by guillaume_2k3
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.

Posted: 12.04.2006, 21:32
by cpotting
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?

Posted: 22.04.2006, 11:20
by amaury
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 :)

Posted: 01.05.2006, 10:16
by BrainDead
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.

Posted: 21.06.2006, 18:02
by eburacum45
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?

Posted: 21.06.2006, 21:16
by amaury
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...

Posted: 03.07.2006, 22:07
by guillaume_2k3
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 ?

Posted: 03.07.2006, 22:27
by guillaume_2k3
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.

Posted: 04.07.2006, 08:50
by amaury
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

Posted: 04.07.2006, 15:42
by guillaume_2k3
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.

Posted: 04.07.2006, 16:29
by hank
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

Posted: 04.07.2006, 19:08
by guillaume_2k3
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

Posted: 05.07.2006, 19:03
by guillaume_2k3
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