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
131 stars 168 forks source link

Issues rebuilding Infantry in MekHQ Mek Lab and Java Exception when attempting to add via GM Unit Purchase #4076

Open BoloNike opened 4 months ago

BoloNike commented 4 months ago

Environment

MekHQ v0.49.19 Build Date: 2024-04-19T14:55:55.057542200 Origin Project: MekHQ Java Vendor: Eclipse Adoptium Java Version: 11.0.22 Platform: Windows 10 10.0 (amd64) System Locale: en_US Total memory available to MekHQ: 16 GB

Description

Files

Only other "custom" items are graphical like camos. can link if necessary

BoloNike commented 4 months ago

Part of the issue may be related to where HQ seems to be pulling the information. HQ shows the designs in TW non-box but they were designed under experimental.

image image

I did reset the unit Cache in HQ but this does not seem to have had any effect

HammerGS commented 4 months ago

Part of the issue may be related to where HQ seems to be pulling the information. HQ shows the designs in TW non-box but they were designed under experimental.

image image

I did reset the unit Cache in HQ but this does not seem to have had any effect

Your Campaign looks like its 3026 so they would become Standard by then.

HammerGS commented 4 months ago

From the MM log:

15:40:28,649 ERROR [megamek.common.util.BuildingBlock] {AWT-EventQueue-0}
megamek.common.util.BuildingBlock.writeBlockFile(BuildingBlock.java:514) - Unable to save block file data\mechfiles\customs\Vehicle\Jump Platoon (Camo/IR Sniper/Grenade).blk
java.io.FileNotFoundException: data\mechfiles\customs\Vehicle\Jump Platoon (Camo\IR Sniper\Grenade).blk (The system cannot find the path specified)
    at java.base/java.io.FileOutputStream.open0(Native Method)
    at java.base/java.io.FileOutputStream.open(Unknown Source)
    at java.base/java.io.FileOutputStream.<init>(Unknown Source)
    at java.base/java.io.FileOutputStream.<init>(Unknown Source)
    at megamek.common.util.BuildingBlock.writeBlockFile(BuildingBlock.java:504)
    at megamek.common.loaders.BLKFile.encode(BLKFile.java:1236)
    at mekhq.campaign.parts.Refit.saveCustomization(Refit.java:1562)
    at mekhq.campaign.parts.Refit.begin(Refit.java:976)
    at mekhq.gui.CampaignGUI.refitUnit(CampaignGUI.java:1646)
    at mekhq.gui.MekLabTab.lambda$initTab$0(MekLabTab.java:122)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

From the MekHQ Log

5:49:56,100 ERROR [mekhq.MekHQ] {AWT-EventQueue-0}
mekhq.MekHQ.lambda$main$0(MekHQ.java:242) - Uncaught Exception Detected
java.util.NoSuchElementException
    at java.base/java.util.Vector.lastElement(Unknown Source)
    at mekhq.campaign.Campaign.clearGameData(Campaign.java:5695)
    at mekhq.campaign.unit.Unit.resetPilotAndEntity(Unit.java:3582)
    at mekhq.campaign.unit.Unit.addPilotOrSoldier(Unit.java:4397)
    at mekhq.campaign.unit.Unit.addPilotOrSoldier(Unit.java:4383)
    at mekhq.gui.menus.AssignUnitToPersonMenu.lambda$createPersonAssignmentMenus$34(AssignUnitToPersonMenu.java:646)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
OrbMonky commented 6 days ago

This may be related - when going in to refit infantry, nothing populates. image This creates problems both for refitting to standard variants, and custom variants, as the custom has to be deleted, cleared from cache by refreshing, and then rebuilt from scratch if you wanted to make a few custom infantry.