Not sure if this belongs in the modded support, since this seems to be a bug related to writing a mod?
I have a replacement for NGCAddStandardStartingScript.java in my (total conversion) mod's jar file, but it does not appear to get called. Instead, the base game's NGCAddStandardStartingScript is getting called.
I am trying to rebuild the sector entirely. I can successfully remove almost all the systems, but Galatia is a minor problem, since it is used by the tutorial and NGCAddStandardStartingScript (and rules.csv). When I remove Galatia from SectorGen (and economy.json), I get the following error:
55054 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.api.impl.campaign.rulecmd.NGCAddStandardStartingScript$1.run(NGCAddStandardStartingScript.java:89)
at com.fs.starfarer.campaign.save.CampaignGameManager.super(Unknown Source)
at com.fs.starfarer.title.TitleScreenState.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.N.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.O0oO.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.if.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.supernew.o00000(Unknown Source)
at com.fs.starfarer.ui.oooO.processInput(Unknown Source)
at com.fs.starfarer.ui.Stringsuper.o00000(Unknown Source)
at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
This makes sense, since the code being run in com.fs.starfarer.api.impl.campaign.rulecmd.NGCAddStandardStartingScript.java is as follows:
88 StarSystemAPI system = Global.getSector().getStarSystem("galatia");
89 PlanetAPI ancyra = (PlanetAPI) system.getEntityById("ancyra");
Since I removed Galatia,
system is null, so I get a NPE.
However, inside my jar file I have a replacement to com.fs.starfarer.api.impl.campaign.rulecmd.NGCAddStartingStandardScript.java. From my understanding, anything in my jar file should replace the game's version of the file (as data.scripts.world.SectorGen.java gets replaced by my jar file). This does not appear to be the case, since in my modified version of NGCAddStartingStandardScript, line 89 is just a curly brace, and the game keeps crashing with the same error (same line).
My workaround is to create a NGCAddStartingStandardScript2.java, which is an exact copy of my version of NGCAddStartingStandardScript.java, and change my rules.csv to call this instead of NGCAddStartingStandardScript. This is working, which implies to me that NGCAddStartingStandardScript is not getting replaced by my jar file.
I can provide the source files to my mod if needed.