Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: com.fs.starfarer.loading.specs.String cannot be cast to com.fs.starfarer.loading  (Read 3504 times)

stross

  • Ensign
  • *
  • Posts: 10
    • View Profile

I would get a crash and error message when I deploy two of my custom ships in combat. But notably when they actually engage an enemy, here is the logs

287927 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ClassCastException: com.fs.starfarer.loading.specs.String cannot be cast to com.fs.starfarer.loading.specs.public
java.lang.ClassCastException: com.fs.starfarer.loading.specs.String cannot be cast to com.fs.starfarer.loading.specs.public
   at com.fs.starfarer.combat.ai.attack.AttackAIModule.super(Unknown Source)
   at com.fs.starfarer.combat.ai.attack.AttackAIModule.super(Unknown Source)
   at com.fs.starfarer.combat.ai.attack.AttackAIModule.super(Unknown Source)
   at com.fs.starfarer.combat.ai.BasicShipAI.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatState.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)
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile

With my limited java experience, it looks like a variable you've got set up is being referenced as the wrong type? Not sure though.

More importantly, this should probably be under Bug Reports & Support (Modded) - http://fractalsoftworks.com/forum/index.php?board=14.0
Logged

stross

  • Ensign
  • *
  • Posts: 10
    • View Profile

With my limited java experience, it looks like a variable you've got set up is being referenced as the wrong type? Not sure though.

More importantly, this should probably be under Bug Reports & Support (Modded) - http://fractalsoftworks.com/forum/index.php?board=14.0

So it looks like the game doesn't like my oversized laser

Its basically the state support beam with a resized beam and fielding two ships with the same weapon causes the crash

https://imgur.com/a/4z1gh
« Last Edit: December 28, 2017, 10:35:18 AM by stross »
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile

'Eck that's a big laser.  ;)

What might be helpful is if you were to copy-paste in the file for this beam weapon (ie. the "[WEAPON].wpn" file), but given that the error the game is throwing is a java error (not a json or null error) I'm struggling to think how that could be the case.

What sort of advanced... stuff... do you have alongside this weapon? As in, onHitEffect scripts and the like? Any of those, and if so what do they do?
Logged

stross

  • Ensign
  • *
  • Posts: 10
    • View Profile

Its really just a copypaste beam weapon with modified damage values in the spreadsheet. I managed to fix the issue by copypasting a tachyon lance. Thanks you so much for the help though
Logged

NightKev

  • Commander
  • ***
  • Posts: 104
    • View Profile

More importantly, this should probably be under Bug Reports & Support (Modded) - http://fractalsoftworks.com/forum/index.php?board=14.0
Alex moved this thread here from there, so I think not. :P
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile

More importantly, this should probably be under Bug Reports & Support (Modded) - http://fractalsoftworks.com/forum/index.php?board=14.0
Alex moved this thread here from there, so I think not. :P

That recommendation of mine was before it was moved.  :P
Logged

TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile

I'd consider a ClassCastException occurring inside obfuscated SS code to be a bug in the base game's modding API; allowing an invalid type parameter either due to flawed method signature or insufficient runtime type checking.
Logged