allowShowLibraryShip

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

allowShowLibraryShip

Post by spara »

I've been trying to get this to work, but it seems to not play nicely with me. I have

Code: Select all

  {
    ship = "sfep_kev_dodo_imperial";
    class = "station";
    condition_script = "sfep_station_spotter.js";
  },
in shiplibrary.plist. The script is in the Scripts folder of the OXP and looks like this:

Code: Select all

"use strict";
this.name        = "sfep_station_spotter";
this.description = "show visited stations in ship library";

this.allowShowLibraryShip = function(key) {
  return true;
}
And the ship just does not show itself in the library :( . Without condition_script line the ship shows as expected.

I can't see what's wrong with my code. A bug in the core game perhaps?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: allowShowLibraryShip

Post by another_commander »

This one behaves as you describe only on the title screen for me. Once I start a new commander or load an existing one the condition script works correctly. It looks like the ship library condition scripts are not being looked at or just return all false when on the intro screen. Not sure if this is intended or not.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: allowShowLibraryShip

Post by spara »

Ah. That makes sense since it's used to show that certain special ship after it's been encountered.

The current behavior suits me just fine. Carry on.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: allowShowLibraryShip

Post by cim »

Yes - it intentionally doesn't call the condition scripts on the intro screen because given the slightly weird state the universe is in at that point OXPers couldn't rely on consistent behaviour and might at least be surprised by the behaviour. It assumes that if there is any condition under which you might not be able to view the ship, it shouldn't be on public display before you start the game - and a condition function which solely returns true is an edge case not considered there.
Post Reply