Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Crach game  (Read 740 times)

ASSIMKO

  • Commander
  • ***
  • Posts: 158
    • View Profile
Crach game
« on: July 15, 2021, 04:04:23 PM »

The game closes and this is the log notification:

3799106 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NullPointerException
java.lang.NullPointerException
at data.scripts.hullmods.CHM_keruvim.applyEffectsBeforeShipCreation(CHM_keruvim.java:33)
at com.fs.starfarer.campaign.fleet.FleetMember.updateStats(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetMember.init(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetMember.<init>(Unknown Source)
at com.fs.starfarer.title.Object.M.o00000(Unknown Source)
at com.fs.starfarer.title.Object.M.render(Unknown Source)
at com.fs.starfarer.coreui.OO0o.super(Unknown Source)
at com.fs.starfarer.ui.newnew.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.e$Oo.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.v.renderImpl(Unknown Source)
at com.fs.starfarer.ui.e.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.v.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.v.renderImpl(Unknown Source)
at com.fs.starfarer.coreui.refit.F.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.v.renderImpl(Unknown Source)
at com.fs.starfarer.ui.newui.class.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.v.renderImpl(Unknown Source)
at com.fs.starfarer.ui.Oo0O.renderImpl(Unknown Source)
at com.fs.starfarer.ui.newui.K.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.v.renderImpl(Unknown Source)
at com.fs.starfarer.ui.Oo0O.renderImpl(Unknown Source)
at com.fs.starfarer.ui.newui.for.renderImpl(Unknown Source)
at com.fs.starfarer.ui.newui.Stringsuper.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.render(Unknown Source)
at com.fs.starfarer.ui.v.renderImpl(Unknown Source)
at com.fs.starfarer.ui.o00O.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.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source).

Does anyone know why?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Crach game
« Reply #1 on: July 15, 2021, 04:12:05 PM »

Looks like a crash in a hullmod whose script is named:
CHM_keruvim

(Not sure what mod CHM is, but it's not vanilla.)
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Crach game
« Reply #2 on: July 15, 2021, 04:14:53 PM »

CHM is Commissioned Crew, but since keruvim isn't a vanilla Faction, it's a mod Faction's.

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Crach game
« Reply #3 on: July 15, 2021, 08:11:44 PM »

Does anyone know why?
The bug line is
Code
        @Override
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getDynamic().getMod(Stats.SALVAGE_VALUE_MULT_MOD).modifyFlat(id, (Float) mag.get(hullSize) * 0.01f);
}
which looks fine except when referring to the hullSize
Code
	static {
mag.put(HullSize.FRIGATE, 1f);
mag.put(HullSize.DESTROYER, 2f);
mag.put(HullSize.CRUISER, 3f);
mag.put(HullSize.CAPITAL_SHIP, 5f);
}
Someone's mod is utilizing a ship that doesn't have a hullsize of any of these ship classes... for some weird reason. This bug doesn't seem to appear when the HullSize.FIGHTER and HullSize.DEFAULT is defined.. so. You can fix this by going to the said file and inserting in a
Code
		mag.put(HullSize.DEFAULT, 1f);
mag.put(HullSize.FIGHTER, 1f);
within the static table.

ASSIMKO

  • Commander
  • ***
  • Posts: 158
    • View Profile
Re: Crach game
« Reply #4 on: July 16, 2021, 01:30:52 PM »

Code
        @Override
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getDynamic().getMod(Stats.SALVAGE_VALUE_MULT_MOD).modifyFlat(id, (Float) mag.get(hullSize) * 0.01f);
}
which looks fine except when referring to the hullSize
Code
	static {
mag.put(HullSize.FRIGATE, 1f);
mag.put(HullSize.DESTROYER, 2f);
mag.put(HullSize.CRUISER, 3f);
mag.put(HullSize.CAPITAL_SHIP, 5f);
}

Ok. But what file are you talking about and where can I find it to make such a correction?
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Crach game
« Reply #5 on: July 16, 2021, 02:15:38 PM »

CHM_keruvim, which may be loose in a scripts folder in one of your mods (best possibility), or it could be compiled in a jar in one of your mod folders (hardest possibility).

ASSIMKO

  • Commander
  • ***
  • Posts: 158
    • View Profile
Re: Crach game
« Reply #6 on: July 17, 2021, 07:38:53 AM »

Thank you all for your attention. I tracked CHM_keruvim and it only exists in the Keruvim Shipyard mod folder. I opened the hullmod file and added:

                 mag.put(HullSize.DEFAULT, 1f);
                 mag.put(HullSize.FIGHTER, 1f);

   As suggested by Techpriest, and so far it hasn't cracked anymore. Thank you all.
Logged