Page 1 of 1

Optional equipment for OXP player ships

Posted: Fri Sep 25, 2015 6:31 pm
by Fritz
I created a variant of the standard player Python as my player ship. When writing the shipyard.plist, I defined all the equipment I had earned with my Cobra Mk III as standard equipment. Because I didn't want to buy "my" ship with some random equipment I don't need (e.g. a docking computer), I left the optional_equipment section completely empty (I wouldn't do this of course when distributing an OXP ship).

So far, so good, everything worked like intended.

But when I completed the Thargoid plans mission, something went wrong. The naval energy unit didn't show up in the equipment list, and worse, the standard energy unit was removed. I could buy it again, and it seems to work, but obviously something went wrong, and obviously I still don't have the naval energy unit. It's probably not essential because the limiting factor while fighting (mostly) is laser temperature and shield strength, but I'd like to know what happened from a technical/programmers viewpoint

I found that most of the ships in the core shipyard.plist have the naval energy unit in their optional equipment list, and as I said, my Python didn't. Was that the reason for not getting it awarded? On the other hand, I could buy and use passenger berths, a galactic hyperspace and a mining laser, although they aren't included in my optional equipment list.

Somehow there must be a difference between optional equipment included when buying a ship and optional equipment that can be fitted later. But I can't see how it is done. Certainly you won't find an Adder already equipped with a naval energy unit in the shipyard - or am I wrong here?

The second mystery is why the standard extra energy unit was removed during the failed awarding of the navy unit. Should it be replaced by the navy unit or do both work together?

Re: Optional equipment for OXP player ships

Posted: Fri Sep 25, 2015 7:05 pm
by Layne
Fritz wrote:
I found that most of the ships in the core shipyard.plist have the naval energy unit in their optional equipment list, and as I said, my Python didn't. Was that the reason for not getting it awarded? On the other hand, I could buy and use passenger berths, a galactic hyperspace and a mining laser, although they aren't included in my optional equipment list.

Somehow there must be a difference between optional equipment included when buying a ship and optional equipment that can be fitted later. But I can't see how it is done. Certainly you won't find an Adder already equipped with a naval energy unit in the shipyard - or am I wrong here?

The second mystery is why the standard extra energy unit was removed during the failed awarding of the navy unit. Should it be replaced by the navy unit or do both work together?
Items not listed on a shipyard.plist are not only not purchasable, they won't even be retained between saved games if your ship already had them. Certain items (and a quick check of the equipment.plist shows the ones you listed are included) have a tag called 'available_to_all = true' which probably overrides them not being included on the list.

Secondly, no, the standard Extra Energy Unit and the Naval Energy Unit are mutually exclusive items-- you cannot have both of them installed at the same time, and installing a NEU removes the EEU via a script condition in Oolite's core design.

If you're comfortable with peeking through the guts of Oolite, you can see how the equipment.plist classifies things in the /resources/config directory. I wouldn't go tampering with that .plist without making a backup first, though!

Re: Optional equipment for OXP player ships

Posted: Fri Sep 25, 2015 7:07 pm
by Norby
It is a replacement and need available_to_all=true; in equipment.plist to be available for ships without a line in the optional list, which is true for the galdrive but not fot the NEU. Either you can allow it for all ships or put into the optionals and use chance=0 in shipyard.plist to hide your ship from the shop.

(ninja activity is ignored ;))

Re: Optional equipment for OXP player ships

Posted: Fri Sep 25, 2015 7:39 pm
by Fritz
Thank you, that explains everything, including why the EEU had been removed! To fix it I'll probably have to change my shipyard.plist and the save file (after making a backup of course). That should be easier than re-buying the ship and re-flying the last part of the mission...

If you don't see me again, something has exploded!


Edit: I'm still alive and my changes did work!