Oolite Bulletins

For information and discussion about Oolite.
It is currently Thu Sep 21, 2017 5:26 pm

All times are UTC




Post new topic  Reply to topic  [ 32 posts ]  Go to page 1 2 3 Next
Author Message
PostPosted: Thu Dec 10, 2015 4:20 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Ship Comparison gives you the ability to view the specifications of up to 3 different ships at the same time. Perfect for players in the market for a new ship but find it hard to remember all those numbers.

Image

Download via the download manager in the game. Alternate download from Box.com

_________________
My OXP's


Top
   
PostPosted: Thu Dec 10, 2015 11:28 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Version 1.1 is up.
- Fixed issue where some ship definitions were incorrectly showing with "0" missiles.
- Fixed issue where some ship definitions were showing a blank in the cargo capacity field.
- Added code to hide specifications of some ships (classified data and such).

_________________
My OXP's


Top
   
PostPosted: Fri Dec 11, 2015 12:07 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Dec 04, 2013 12:34 pm
Posts: 912
Location: London, UK
It might be useful if you could say if the ships can be fitted with an expanded hold. Capacity is usually very important in buying a ship. Maybe put the expanded size in brackets after the usual size?


Top
   
PostPosted: Fri Dec 11, 2015 12:12 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
It might be useful if you could say if the ships can be fitted with an expanded hold.
Great idea! Thanks!

_________________
My OXP's


Top
   
PostPosted: Fri Dec 11, 2015 5:31 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Hmm. While I can read the extra_cargo property from shipdata.plist using the built in commands, this isn't always accurate. The doco says the default value is 15 if the entry isn't specified. But it isn't specified for a lot of ships, particularly those that can't have the extra cargo at all. So, I can either make an assumption that no definition means no extra cargo, which goes against the doco, or I maintain a long list of exceptions.

Unless there's a way to read shipyard.plist without having a real ship to deal with. I couldn't see any obvious method of doing this. Then I could look up a ship and read the optional equipment value to see if EQ_CARGO_BAY is listed.

_________________
My OXP's


Top
   
PostPosted: Fri Dec 11, 2015 11:47 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2389
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Quote:
an assumption that no definition means no extra cargo
The exception list will be shorter if you assume no extra cargo for ships with less than 10t (or so) cargo space, and make another short list for real 1t+15t ships if there is any.

An ugly but exact workaround: if no extra_cargo given in shipdata then spawn a similar ship, award a bay, check if it is successful or not and remove the ship.

_________________
OXPs by Norby


Top
   
PostPosted: Sat Dec 12, 2015 1:11 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Here's something strange: I went down the path of creating ships, then checking if I could award "EQ_CARGO_BAY" to them. Here's what I have:
Code:
	var shipKey = "griff_anaconda-PLAYER";
	var temppos = system.sun.position.cross(system.mainPlanet.position).direction().multiply(4E9).subtract(system.mainPlanet.position);
	var tempship = system.addShips("[" + shipKey + "]", 1, temppos, 0);
	if (tempship != null) {
		tempship[0].switchAI("nullAI.plist");
		var init_c = tempship[0].cargoSpaceCapacity;
		log(this.name, "max cargo " + init_c);
		var result = tempship[0].canAwardEquipment("EQ_CARGO_BAY");
		log(this.name, "canAward " + result);
		tempship[0].awardEquipment("EQ_CARGO_BAY");
		var extra_c = tempship[0].cargoSpaceCapacity - init_c;
		log(this.name, "new max cargo " + tempship[0].cargoSpaceCapacity);
		tempship[0].remove(true);
	}
So, theoretically, from this code, the Anaconda should report back that it's maximum cargo is 750, and that it can't award the cargo bay. Attempting to add the extra cargo space should fail and the difference between the cargo space before and after the attempt should be zero.
Instead this is what I see in the log file:
Code:
11:48:35.143 [ShipComparison]: max cargo 750
11:48:35.143 [ShipComparison]: canAward true
11:48:35.143 [ShipComparison]: new max cargo 765
Therefore I must be doing something wrong here. Any pointers, anyone? :)

_________________
My OXP's


Top
   
PostPosted: Sat Dec 12, 2015 2:05 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2389
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Looks like spawned ships are NPCs where player-only shipyard changes are not applied, so this is not a way, sorry. The player.replaceShip should work, but using Ship Storage Helper just for this is too extreme imho.

_________________
OXPs by Norby


Top
   
PostPosted: Sat Dec 12, 2015 3:12 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
The player.replaceShip should work, but using Ship Storage Helper just for this is too extreme imho.
Yeah, quite a bit of overhead to get one or two parameters. I might just have to create an override matrix. *sighs* This was supposed to be a really simple project. Oh well. First rule of computing - nothing is ever as easy as it seems.

_________________
My OXP's


Top
   
PostPosted: Sat Dec 12, 2015 10:59 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
OK, version 1.2 is up. I've gone down the "lets maintain a long list of exceptions" route, so if you find ships that report incorrect details in the "Weapon positions" or "cargo expansion" column (or any of the details, really!) just let me know and I'll update the list.

Also in this release is the ability to switch from descending (A-Z) to ascending (Z-A) scrolling, so if you go past the ship you want to compare you don't have to go all the way 'round the Horn to get back to the item you want.

As always, comments, suggestions and bug reports welcome!

_________________
My OXP's


Top
   
PostPosted: Sat Dec 12, 2015 11:27 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 12, 2015 2:30 pm
Posts: 591
Location: Bavaria, Germany
I found a wrong cargo capacity, but I knew that I would find it because you don't know my ship. :lol:

In the more serious side - but you probably can't do anything about it - my list is missing the standard Python, only showing my modified version. Probably the list is based on names and not on shipdata keys. This problem doesn't only affect your list but also the normal shopping list of available ships. It occurs if there are two different versions of a ship available to the player, in my case a "python_player" and "python_gunship_player". Both have the display name "Python", and this is intentional in my case because the player shouldn't see from a distance what version he is attacking or what is attacking him (there is no significant external difference, so he couldn't see it in reality too). What is missing here is a separate name for the shipyard in shipdata.plist.

_________________
"You wouldn't kill me just for a few credits, would you?" – "No, I'll do it just for the fun!"


Top
   
PostPosted: Sat Dec 12, 2015 11:53 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2389
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Quote:
Both have the display name "Python"
This is frequent so in [wiki]Gallery[/wiki] I added numbers after the name in this case.

I think better if the extra cargo contain a + sign to prevent read "2 (3)" as the extra space is +1t only. If show "2 (+3)" then surely clear.

I got some NaN from ships defined in [wiki]EscortDeck[/wiki]:
Image
The inherited thrust and roll is not returned by a simple shipdata query. Try access in the ship mentioned in like_ship.

_________________
OXPs by Norby


Top
   
PostPosted: Sun Dec 13, 2015 12:19 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Thanks for the bug reports Norby! I'll get on to them shortly.

_________________
My OXP's


Top
   
PostPosted: Sun Dec 13, 2015 12:25 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1706
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
probably the list is based on names and not on shipdata keys.
Thanks correct. I could do it on data keys, but then there would be about 30 odd Cobra Mark III's, all the same, if you have Amah's variety pack installed. If you've got some details I can add in a override list for special ships so that they get an entry on their own.

_________________
My OXP's


Top
   
PostPosted: Sun Dec 13, 2015 7:52 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Tue Aug 28, 2012 8:05 pm
Posts: 485
Location: aboard the Laenina Crowne - Yasen-N class space freighter
Quote:
... Both have the display name "Python", and this is intentional in my case because the player shouldn't see from a distance what version he is attacking or what is attacking him
Hmmh, you can set what's shown in the scanner by alterning the scanner description, iirc. Just put something into the respective shipdata.plist.

scan_description = "my special Python, without any external difference";

_________________
Amah


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 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