Description
Prerequisites and Pre-Issue Checklist
-
I'm reporting the issue to the correct repository:
-
I've tested the issue against at least the latest MILESTONE version
-
I've asked on the MegaMek Discord about the error
-
I've reviewed the BattleTech rules and MegaMek documentation, and I've confirmed that something isn't working as intended.
-
I've searched the Github tracker and haven't found the issue listed
Severity *
High (Major Disruption): A major feature is broken or incorrect, but a workaround exists.
Brief Description *
Following the directions to add a custom SPA I modified the configuration files and it causes MekHQ to crash on loading or creating a campaign.
Steps to Reproduce
-
Add this to customspa.xml in the universe folder
`
`
&L3;
&BOOLEAN; -
add this to the end of defaultspa.xml in the same folder
<ability> <lookupName>alpha_strike_antagonizer</lookupName> <displayName>Antagonizer (AlphaStrike)</displayName> <desc>Antagonize Opponents Pg 92 Alpha Strike Commanders Edition</desc> <xpCost>10</xpCost> <skillPrereq> <skill>Piloting/Mech::Regular</skill> </skillPrereq> </ability>
-
make sure both files have a blank line after the end xml tag.
-
launched MekHQ 50.0 and tried to create a new campaign or load a campaign and got this error.
19:41:46,247 ERROR [mekhq.campaign.personnel.CustomOption] {SwingWorker-pool-2-thread-1}
mekhq.campaign.personnel.CustomOption.generateInstanceFromXML(CustomOption.java:172) - Error parsing custom ability alpha_strike_antogonizer
java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:678)
at java.base/java.lang.Integer.parseInt(Integer.java:786)
at mekhq.campaign.personnel.CustomOption.generateInstanceFromXML(CustomOption.java:151)
Operating System *
Windows 11
Java Version *
17.0.11
MegaMek Suite Version *
v0.50.0
Custom MegaMek Version
No response
Attach Files
Final Checklist
- I've checked to make sure that this issue has not already been filed
- I'm reporting only one issue in this ticket for clarity and focus