Hello, once again I find myself trying to be too clever for my own good.
I'm currently trying to experiment with a hullmod that converts Phase Ships into conventional omni-shielded warships, where the stats of the shield is dependent on the stats of the original phase cloak. I'm not entirely sure if it's actually feasible in practice (in terms of gameplay balance), but that's why I want to try it out.
I know going from shielded to phase is practically impossible since that requires glow sprites that normal ships don't have, but I've been having issues with getting the omni-shield part working in the first place, so I'm beginning to wonder if it's just my lack of experience or if going from phase->shields is also impossible.
I currently want to try making the shield's upkeep directly dependent on the ship's original cloak upkeep as the shield upkeep, use activation cloak cost efficiency (which is Activation Cost/Vent Rate iirc?) as part of a function to calculate shield efficiency, and the cloak cooldown time (or some other metric) to calculate shield arc (which doesn't matter much in Vanilla but might be relevant with mod-added ships).
The relevant part of the script is below, in the "ApplyEffectsAfterShipCreation" section:
(The exact formulas used for the shield attributes are WIP)
When used on an actual phase ship, it looks like this:
Some of the values look odd, but the new system stats in the UI appear as if it were a shielded vessel now. However, the ship still functions like a phase ship when tested in battle; right clicking causes the modified Afflictor to phase instead of activate a shield despite the presence of the hullmod. I thought it had something to do with the ridiculous flux upkeep from my messed-up formula, but when I switched it manually to a reasonable number (ex: 0.5f -> 50% shield dissipation), the Afflictor still Phases instead of Shields. The shield part not working at all is currently the biggest roadblock, I'm not sure what I'm overlooking here, could I get a few pointers on how to get that part functioning (if it's possible at all)?
Additionally to that, is there a way to grab the
base value (unmodified by officers, other hullmods, caps/vents, scripted battlefield shenanigans, etc) of attributes off a ship, such as:
-Phase Activation Cost & Phase Upkeep
-Flux Dissipation (can't find anything in the FluxTrackerAPI or ShipAPI, perhaps I'm looking in the wrong place?)
-Phase Cooldown (iirc there's a skill that reduces this, and I'd prefer that skills or hullmods not accidentally buff (or nerf) the shield conversion)
-[OPTIONAL] Getting the efficiencies directly, if possible (a lot of the ship.csv data for phase stuff is written as ratios already, so that'd allow me to simplify stuff slightly if I can pull them)
The current method I'm using from the ShipAPI grabs the current flux stats, which means currently means when I adjust certain attributes by, say, adding flux or vents, the shield's efficiency will change with it, which is extremely amusing but not intentional. I was hoping there was a better way that I'm overlooking to do this, which is less volatile to external changes from other hullmods and officers?