-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Currently when selecting a target for a contract there is no way to select a vessel based on presence or absence of a PartModule in the various parts making up a vessel. For example: Have a contract to add a science lab to a base or station, but limit it to vessels without an existing science lab. Bases and Stations Reborn contract pack has contracts of this type but they are poorly conceived. In one case there no check of the contents of existing bases are done before offering the contract in the station case it only looks for the presence of the stock science lab. The base contract spawns regardless of how many science labs are present.
Part validation based on part modules is only done to evaluate whether a vessel meets contract requirements but nothing in the target selection side to see if the contract even makes sense for the target vessel.
The only method available is to specify specific parts by name and this becomes quickly unmanageable. There is no way to write a comprehensive generic patch for every conceivable mod out there that might have parts that would satisfy a check for a science lab in target selection. Being able to look for the ModuleScienceLab would make it simple.
Another type of contract in the Bases and Stations Reborn contract pack is to Expand Life Support, there a handful of part modules per life support mod with support in the contract pack. In many cases this list of a few PartModules expands to become a parts list covering a good portion of the parts with any crew capacity.
Ideally I would be able to exclude a vessel with a statement like: Where v.PartModule() != "ModuleScienceLab", i.e.
Target = AllVessels().Where(v => v.VesselType() == Base && v.IsLanded() && v.PartModule() !="ModuleScienceLab").SelectUnique()