I've got a feeling I've hit a dead end here, but I'll ask anyway just in case.
I'm trying to make a hullmod that gives a ship shields. As in, it checks to see if they don't have shields, and if it doesn't, it gives them front-facing shields.
It's just a really quick edit of the Omni Shield Emitter script, but here's the code:
public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
ShieldAPI shield = ship.getShield();
if (shield == null) {
shield.setType(ShieldType.FRONT);
}
}
This returns a fatal: null error whenever you apply the hullmod to the ship ingame.
(Note: all ships with no shields have non-zero dummy values for shield-related things in ship_data.csv.)
So, is there any way to get around this crash, or am I out of luck?