Oolite Bulletins

For information and discussion about Oolite.
It is currently Sun Nov 19, 2017 5:39 pm

All times are UTC




Post new topic  Reply to topic  [ 32 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: 1801
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


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: 417
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
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 32 posts ]  Go to page Previous 1 2 3

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 19 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