Ship Comparison (Release)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Ship Comparison (Release)

Post by phkb »

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

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

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).

User avatar
ffutures
---- E L I T E ----
---- E L I T E ----
Posts: 1604
Joined: Wed Dec 04, 2013 12:34 pm
Location: London, UK
Contact:

Re: Ship Comparison (Release)

Post by ffutures »

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?

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

ffutures wrote:It might be useful if you could say if the ships can be fitted with an expanded hold.
Great idea! Thanks!

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

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.

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2576
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Ship Comparison (Release)

Post by Norby »

phkb wrote: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.

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

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: 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);
	}
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: 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
Therefore I must be doing something wrong here. Any pointers, anyone? :)

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2576
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Ship Comparison (Release)

Post by Norby »

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.

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

Norby wrote: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.

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

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!

Fritz
---- E L I T E ----
---- E L I T E ----
Posts: 591
Joined: Sun Jul 12, 2015 2:30 pm
Location: Bavaria, Germany
Contact:

Re: Ship Comparison (Release)

Post by Fritz »

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!"

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2576
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Ship Comparison (Release)

Post by Norby »

Fritz wrote: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.

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

Thanks for the bug reports Norby! I'll get on to them shortly.

User avatar
phkb
Commodore
Commodore
Posts: 2713
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Ship Comparison (Release)

Post by phkb »

Fritz wrote: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.

User avatar
Amah
---- E L I T E ----
---- E L I T E ----
Posts: 485
Joined: Tue Aug 28, 2012 8:05 pm
Location: aboard the Laenina Crowne - Yasen-N class space freighter
Contact:

Re: Ship Comparison (Release)

Post by Amah »

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
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

Post Reply