Oolite Bulletins

For information and discussion about Oolite.
It is currently Sat May 26, 2018 12:30 am

All times are UTC




Post new topic  Reply to topic  [ 38 posts ]  Go to page Previous 1 2 3
Author Message
PostPosted: Thu Aug 10, 2017 8:36 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2055
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
the amount of cargo of my Cobra Mk. IV OXP is being shown as "45", but it should actually be "45 (+15)"
This is a limitation on what information I can access at runtime. The default amount of extra cargo (if none is specified in shipdata.plist) is 15. However, that setting only comes into play if the ship has an option for a large cargo bay specified in shipyard.plist. I can't read details from shipyard.plist at runtime, which means all I have access to is the shipdata.plist file, which means if no extra cargo is specified there, it's hard to assume it's actually allowed.

There are two ways around this. First, you could specify the extra cargo in your shipdata.plist file - if it's specifically set, I can assume it's correct.

Alternatively, I have a list of exceptions inside Ship Comparisons which controls the two settings I can't read from shipyard.plist: large cargo bay, and weapon facings. For future reference (and I'll put this on the wiki page as well), to override these values you can do this:
Code:
    worldScripts.ShipComparison._extraData["Cobra Mark IV"] = [15, 15];
The ship name should be the generic name for the ship, rather than the shipkey (although if you have a specific variant of the generic you want to include you can do that as well), and the two numbers are "amount of extra cargo" and "weapon facings" (where 15 means all positions).

In any case, I've uploaded v1.8 of Ship Comparisons which add the Cobra Mark IV to the list of exceptions, so you don't need to do anything for this ship now.

Thanks for letting me know!

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
PostPosted: Thu Aug 10, 2017 9:41 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 472
Quote:
The default amount of extra cargo (if none is specified in shipdata.plist) is 15. However, that setting only comes into play if the ship has an option for a large cargo bay specified in shipyard.plist. I can't read details from shipyard.plist at runtime, which means all I have access to is the shipdata.plist file, which means if no extra cargo is specified there, it's hard to assume it's actually allowed.
That makes complete sense to me, didn't think about it!
Quote:
There are two ways around this. First, you could specify the extra cargo in your shipdata.plist file - if it's specifically set, I can assume it's correct.
Great to know, I actually didn't even think that the extra cargo size can get defined in the shipdata.plist.
Quote:
In any case, I've uploaded v1.8 of Ship Comparisons which add the Cobra Mark IV to the list of exceptions, so you don't need to do anything for this ship now.
Many thanks, that's very nice of you :D


Top
   
PostPosted: Thu Nov 30, 2017 9:45 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2055
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Version 2.0 has just been released. In this version:
  • Added ship price to the list of information shown.
  • Put pitch, roll and yaw onto 1 line.
  • Added new menu option, "View standard equipment availability", which shows which standard equipment items are fitted as standard, available for optional installation, or not available at all.
  • Removed requirement to store a value in missionVariables.
  • Added option to clear ship list to Library interface.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
PostPosted: Fri Dec 01, 2017 2:22 am 
Offline
Dangerous
Dangerous
User avatar

Joined: Mon May 30, 2016 3:54 am
Posts: 95
Quote:
Version 2.0 has just been released.
Sorry for being the one reporting an error again:

08:40:58.752 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (ShipComparison 2.0): TypeError: shipDef._oo_shipyard is undefined

_________________
Trying to survive behind the controls of a Caduceus Psi XT in Alpha test :lol:


Top
   
PostPosted: Fri Dec 01, 2017 3:47 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2055
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
Sorry for being the one reporting an error again:
Don't be sorry. Squashing bugs is a good thing!
Quote:
Code:
08:40:58.752 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (ShipComparison 2.0): TypeError: shipDef._oo_shipyard is undefined
In this case I don't think it's Ship Comparison that has the problem (other than not checking that the value exists) - it looks like you have a ship with a "player" role that doesn't have an equivalent shipyard.plist entry. I'm not sure if that's normally an allowable scenario, but I don't think it is.

I've just posted an update, to version 2.1, which shouldn't bomb out with a Javascript error anymore. Can I get you to download this one and then cycle through all the available ships? It will output some extra log file entries that can hopefully help us track down the culprit/s.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
PostPosted: Fri Dec 01, 2017 4:09 am 
Offline
Dangerous
Dangerous
User avatar

Joined: Mon May 30, 2016 3:54 am
Posts: 95
Quote:
In this case I don't think it's Ship Comparison that has the problem (other than not checking that the value exists) - it looks like you have a ship with a "player" role that doesn't have an equivalent shipyard.plist entry. I'm not sure if that's normally an allowable scenario, but I don't think it is.

I've just posted an update, to version 2.1, which shouldn't bomb out with a Javascript error anymore. Can I get you to download this one and then cycle through all the available ships? It will output some extra log file entries that can hopefully help us track down the culprit/s.
You are correct, thanks to your logs I found 4 ships so far:

10:58:25.254 [ShipComparison]: !!ERROR: _oo_shipyard property not set for ship Viper Carrier, key viper-carrier-player
10:58:43.572 [ShipComparison]: !!ERROR: _oo_shipyard property not set for ship Super-Sidewinder, key superSidewinderPlayer
10:59:37.870 [ShipComparison]: !!ERROR: _oo_shipyard property not set for ship Fer-de-Lance 3G+(t), key ferdelance3-playerPlusModelWithTurrets
10:59:38.363 [ShipComparison]: !!ERROR: _oo_shipyard property not set for ship Fer-de-Lance 3G+, key ferdelance3-playerPlusModel

While scrolling all ships I have installed V 2.10 isn't crashing anymore, V 2.00 stopped responding until I restarted from scratch. Btw, is there a chance to include ship mass as well ? :wink:

_________________
Trying to survive behind the controls of a Caduceus Psi XT in Alpha test :lol:


Top
   
PostPosted: Fri Dec 01, 2017 4:27 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2055
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
While scrolling all ships I have installed V 2.10 isn't crashing anymore
Well, that's good news!
Quote:
Btw, is there a chance to include ship mass as well ?
There already is, but you have to install Ship Configuration OXP to see it at the moment (which is not a light-weight decision!).

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
PostPosted: Fri Dec 01, 2017 4:36 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2055
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
10:58:43.572 [ShipComparison]: !!ERROR: _oo_shipyard property not set for ship Super-Sidewinder, key superSidewinderPlayer
Just had a look at this one, and it appears this entry in the shipdata.plist is the problem:
Code:
	// Player - for backwards compatibility
	"superSidewinderPlayer" =
	{
		like_ship = "superSidewinder_player";
	};
Because it's using "like_ship" to copy the player version, it rates as a "player" ship to the rest of the program. But, because shipyard.plist only has an entry for "superSidewinder_player", there is no "_oo_shipyard" property when I read the shipdata entry for "superSidewinderPlayer". Also, when I'm compiling the list of player ship keys, "superSidewinderPlayer" comes before "superSidewinder_player" alphabetically, so it's possible I'm hitting that one first (with no shipyard entry) and ignoring the second one (that does have an shipyard entry), because, technically, they are the same ship, so there's no need to get the second one once I have the first one.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 38 posts ]  Go to page Previous 1 2 3

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] 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:
Powered by phpBB® Forum Software © phpBB Limited