hello there, first time posting on this forum.
i found a mod breaking error when it comes to using the 'findderelict' command. some mods spawn ships that apparently have 'null' variants which can break that specific command, leading to a nullpointer error in the console when used. as of this moment, i found some non-save breaking incompatibilities with 'secrets of the frontier' and 'kadur remnant', as those two spawn ships that have connections to questlines when interacted with. i had some very helpful assistance from the people over at the unofficial discord to discover this problem, and one of them created a very useful command to find the offending entities:
RunCode
import java.util.List;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import org.lazywizard.console.BaseCommand;
import org.lazywizard.console.CommonStrings;
import org.lazywizard.console.Console;
import com.fs.starfarer.api.impl.campaign.DerelictShipEntityPlugin;
for(StarSystemAPI system : Global.getSector().getStarSystems())
{
List<SectorEntityToken> entities = system.getAllEntities();
for(SectorEntityToken entity : entities)
{
if(entity.getCustomEntityType() != null && entity.getCustomEntityType().equals("wreck"))
{
String varID = ((DerelictShipEntityPlugin)entity.getCustomPlugin()).getData().ship.variantId;
if (varID == null) {
Console.showMessage("null variant on wreck in " + system.getBaseName());
}
}
}
}
LocationAPI hyperspace = Global.getSector().getHyperspace();
List<SectorEntityToken> entities = hyperspace.getAllEntities();
for(SectorEntityToken entity : entities)
{
if(entity.getCustomEntityType() != null && entity.getCustomEntityType().equals("wreck"))
{
String varID = ((DerelictShipEntityPlugin)entity.getCustomPlugin()).getData().ship.variantId;
if (varID == null) {
Console.showMessage("null variant on wreck in hyperspace");
}
}
}
according to the creator of this command, it searches the game for the ships that causes the nullpointer error and prints out the system where they are located.
specifically to SotF, i had to finish the questline to getting sierra (the Promise questline) to successfully remove her ship that was causing the problem.
for the kadur remnant thing, i didnt really have to participate in the questlines the offending ships are connected to, so either salvaging or rescuing the ships fixes the problem.
basically, the 'findderelict' command breaks when any mod adds ships that either are questline-specific or have 'null' variants.
credits to AtlanticAccent and Histidine over at the unoffificial discord for helping me find fixes to the problem.