106
Bug Reports & Support (modded) / [0.8a RC19-mod1] Planet-specific crash at game start
« on: May 14, 2017, 04:02:53 AM »
Setting the starting system (ngcSkipTutorialPicked in rules.csv) to Hybrasil and calling the following script from onNewGameAfterTimePass() causes the game to throw an NPE after the initial save:
After restarting the application, the save can be loaded and played as normal.
The issue appears oddly specific to some planets. Among the ones I tried: it doesn't happen with Tartessus, Daedalon, Kazeron, Barad, Jangala or Gilead. It occurs with the Interstellar Imperium mod's Byzantium (a terran planet).
It also doesn't happen if the setLocation line is commented out.
Code: java
package data.scripts.world;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import org.lwjgl.util.vector.Vector2f;
public class StartingSystem {
public static void execute()
{
SectorAPI sector = Global.getSector();
if (Global.getSector().isInNewGameAdvance()) return;
// teleport player to start on top of the planet
SectorEntityToken entity = sector.getEntityById("culann");
CampaignFleetAPI playerFleet = sector.getPlayerFleet();
Vector2f loc = entity.getLocation();
playerFleet.setLocation(loc.x, loc.y);
}
}
Code
54447 [Thread-5] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.campaign.CustomCampaignEntity.render(Unknown Source)
at com.fs.starfarer.campaign.BaseCampaignEntity.render(Unknown Source)
at com.fs.graphics.LayeredRenderer.render(Unknown Source)
at com.fs.starfarer.campaign.BaseLocation.render(Unknown Source)
at com.fs.starfarer.campaign.CampaignEngine.render(Unknown Source)
at com.fs.starfarer.campaign.CampaignState.render(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)
The issue appears oddly specific to some planets. Among the ones I tried: it doesn't happen with Tartessus, Daedalon, Kazeron, Barad, Jangala or Gilead. It occurs with the Interstellar Imperium mod's Byzantium (a terran planet).
It also doesn't happen if the setLocation line is commented out.