For test results, bug reports, announcements of new builds etc.
Moderators: winston, another_commander, Getafix
-
Okti
- ---- E L I T E ----

- Posts: 700
- Joined: Sun Sep 26, 2010 1:51 pm
- Location: A GH shop, near witchpoint to Oresrati in Galaxy 8
Post
by Okti »
According to Wiki=
systemIDForName
function systemIDForName(systemName : String) : Integer
Returns the ID number of a system in the current galaxy based on the system name)
What happens if you pass the name of a system like "Inzaan", which there a two planets with the same name in G8

-
Commander McLane
- ---- E L I T E ----

- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
-
Contact:
Post
by Commander McLane »
Okti wrote:According to Wiki=
systemIDForName
function systemIDForName(systemName : String) : Integer
Returns the ID number of a system in the current galaxy based on the system name)
What happens if you pass the name of a system like "Inzaan", which there a two planets with the same name in G8

Why don't you just try it in the console:
Code: Select all
> System.systemIDForName("Inzaan")
22
Either it has returned one of them randomly, or the smaller number (the other Inzaan has ID 156).
Note that Inzaan is the only case of two planets with the same name in the same galaxy. So scripters should be aware of the exception.
-
JensAyton
- Grand Admiral Emeritus

- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
-
Contact:
Post
by JensAyton »
It searches through the planet IDs from 0 to 255 and returns the first match. (It’s also laughably inefficient.) Docs updated.