MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
134 stars 171 forks source link

Enemy pilot SPAs not being loaded on save games where scenarios are already generated #3175

Open PhoenixHeart512 opened 2 years ago

PhoenixHeart512 commented 2 years ago

Environment

MekHQ 0.49.7, but also observed in 0.48 Windows 10 21H1 OpenJDK11 (downloaded from link on MegaMek install FAQ) Using customized AtB campaign ruleset (SPA's enabled, other changes, will attach)

Description

When a scenario is generated, enemy pilots are randomly given SPA's as normal. If you then save and load your MekHQ game (specifically, loading a save where the scenario exists) the SPA's will not be there anymore, seems like MekHQ is not keeping a list of pilot SPA's in the savegame data it has for the scenario?

Exact steps to repro:

  1. Be in a mission/contract with SPA's enabled in campaign options
  2. Scenarios generated on Monday
  3. Save game after scenarios are generated
  4. Launch scenario, verify enemy pilot SPA's (if none, maybe RNG just decided to not give them any, in which case generate new scenarios and repeat)
  5. Close MegaMek (saving on exit from megamek is not necessary)
  6. Close "you have become disconnected from the server" MekHQ popup box
  7. Load MekHQ game to the save made in step 3
  8. Launch scenario, observe that no enemy pilots have SPA's

Files

mekhq bug report files.zip

Thom293 commented 2 years ago

I believe this is related:

If you load my scenario that includes OpFor portraits and launch the battle from MHQ, the OpFor shows up with portraits and SPAs, etc. BUT if you load same scenario, save the game and close MHQ, and relaunch it, and the launch the battle into MM, the Opfor shows up with no portraits or SPAs.

Then, if you close that, and regenerate bot forces and relaunch, they show up as intended. So I guess the save games do not save Opfor SPA or Portraits and perhaps other things in already generated scenarios of any type?

Screenshot 2022-08-08 130349 Screenshot 2022-08-08 130742