Page 1 of 1
help with log error message
Posted: Sun May 01, 2011 11:36 am
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
Re: help with log error message
Posted: Sun May 01, 2011 11:40 am
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
?
Re: help with log error message
Posted: Sun May 01, 2011 12:02 pm
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
Re: help with log error message
Posted: Sun May 01, 2011 12:35 pm
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?