Hi.
Was harassing Alex with some modding questions regarding fleets and weapon/ship availability. Decided to share the answers with the community and continue asking questions here rather than in PM.
So, here are the answers I`ve got from Alex (my questions are quoted):
1. I can`t find a file that contains fleet compositions. I looked in factions, but there are only ship types per faction and fleet type names. Where can I find that file and if faction-specific fleet composition possible?
The old-style fleet compositions should still work (using the same json format/java methods to spawn them), but they're no longer used anywhere by vanilla, and not exactly supported - i.e. if something breaks them later on down the line, I won't be fixing them.
The new way involves using code and "shipRoles" to spawn ships. Basically, you define - per faction, with defaults in default_ship_roles.json - what ships the faction uses for which roles. For example, what's a light combat ship? Etc. Then you spawn ships using a "quality factor" based on the market's stability (which makes higher or lower "quality" variants more or less likely to be picked), so the fleets end up being dynamic, both based on the faction and the market that spawned them.
For an example of how this works, take a look at com.fs.starfarer.api.impl.campaign.fleetsPatrolFleetManager.
2. Is there any way to set up faction-specific ship/weapon choices for markets? I.e. - specific factnion only sells guns/ships restricted to it. I can force some supply fleets to carry specific weapons, but I wish it to remain as much market-dependable as it is now in vanilla.
If you're using the default implementations of OpenMarketPlugin/MilitarySubmarketPlugin/etc, what'll happen is the ships/weapons available will be based on the ships the faction has configured in its shipRoles, and the weapons those ships carry. So, it sort of automatically "fits" the faction, even including higher-quality stuff being available on stable markets. It does also throw in a few totally random weapons for variety.
(Also, note: old-style "weapon delivery" doesn't work anymore. You could make it work by adding stuff directly to submarket cargo if you really wanted to, though.)
I actually feared that things will get nasty code-wise regarding faction-specific weapons/ships, but what you did with markets picking up the weapons based on preffered ship variants... you surely didn`t forget us modders while thinking this system out.
Saved me a lot of content-work, too Smiley
Is there any way to mark weapons/hulls as non-available for sell at all (rather than not including them on ship hulls)? Not speaking of built-in guns here - more of alien-based weapons and some high-tech stuff.
Add a "SYSTEM" tag for weapons, this should work 100% in the next release. You can also provide custom implementations of submarket plugins which can filter out whatever you want, it'll get callbacks pre player interaction.