Optional Equipment & Passenger Berths

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Optional Equipment & Passenger Berths

Post by Thargoid »

I'm just designing a new player ship, which I want to set to not being able to install passenger berths (it would potentially screw up another feature it has). However I don't seem to be able to block the passenger berths from appearing in the available equipment (F3 screen) list?

I thought that if I ensure EQ_PASSENGER_BERTH was not present in either standard or optional equipment in shipyard.plist then I wouldn't be offered them in the screen. However on testing I still seem to be offered them for sale despite the shipyard.plist setting?

It seems to work with the large cargo bay (which I also want to restrict), but not with passenger berths. Am I misunderstanding how things work here, or is there a glitch?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Optional Equipment & Passenger Berths

Post by Eric Walch »

Thargoid wrote:
I thought that if I ensure EQ_PASSENGER_BERTH was not present in either standard or optional equipment in shipyard.plist then I wouldn't be offered them in the screen. However on testing I still seem to be offered them for sale despite the shipyard.plist setting?
When you look in the equipment.plist, you'll see that the EQ_PASSENGER_BERTH is defined as "available_to_all". Such equipment is: available to all. Only equipment that is not available to all can be differentiated by adding equipment entries for specific ships.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

I might be wrong, but if you specify a max-cargo (shipdata.plist) of less than 5 I believe this should stop passenger berths being offered, as there is simply not enough room for one...see ships like the Adder (player ship has max cargo of 2), or the Asp with zero cargo capacity. Neither can have a passenger berth.
It depends whether such a tiny capacity is acceptable in your ship.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Optional Equipment & Passenger Berths

Post by Thargoid »

Eric Walch wrote:
When you look in the equipment.plist, you'll see that the EQ_PASSENGER_BERTH is defined as "available_to_all". Such equipment is: available to all. Only equipment that is not available to all can be differentiated by adding equipment entries for specific ships.
I see what you mean. But this seems a very poor way of doing things.

A possible better way would be to have a "forbidden equipment" tag in shipyard.plist (as I already suggested elsewhere), so equipment has to be explicitly forbidden to be unusable with a ship rather than optionally available to it (and basically if any equipment exists that isn't in the forbidden list, it is then treated in the way way that optional equipment currently is - same principle but defaulting the other way).

Then the available to all tag is redundant, and it also has the added advantage that OXP equipment can be much more easily worked with (currently it is impossible to have OXP equipment not available to an existing ship, at least without major workarounds).

Or at the least an equipment-overrides.plist file, but that could get risky. Or if an already installed piece of equipment lists something else as incompatible, then that item doesn't show up for offer on the list (at the moment it only works the other way around, nothing in the list will have an incompatible tag with anything already installed).

And for the other thought - I want the ship to have cargo capacity, but not passenger capacity. I have a way to do it through scripting, but having played with shipyard.plist and equipment.plist for most of the week the current set-up seems very ripe for fixing up.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

Just a thought but OXP .plists override core .plists, don't they? If you included an equipment.plist in your OXP which was a duplicate of the core one but with the exception being that the passenger berth was set to

Code: Select all

available_to_all = false 
this would disable this 'feature'. As the core ships that can have a berth will (I assume) have this specified in the core shipyard.plist anyway, as should OXP ships, it shouldn't make any difference in practise.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I had the same thought - certainly something to test. But I'mn a bit reluctant to do that in case it generates a bad interaction between another OXP and the trunk game as a result.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Smivs wrote:
Just a thought but OXP .plists override core .plists, don't they? If you included an equipment.plist in your OXP which was a duplicate of the core one but with the exception being that the passenger berth was set to

Code: Select all

available_to_all = false 
this would disable this 'feature'. As the core ships that can have a berth will (I assume) have this specified in the core shipyard.plist anyway, as should OXP ships, it shouldn't make any difference in practise.
However, if this last assumption should prove to be false, no player ship would have the ability to mount a passenger berth anymore.

And creating a slighly altered general equipment.plist would be bad practice anyway. Imagine another OXP-author wanted to make a slight change to another piece of equipment. So he would make a duplicate of the original and only alter one other value. Already there would be an unresolvable(!) and for the lay-person unrecognizable clash between the OXPs. Bad idea.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

To be honest I thought that this was probably not a good idea when I suggested it :?
However this does seem an odd aspect of the equipment.plist. The ship's ability to have a passenger berth is in the shipyard.plist so does this really have to be specified in the equipment.plist as well. Also the 'available_to_all' is not strictly accurate as some ships (like the Adder and Asp I cited) can't have one.
Does the equipment.plist need a re-think in this area?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I would agree that it does. I really don't like available_to_all, as it makes manipulating OXP equipment and ships a real PITA sometimes.

Sadly I think to do things properly I'm going to have to redefine the passenger berth entry to at least include an incompatible with line (this would be much easier with an override plist!). I can safety net it using a check when equipment is bought, but that's a bit of a fudge.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Indeed, available_to_all can be a PITA for a scripter, however it is the only way of making new equipment available to existing ships. The alternative would be to edit and re-publish all shipyard.plists whenever a new piece of equipment is created by OXP. Obviously impossible.

But in principle I agree that the system isn't flexible enough. As it is now we as OXPers only have the choice between making a piece of equipment for one ship (or a couple) in our current OXP via shipyard.plist, or to every player ship without exception through the available_to_all flag.

If you want to be more selective, you would have to use a shipyard-override.plist and edit the optional_equipment-arrays of all existing ships you want to bless with your new equipment. Not very practical, because (1) you would have to c&p them from all existing places, and (2) that wouldn't help for upcoming ships.

The problem is that I don't see a practicable way for doing it.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

By the way: in case of EQ_PASSENGER_BERTH there is the question why it has the available_to_all in the first place. For the original set it is defined in shipyard.plist, so that should be standard for OXP ships as well. In other words: the ship creator should be solely responsible for deciding whether his ship can carry a berth or not. I would vote for removing the available_to_all from the equipment.plist entry.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Post by Switeck »

Create new equipment -- "EQ_NO_PASSENGER_BERTH", have your new ship come with that installed by default.
Have it be incompatible with "EQ_PASSENGER_BERTH", via an edited shipyard-override.plist that adds that equipment as conflicting.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Switeck wrote:
Create new equipment -- "EQ_NO_PASSENGER_BERTH", have your new ship come with that installed by default.
Have it be incompatible with "EQ_PASSENGER_BERTH", via an edited shipyard-override.plist that adds that equipment as conflicting.
Doesn't work. If you have something already installed with that set up (my ship already does) you can still install the incompatible item. The only way around it is to have the item you want to install incompatible with something already there, at which point it is then blocked.

The check is only on the item to be installed, not on what is already there. Only way to get it to work is to revise the entry for the passenger berth, which is what we're trying to avoid (but at the moment is the only way).

Commander McLane wrote:
The problem is that I don't see a practicable way for doing it.
In the current system there isn't a way. The only ways I can see are to make the incompatibility check work both ways on existing equipment as well as the item to be installed (so the idea above would work) or to revise the system and have a "forbidden equipment" section in shipyard.plist (possibly replacing the optional one, so all equipment is allowed unless explicitly forbidden, rather than forbidden unless allowed except for when available_to_all is set).

But both are quite major reworks of the system.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Ok, in about a week I should be back to my full dev powers (boring story, I'll spare you the details) and I'll try expand the shipyard entry with an incompatible_equipment = { }; bit, along the same lines as standard_equipment and optional_equipment, that is unless some other dev wants to do that before me... :P
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Re: Optional Equipment & Passenger Berths

Post by Killer Wolf »

just been searching in relation to my Cabins thread and found this.
not sure of the state of play regarding "feature freezes" now that the proposed Oolite 2 turned out to be a fail, but as regards Shipyards, could i suggest :
- different "chance"s for ships and equipment. As per the WIki, it seems stupid that one Chance covers both - it means that you can never get a bog-standard ship w/ nothing fitted, as if the chance triggers to make the shipp appear, it will also trigger additional equipment.
- some method of defining a maximum amount of items, ie a limit as to how many cabins you can have. (Actually, i think this is the only fittable item that you could have more than one of (two ECMs? I don't think so!), but a max amount could be set to zero to block certain items too, as above.
Post Reply