If you run the game in dev mode, the log will show a lot of stuff regarding which rule is picked and why, so I'd recommend looking at that.
So I've just done this several times with several tweaks and it's still not making sense. Here's the breakdown of the outputs that occur.
Ahh, I mean starsector.log, not the on-screen output in the game.
Is there a way to reliably adjust maxShipsInAIFleet within the game, i.e. outside of directly editing settings.json? I threw the following piece of code together based very loosely on this means of adjusting maxIndustries:
Hmm, not really, no - the way it works for maxIndustries is... very situational. I did make some changes to SettingsAPI that makes it doable in the next release, though.
int maxShipsInAIFleet = Global.getSettings().getInt("maxShipsInAIFleet");
maxShipsInAIFleet = 30 + OverMax;
This doesn't actually do anything - "int maxShipsInAIFleet" is a local variable that is assigned the value returned by the getInt() method; changing it will not influence anything outside the method you're in.
I am trying to make a hullmod that adds the cargo capacity of the ship modules to the main ship, but it is not working, what I am doing wrong here?
That's just not going to work - ship modules don't have corresponding FleetMemberAPIs/stats/etc in the campaign. They only exist as variants, along with damage tracking. So, it's just functionally impossible to do what you're trying to do, their hullmods will never be applied in the campaign.
Further:
public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
This method only gets called in combat.