Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patchwork armor may raise exceptions #4

Closed
juk0de opened this issue Jul 14, 2024 · 0 comments
Closed

Patchwork armor may raise exceptions #4

juk0de opened this issue Jul 14, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@juk0de
Copy link
Owner

juk0de commented Jul 14, 2024

Description
Patchwork armor currently raises an exception because the entries may contain "subkeys" (nested keys) that describe the armor type for each location, e. g.:

Armor:Patchwork
LA Armor:Reactive(Inner Sphere):26
RA Armor:Reactive(Inner Sphere):26
LT Armor:Standard(IS/Clan):26
RT Armor:Standard(IS/Clan):26
CT Armor:Standard(IS/Clan):38
HD Armor:Standard(IS/Clan):9
LL Armor:Reactive(Inner Sphere):34
RL Armor:Reactive(Inner Sphere):34
RTL Armor:8
RTR Armor:8
RTC Armor:12

Note that not all locations have a type subkey. In that case it's probably (hopefully?) safe to assume that it means "Standard(IS/Clan)".

Example mech: Zeus X ZEU-X.
Error raised: ValueError: invalid literal for int() with base 10: 'Reactive(Inner Sphere)'

Possible Solution
Restructure the armor section and group by location:

"armor": {
    "type": "Patchwork",
    "left_arm": {
        "pips": 26,
        "type": "Reactive(Inner Sphere)"
    [...]
    "left_torso": {
        "front": {
            "pips": 15,
            "type": "Standard(IS/Clan)"
        }
        "rear": {
            "pips": 5,
            "type":  "Standard(IS/Clan)"
    },
    [...]
},

In order to keep the JSON layout consistent, the structure section should be changed accordingly (i.e. remove the structure.pips subsection).

This solution breaks compatibility because it modifies the JSON data structure.

@juk0de juk0de self-assigned this Jul 14, 2024
@juk0de juk0de added this to the Convert all Biped Mechs milestone Jul 14, 2024
juk0de pushed a commit that referenced this issue Jul 15, 2024
juk0de pushed a commit that referenced this issue Jul 15, 2024
juk0de pushed a commit that referenced this issue Jul 15, 2024
@juk0de juk0de added the bug Something isn't working label Jul 17, 2024
juk0de pushed a commit that referenced this issue Jul 17, 2024
juk0de pushed a commit that referenced this issue Jul 17, 2024
@juk0de juk0de closed this as completed in 1eb6475 Jul 17, 2024
@juk0de juk0de changed the title Support patchwork armor Patchwork armor may raise exceptions Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant