help with log error message

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
DGill
---- E L I T E ----
---- E L I T E ----
Posts: 292
Joined: Thu Jan 01, 2009 9:45 am

help with log error message

Post by DGill »

Ive used the line:

if(missionVariables.access == System.systemNameForID(system.ID))

but get a log error message (Oolite 1.75.1) of:

Error: System.systemNameForID: Invalid arguments (-1) -- expected system ID

any help to sort it out would be appreciated
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: help with log error message

Post by JensAyton »

That should only happen in interstellar space (i.e., after a misjump). You can’t look up a system that doesn’t exist.

In any case, what’s wrong with system.name ?
DGill
---- E L I T E ----
---- E L I T E ----
Posts: 292
Joined: Thu Jan 01, 2009 9:45 am

Re: help with log error message

Post by DGill »

Ahruman wrote:
That should only happen in interstellar space (i.e., after a misjump). You can’t look up a system that doesn’t exist.

In any case, what’s wrong with system.name ?
there was a misjump so that must be it - thanks Ahruman

I have the if statement following the call:

this.shipExitedWitchspace = function()

is there a test I can use in the if statement to exclude misjumps?

"what’s wrong with system.name ?" - ??? not sure, I'll have a look at at the wiki pages again to see if I've missed something
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: help with log error message

Post by Kaks »

Yep, system.name does work fine in interstellar space, and it's also faster than System.systemNameForID(system.ID))!

Still, -1 is a valid - albeit special - system id meaning 'generic interstellar space'. Maybe amend systemNameForID to return the 'interstellar space' string for -1?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply