About labels

All about writing scripts for Celestia in Lua and the .cel system
Topic author
guillaume_2k3
Posts: 8
Joined: 02.05.2005
With us: 19 years 5 months

About labels

Post #1by guillaume_2k3 » 03.04.2006, 22:38

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.

cpotting
Posts: 164
Joined: 18.03.2004
Age: 62
With us: 20 years 6 months
Location: Victoria, BC Canada

Post #2by cpotting » 12.04.2006, 21:32

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

amaury
Posts: 32
Joined: 05.03.2006
With us: 18 years 7 months
Location: paris

Post #3by amaury » 22.04.2006, 11:20

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 :)

BrainDead
Posts: 238
Joined: 27.08.2005
With us: 19 years 1 month
Location: Germantown, OH

Post #4by BrainDead » 01.05.2006, 10:16

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

eburacum45
Posts: 691
Joined: 13.11.2003
With us: 20 years 10 months

Post #5by eburacum45 » 21.06.2006, 18:02

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?

amaury
Posts: 32
Joined: 05.03.2006
With us: 18 years 7 months
Location: paris

Post #6by amaury » 21.06.2006, 21:16

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...

Topic author
guillaume_2k3
Posts: 8
Joined: 02.05.2005
With us: 19 years 5 months

Post #7by guillaume_2k3 » 03.07.2006, 22:07

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 ?

Topic author
guillaume_2k3
Posts: 8
Joined: 02.05.2005
With us: 19 years 5 months

Post #8by guillaume_2k3 » 03.07.2006, 22:27

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.

amaury
Posts: 32
Joined: 05.03.2006
With us: 18 years 7 months
Location: paris

Post #9by amaury » 04.07.2006, 08:50

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

Topic author
guillaume_2k3
Posts: 8
Joined: 02.05.2005
With us: 19 years 5 months

Post #10by guillaume_2k3 » 04.07.2006, 15:42

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.

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 8 months
Location: Seattle, WA USA

Post #11by hank » 04.07.2006, 16:29

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

Topic author
guillaume_2k3
Posts: 8
Joined: 02.05.2005
With us: 19 years 5 months

Post #12by guillaume_2k3 » 04.07.2006, 19:08

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

Topic author
guillaume_2k3
Posts: 8
Joined: 02.05.2005
With us: 19 years 5 months

Post #13by guillaume_2k3 » 05.07.2006, 19:03

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


Return to “Scripting”