Dilvish wrote:I'll grant that MaxMaxSomething is a not-so-appealing kind of name, but that seems hardly significant, and besides, couldn't we avoid that by just renaming MaxFuel as FuelCapacity, and then our new meter would be MaxFuelCapacity?
The point isn't the names, but the (to me) excessive number of meters to track (debatably) one thing. With weapons, it works nicely, in that there aren't many ways to increase current weapon strength without being in supply, so that getting the benefit of upgrades naturally happens when in supply range, and the actual value of the max meter for the weapon strength doesn't matter. If fuel is in practice different, and players are often getting increases to fuel while not in supply range, then to me the solution is to accept that and to either not upgrade fuel parts in that manner (previous or existing behaviour), or to phrase the description of how it works differently (and not to add another meter and associated support code to replicate the behaviour that happened automatically for a different part type).
And regarding the bit about adding the extra meter and dealing with using it, well, I'm not seeing the notable difference between that versus the meter you added for upgrading weapons.
It's not objectionable to me to add a max meter to something that doesn't have one, because there are already many cases in which there are current and max meters that work together in the existing game mechanics. To me, it's a choice between whether something just has an current value (eg. detection) or has separately tracked current and (max or target) meters. It's not just a trivial distinction either, as there are various cases in the code or UI that work with two paired meters or a single meter, but which aren't set up to also know what to do with three related meters.
It also seems to me we should keep in mind that all this same reasoning will likely apply to Fighter Hangar capacity if we were to add some way to upgrade that.
Hangar capacity should work just like other current/max meter pairs, similar to weapon strength. As long as ships aren't generating fighters when out of supply, then the existing game mechanics will work for getting upgrades by only replacing lost fighters when in the same situations that should, to a player, result in getting the benefits of upgrades... "Getting an upgrade" and "replenishing fighters" are effectively the same thing.
...looking through the scripts I find myself puzzled about the meaning for weapon SetMaxSecondaryStat since it only seems to apply to base values and not upgrades...
The part secondary stats have max and current values so that the standard upgrade mechanics can be applied to them if desired. I set up the engine to support this, so that any current or future parts (eg. Flak Cannon) that make use of a secondary stat to determine their behaviour would be possible to upgrade when in supply range.