Oolite Bulletins

For information and discussion about Oolite.
It is currently Sun May 28, 2017 6:34 am

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
 Post subject: allowShowLibraryShip
PostPosted: Mon Jan 30, 2017 6:00 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2398
Location: Finland
I've been trying to get this to work, but it seems to not play nicely with me. I have
Code:
  {
    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:
"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?


Top
   
 Post subject: Re: allowShowLibraryShip
PostPosted: Mon Jan 30, 2017 6:20 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 4826
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.


Top
   
 Post subject: Re: allowShowLibraryShip
PostPosted: Mon Jan 30, 2017 6:30 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2398
Location: Finland
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.


Top
   
 Post subject: Re: allowShowLibraryShip
PostPosted: Tue Jan 31, 2017 10:05 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
User avatar

Joined: Fri Nov 11, 2011 6:19 pm
Posts: 4005
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.

_________________
OXPs: [EliteWiki] New Cargoes, [EliteWiki] Skilled NPCs, [EliteWiki] Curse of the Black Sunspot, and more


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited