Skip to content

Error Creating Custom SPAs #4825

Open
Open
@honestaly

Description

@honestaly

Prerequisites and Pre-Issue Checklist

  • I'm reporting the issue to the correct repository:

  • MegaMek

  • MegaMekLab

  • MekHQ

  • 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

  1. Add this to customspa.xml in the universe folder
    `
    &L3;
    &BOOLEAN;

    `
  2. 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>

  3. make sure both files have a blank line after the end xml tag.

  4. 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

customspa.zip

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    SPAAny issue relating to SPA's. Includes Bugs and RFESeverity: HighIssues described as high severity as per the new issue form

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions