Is there any way to change characteristics of a wing in combat, such as reducing wing size?
I can do it using applyEffectsBeforeShipCreation, but only with the wingspec which affects every LPC
I think you *might* be able to use bay.setExtraDeploymentLimit(<negative value>). That may not work, though - if it doesn't then you probably can't.
Also, is it possible to give a ship fighter AI? It seems like part of what's needed for the FighterAI constructor is obfuscated
(The parameters are, IIRC, Ship, and .. 'L') so i'm guessing this is a no, but figured i'd double check
I don't think so, and if you could, that'd cause all sorts of problems. For example it wouldn't avoid ship collisions, might try to find a carrier to land on, and so on.
question
i have 2 small missile weapons with unlimited ammo - one for HE damage and one for KN - both have DO_NOT_AIM, DO_NOT_CONSERVE hints
i have a ship that can mount three small missile hardpoints and one universal turret
that ship has mounted 2 KN small missiles and one HE - all in the same group, linked
when ship is on autopilot it will only ever fire _one_ missile weapon at a time, and at about 50% of it's max fire rate
but as soon as i take control of the ship those three weapons all start to fire at maximum fire rate
why does this happen ?
I'm not really clear on what you're saying - what do you mean by "all start to fire at maximum fire rate"? Like... they wouldn't just do that on their own, so maybe you mean you're able to fire them that way?
Regardless, though, hmm... if the group is linked and you're 100% sure of that, the only way for one of the weapons to fire individually is if the group is on autofire. But that wouldn't explain why it's firing at half the rate - though exactly when it fires would be up to the autofire AI at that point. However, it should be easy for you to see whether the group is on autofire, what group the ship AI has selected, and so on. There's a lot more info here to be had.
Is there an easy way to make the player be able to make unlimited permanent hullmods while limiting the number on AI fleets?
Change "maxPermanentHullmods" to something high! For AI fleets, it's not limited by that value but rather by some directives at fleet creation.
i have a hullmod that depends on some FleetMemberAPI values, and to get that i would usually use MutableShipStatsAPI.getFleetMember(). when i added a "affectsOPCosts" override set to true, the method applyEffectsBeforeShipCreation was called twice, and the second time has a MutableShipStatsAPI that doesn't have a fleet member assigned to it. (as a side note: i'm pretty sure this MutableShipStatsAPI object is the one that you can find under ShipVariantAPI.getStatsForOpCosts())
is there a way to easily get the fleetmember that doesn't involve looping through every single ship in a fleet and its variant and all of its modules' variants to look for a specific MutableShipStatsAPI object? if i have the hullmod on a lot of ships (tried with 8 ) the game noticably hitches whenever these hullmods run applyEffectsBeforeShipCreation because of the method.
this is what i needed to do as a result, and what also causes the hitching
Hmm - have you considered just bailing out if stats.getFleetMember() and stats.getEntity() both return null? IIRC that would only happen in some edge cases and it's more of a safety precaution to check for this rather than a case where it's required for things to work.
(I'm not sold on this code causing hitching, btw, especially not if we're just talking about the player's fleet. The code you've pasted just isn't doing a substantial amount of work - it *might* be a problem if like several hundred ships in non-player-fleets all had this mod and had it applied at the same time, but otherwise? It's hard to see.
It's just looping over the ships in the player's fleet, and doing a bit of additional looping within that only for ships with modules, and that just wouldn't amount to much. I mean, I still wouldn't do that without a good reason! But the game does tons of things much heavier than this every frame.)
i'm having an issue now where the fleet screen shows i have free OP after applying the hullmod through a dialog, but clicking into the refit screen does not show the free OP
Not sure about this one. I vaguely recall running into something similar myself in the last month or so and (probably?) fixing it but the details escape me.