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
help with log error message
Moderators: winston, another_commander
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: help with log error message
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
In any case, what’s wrong with
system.name
?E-mail: [email protected]
Re: help with log error message
there was a misjump so that must be it - thanks AhrumanAhruman 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 withsystem.name
?
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
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?
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)