Ship Comparison (Release)
Moderators: winston, another_commander
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Ship Comparison (Release)
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.
Download via the download manager in the game. Alternate download from Box.com
Download via the download manager in the game. Alternate download from Box.com
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
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).
- 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).
- ffutures
- ---- E L I T E ----
- Posts: 2174
- Joined: Wed Dec 04, 2013 12:34 pm
- Location: London, UK
- Contact:
Re: Ship Comparison (Release)
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?
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
Great idea! Thanks!ffutures wrote:It might be useful if you could say if the ships can be fitted with an expanded hold.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
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.
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.
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Ship Comparison (Release)
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.phkb wrote:an assumption that no definition means no extra cargo
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.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
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:
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:Therefore I must be doing something wrong here. Any pointers, anyone?
Code: Select all
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);
}
Instead this is what I see in the log file:
Code: Select all
11:48:35.143 [ShipComparison]: max cargo 750
11:48:35.143 [ShipComparison]: canAward true
11:48:35.143 [ShipComparison]: new max cargo 765
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Ship Comparison (Release)
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.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
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.Norby wrote:The player.replaceShip should work, but using Ship Storage Helper just for this is too extreme imho.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
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!
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!
-
- ---- E L I T E ----
- Posts: 591
- Joined: Sun Jul 12, 2015 2:30 pm
- Location: Bavaria, Germany
- Contact:
Re: Ship Comparison (Release)
I found a wrong cargo capacity, but I knew that I would find it because you don't know my ship.
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.
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!"
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Ship Comparison (Release)
This is frequent so in [wiki]Gallery[/wiki] I added numbers after the name in this case.Fritz wrote:Both have the display name "Python"
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]:
The inherited thrust and roll is not returned by a simple shipdata query. Try access in the ship mentioned in like_ship.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
Thanks for the bug reports Norby! I'll get on to them shortly.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship Comparison (Release)
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.Fritz wrote:probably the list is based on names and not on shipdata keys.
- Amah
- ---- E L I T E ----
- Posts: 486
- Joined: Tue Aug 28, 2012 8:05 pm
- Location: aboard the Laenina Crowne - Yasen-N class space freighter
- Contact:
Re: Ship Comparison (Release)
Hmmh, you can set what's shown in the scanner by alterning the scanner description, iirc. Just put something into the respective shipdata.plist.Fritz wrote:... 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
scan_description = "my special Python, without any external difference";
Amah
- about Amah: wiki
- noshaders versions of Griff's extra, alternate ships and accessories: discussion, wiki
- ocpc - customize the player ship: discussion, oxp repository