Finding the Name of a Star System

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Finding the Name of a Star System

Post by Nemoricus »

I have a set of arrays with the numbers of certain systems in them and need to match them with the name of the system they correspond to. I cannot figure out a way to do so.

My first thought was to make a look-up table containing the names of all of the systems in a given galaxy, but I cannot find any OXP that does anything similar. Since I can't figure out how to do it on my own, I can't use this method.

My second method would be to query Oolite for the name that a given system number in a given galaxy has, but I cannot find any documentation that suggests that something like this exists.

Does anyone have any suggestions as to how to match a system number with the name of that system?
User avatar
Rxke
Retired Assassin
Retired Assassin
Posts: 1760
Joined: Thu Aug 12, 2004 4:54 pm
Location: Belgium

Post by Rxke »

You mean The Oolite/Elite planet list?

http://wiki.alioth.net/index.php/Oolite_planet_list

or do you want to do it in-game?
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

That's the second time I brought up something related to matching system numbers and names and that's the second time that someone's first thought was to direct me to that page. I really should mention that that's not what I need.

I need a method in script to do that matching. I already have the lists. They're just not usable in an OXP as is.

Yes, what I need is a method to do so while the game's running.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

You can query what system you're in - you could use that number to look up a position in an array - the array holding all the system names in numerical order.

http://wiki.alioth.net/index.php/Oolite ... ce:_System

However, this is from somebody who has never written an OXP (so you may wish to take your own condiment)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

system.systemIDForName and system.systemNameForID will do it in Javascript.

They take in the system's number and throw out the system's name (or vice-versa respectively). So for your purposes you'd want the latter one.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Thank you, Thargoid.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Knew if I said something dumb then somebody would immediately come along and say something sensible! Fortunately, I am a bird of very little ego.
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Nothing dumb about it at all. Those two commands are detailed on the page you linked to.

So when can we expect the first DH Javascript OXP? ;)
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

I'm surprised I didn't spot those before. I was looking on that very page for something like that.

Again, thank you, Thargoid, for your help.
Post Reply