I'm sure this is a very straightforward thing to do, but how does one add a condition to a market with an industry, and then remove the condition if the industry is removed?
Two basic approaches: one is to add the condition in the Industry.apply() method and remove it in unapply(). The condition would have to be resistant to being added and removed many times, though, i.e. it shouldn't store data in data members etc, as Industry.unapply() gets called pretty often and not just when the industry is removed.
Another would be to add it in Industry.apply(), if it's not already present, and then remove it in the condition's advance() method, if you detect that the market no longer has an industry.
Either way, you'll want to:
String conditionId = market.addCondition(...) to add it, and
market.removeSpecificCondition(conditionId) to remove it. Or, if you're removing it in the condition's advance method:
market.removeSpecificCondition(condition.getIdForPluginModifications());
(See: RecentUnrest for an example of this.)
Further, I have a hullmod that I don't want to be bought or sold as a reward. I've poked through everything, and while industry and ship blueprints can be given no_sell and no_drop, that doesn't appear to exist for hullmods. Is there a way around this?
Set hidden to true in hull_mods.csv. (If hiddenEverywhere is set to true, it won't show up in the refit screen, btw; regular "hidden" just makes it not dropped/sold/installable).