Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: [0.9a-RC10] CTD when abandoning station-only markets  (Read 2832 times)

Dal

  • Commander
  • ***
  • Posts: 155
    • View Profile
[0.9a-RC10] CTD when abandoning station-only markets
« on: January 12, 2019, 04:20:51 PM »

Hello. It appears that the game does not support abandoning space colonies. This is exposed in Nexerelin games when taking over size 3 stations such as Genocide outpost (Legacy of Arkgneisis) and Lance Base (Shadowyards?). The game does not have any issue when these colonies decivilize or are otherwise destroyed.

Code
[Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ClassCastException: com.fs.starfarer.campaign.CustomCampaignEntity cannot be cast to com.fs.starfarer.campaign.CampaignPlanet
java.lang.ClassCastException: com.fs.starfarer.campaign.CustomCampaignEntity cannot be cast to com.fs.starfarer.campaign.CampaignPlanet
at com.fs.starfarer.campaign.ui.MarketConditionsWidget.create(Unknown Source)
at com.fs.starfarer.campaign.ui.MarketConditionsWidget.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.advance(Unknown Source)
at com.fs.starfarer.ui.donew.advanceImpl(Unknown Source)
at com.fs.starfarer.campaign.ui.K.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.advance(Unknown Source)
at com.fs.starfarer.ui.donew.advanceImpl(Unknown Source)
at com.fs.starfarer.campaign.ui.o0OO.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.advance(Unknown Source)
at com.fs.starfarer.ui.donew.advanceImpl(Unknown Source)
at com.fs.starfarer.coreui.O00o.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.advance(Unknown Source)
at com.fs.starfarer.ui.donew.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.newui.D.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.advance(Unknown Source)
at com.fs.starfarer.ui.donew.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.while.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.newui.J.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.advance(Unknown Source)
at com.fs.starfarer.ui.donew.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.while.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.newui.U.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.advance(Unknown Source)
at com.fs.starfarer.ui.donew.advanceImpl(Unknown Source)
at com.fs.starfarer.ui.Q.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$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

PS: Can we please please please be allowed to replace the MarketCMD class? I so dearly want custom raid logic. Or just unprotect the members of TempData so we can use our own classes, that'd be fine too.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #1 on: January 13, 2019, 02:43:44 PM »

Thank you - "fixed" this by making station markets not be able to be abandoned, for the time being. Will have to take a closer look at some point.

PS: Can we please please please be allowed to replace the MarketCMD class? I so dearly want custom raid logic. Or just unprotect the members of TempData so we can use our own classes, that'd be fine too.

You already can, in a way - this requires changing the relevant rules that call it to call another command instead.
Logged

Shad

  • Commander
  • ***
  • Posts: 206
    • View Profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #2 on: January 13, 2019, 03:36:44 PM »

Thank you - "fixed" this by making station markets not be able to be abandoned, for the time being. Will have to take a closer look at some point.
Kind of related, if station-only markets decivilise, you cannot settle them or do loot them for tech (like you can with deciv regular markets).

Come to think of it how do deciv stations work? With regular planets, it's collapse of central authoriity, but people still live therre (from fallout/madmax-style to actual non-spaceflight local citystates). But a "decivilised" Garnir or Kanta's Den is... slightly more wild than usual?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #3 on: January 13, 2019, 04:41:48 PM »

A decivilized station like that turns into an abandonded station. IIRC it doesn't have the "decivilized" condition.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #4 on: January 13, 2019, 05:55:59 PM »

Looked into this a bit more and did a proper fix; the station turns into an "abandoned station" and can not be re-colonized (since station colonizing isn't supported).
Logged

Dal

  • Commander
  • ***
  • Posts: 155
    • View Profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #5 on: January 14, 2019, 10:08:57 AM »

Quote
PS: Can we please please please be allowed to replace the MarketCMD class? I so dearly want custom raid logic. Or just unprotect the members of TempData so we can use our own classes, that'd be fine too.

You already can, in a way - this requires changing the relevant rules that call it to call another command instead.

Histidine and I attempted to do this separately at different points. It's simple to implement the MarketCMD alternative, but the raid listener demands using only MarketCMD.TempData, which is inaccessible to other classes. Unless I missed something it's not possible to implement custom raids using the vanilla system. If we create scripted-only raids will everything else function as expected?
/sorryforOT
« Last Edit: January 14, 2019, 10:12:59 AM by Dal »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #6 on: January 14, 2019, 10:16:21 AM »

Oh, oops - that's an oversight! Made all the members in TempData public, didn't realize it was used/visible outside the MarketCMD implementation.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #7 on: January 14, 2019, 08:54:59 PM »

Oh, oops - that's an oversight! Made all the members in TempData public, didn't realize it was used/visible outside the MarketCMD implementation.
Thanks, this will be helpful :)

One more bit, if you haven't done it already: MarketCMD also has a few private methods (relating to the bombardment dialog options, IIRC) that should be made protected.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: [0.9a-RC10] CTD when abandoning station-only markets
« Reply #8 on: January 14, 2019, 09:09:48 PM »

Ah, another oversight :) Made everything protected.
Logged