Complaint
I recently had a bug which resulted from ActionStage's enoughMadeIt() check not taking into account whether the fleet was spawned with ignoreMarketFleetSizeMult, when calculating how many ships made it vs. how many should have. This means that a sufficiently high fleet size mult on the origin market will cause the stage to fail even if no fleet took any losses.
It's pretty straightforward to add my own check in derived classes, but might be good for the vanilla code to do it as well. Perhaps mark the fleet as having ignored size mult as a memory flag, then have enoughMadeIt() check for that?
Ahh, that's a really good point. Added a $spawnFPMult to fleet memory; this is set in FleetFactoryV3 and is the number-of-ships multiplier. So in enoughMadeIt() that's used instead of checking the market's value.
Question
How many things in vanilla currently use MemFlags.FLEET_BUSY?
I was trying to make a RaidAssignmentAI/RouteFleetAssignmentAI not constantly replace the fleet's current assignment with the default assignment (whatever is using getRaidDefaultText())
without marking the fleet as busy.
I didn't want to make the fleet busy because some of my other stuff checks busy state. Specifically, I have a "follow me" fleet ability that makes nearby friendly fleets follow the player around, but not if they're busy. But now I'm thinking I may need to have the ability make the affected fleets busy, so they don't run off to do other things.
Hmm - a bunch? Stuff like capturing comm relays etc in the campaign, pirates investigating dropped-off cargo pods, a couple of other things. Basically anything specific that tells the rest of the game not to co-opt the fleet for something *else* specific.
For what you're doing it sounds like you want to make the affected fleets "busy", yeah. You could also not co-opt fleets that are *already* busy doing something else, so as not to interrupt that.
There's a check you can do why a fleet is busy:
if (Misc.flagHasReason(mem, MemFlags.FLEET_BUSY, <your busy reason string>))
So if that returns true, you'd know that the fleet is busy because you grabbed it already and can keep giving it the follow assignment, for example.
EDIT: I guess the real question I'm asking is: "What is the difference between sorting, inflating, and syncing a fleet (with setOnlySyncMemberLists enabled vs disabled) and what do each of those actually do/what logic do they use?"
Sorting changes to order to largest -> smallest. It will also sync the fleet if it needs to.
Inflating has nothing to do with it and just adjusts fleet member variants.
Syncing a fleet with setOnlySyncMemberLists does member.setFleetData() for all the members, and also sorts the fleet from largest to smallest.
Syncing without setOnlySyncMemberLists does the same thing, and in addition updates the stats of all the fleet members (i.e. taking hullmods into account), and recomputes certain fleetwide stats (such as burn level, various capacities, total fleet points, etc). This happens automatically, i.e. when you add or remove a fleet member, the fleet will be marked as needing to be synced, and will be synced next time an operation that requires the synced data is called.