Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Officerlevel Nullpointer - the magic number  (Read 2976 times)

Camael

  • Lieutenant
  • **
  • Posts: 70
    • View Profile
Officerlevel Nullpointer - the magic number
« on: December 15, 2015, 07:25:45 PM »

Want to max out officers, use mods and on top of that not have null pointer errors due to that? Max level at 3 Skillpoints per level is 36, at more skill points just do the math: (((10-1)/officerskillincreaseperlevel rounded up to the next full number), +1 (for initial skill acquisition)) x 9 (7 combat skills + aptitude + gunnery implants)

Modified at settings.json in this line

"officerSkillIncreasePerLevel":3,
   "officerMaxLevel":20,

The bug that creeps up otherwise looks about like this, with the campaign event spawning some (usually mod fleet) of Your (involuntary...) choice:



[Thread-5] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.campaign.CharacterStats.getStatsEffects(Unknown Source)
   at com.fs.starfarer.campaign.CharacterStats.refreshCharacterStatsEffects(Unknown Source)
   at com.fs.starfarer.campaign.CharacterStats.increaseSkill(Unknown Source)
   at com.fs.starfarer.rpg.OfficerData.levelUp(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.events.OfficerManagerEvent.createOfficer(OfficerManagerEvent.java:194)
   at com.fs.starfarer.api.impl.campaign.fleets.FleetFactoryV2.addCommanderAndOfficer s(FleetFactoryV2.java:250)
   at com.fs.starfarer.api.impl.campaign.fleets.FleetFactoryV2.createFleet(FleetFactoryV2.java:168)
   at data.scripts.campaign.events.II_SiegeEvent.advance(II_SiegeEvent.java:373)
   at com.fs.starfarer.campaign.events.CampaignEventManager.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignState.advance(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$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


System seems unable to handle leveling up skilled-out officers for its fleets. Or rather, not levelling them up. Vanilla does not seem to spawn these fleets, and it's not related to anyone mod, so I posted it here for those who are interested or are searching frantically for this damning log-block. Took me ages to figure out it's the officer levels. Gah. Wish someone had written "be careful about officer levels when using mods that spawn uberfleets" somewhere in mods or general... oh, wait...

(Guess if the superior mental power of the player does not keep them in check, officers who know everything just become enlightened masters that love to collapse the universe to incentivise their diety (U-SA-AHH) not to be lazy and set the number to 256...)
« Last Edit: December 15, 2015, 08:07:46 PM by Camael »
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Officerlevel Nullpointer - the magic number
« Reply #1 on: December 15, 2015, 07:46:12 PM »

Wouldn't the max level actually be 36? 
Logged

Camael

  • Lieutenant
  • **
  • Posts: 70
    • View Profile
Re: Officerlevel Nullpointer - the magic number
« Reply #2 on: December 15, 2015, 08:07:31 PM »

Actually... yeah. Forgot that Officers start at level 1 with one skill point... not at level 0 with one skill point. Thanks for pointing that out...

(can't verify this though, my 5-seconds-before-this-particular-crash-savegame is gone now...)
Logged