Ship Library adds Expansion Pack ships
Moderators: winston, another_commander
Ship Library adds Expansion Pack ships
Donno if its possible, but it would be really nice if the Ship Library somehow could read all ship classes currently in game (including those from addons).
"There is a single light of science, and to brighten it anywhere is to brighten it everywhere." - Isaac Asimov
- Stormrider
- Deadly
- Posts: 241
- Joined: Sat Jan 25, 2014 2:35 am
- Location: At work
Re: Ship Library adds Expansion Pack ships
It is, the oxp author just has to create a shiplibrary.plist:Vincentz wrote:Donno if its possible
Code: Select all
(
{
ship = "RNRL_Stormbrewer-trader";
class = "ship";
ship_data = true;
summary = "Heavy Fighter";
weapons = " 4 fixed, 4 pylon";
description = "The Stormbrewer light transport has enough cargo space for to use for small cargo contracts or passenger transport, but still nimble enough to use as a heavy fighter.";
}
)
Re: Ship Library adds Expansion Pack ships
Wouldn't it be possible to make an oxp parsing the other oxps?
I mean, I don't know if it is possible to access other oxps' data from one's own oxp?
I mean, I don't know if it is possible to access other oxps' data from one's own oxp?
Re: Ship Library adds Expansion Pack ships
That's certainly possible - you can read various bits of ship data using the static methods of the Ship class. You can't add entries at run time to the ship library data structure, but you could write a little helper script which would search for ships and print out a start on the
A lot of
There's also decisions to be taken on what category to put the ships in to, and what description paragraph to add to them (in many cases it will be easy enough to put this together from the ship's Wiki page). For some entries - Oolite core does this for thargoid, police and military ships - you may want to mark some capabilities as classified or unknown.
But ... you certainly could have a "OXP Ship Descriptions" pack which just contained a
If the ship OXP has an appropriate license, however, it might be considerably easier just to add a
shiplibrary.plist
file to the log.A lot of
shiplibrary.plist
is not particularly automatable, though. If an OXP provides multiple ships, you need to select each ship; if an OXP provides multiple ship variants to manage different roles - as the core does between cobra3-trader and cobra3-pirate, for instance - you only want to include one of those.There's also decisions to be taken on what category to put the ships in to, and what description paragraph to add to them (in many cases it will be easy enough to put this together from the ship's Wiki page). For some entries - Oolite core does this for thargoid, police and military ships - you may want to mark some capabilities as classified or unknown.
But ... you certainly could have a "OXP Ship Descriptions" pack which just contained a
shiplibrary.plist
containing the descriptions for ship OXPs which were unlikely to be updated themselves. Entries in the file are discarded if they don't match an installed ship, so there's no problem there. You would need to occasionally maintain the pack to remove entries for ship OXPs which were updated, though, or you'd get duplicate entries.If the ship OXP has an appropriate license, however, it might be considerably easier just to add a
shiplibrary.plist
to it and re-release it (a lot of the older ones are also in need of other maintenance work too - new roles, new shipdata properties, in some cases reconsideration of armament, etc.).