juk0de / mtf2json

Convert MegaMek's MTF format to JSON.
GNU General Public License v3.0
2 stars 0 forks source link

Critical slot values with subkeys are not correctly handled #15

Closed juk0de closed 5 days ago

juk0de commented 1 week ago

Some mechs have entries in the critical slots lines that contain subkeys.

Examples

ShadowHawk SHD-5S:

Head:
Life Support
Sensors
Cockpit
Cargo:size:0.5
Sensors
Life Support
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-

GroundPounder DVM-2 MiningMech:

Left Torso:
MechSprayer
MechSprayer
Liquid Storage:size:2.0
Liquid Storage:size:2.0
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-

Turkina U:

Right Torso:
Fusion Engine
Fusion Engine
CLDoubleHeatSink
CLDoubleHeatSink
CLDoubleHeatSink
CLDoubleHeatSink
Jump Jet
CLLRM15 (OMNIPOD)
CLLRM15 (OMNIPOD)
Clan Ammo LRM-15 (OMNIPOD)
Liquid Storage (OMNIPOD):SIZE:1.0 (ARMORED)
IS HarJel (OMNIPOD) (ARMORED)

Others:

mtf/mechs/biped/Ground_Pounder_DVM-2_MiningMech.mtf ('liquid_storage')                                                                                                          
mtf/mechs/biped/Gulon_GLN-1A_MiningMech.mtf ('liquid_storage')                                                                                                                  
mtf/mechs/biped/Hyena_HYN-KTO.mtf ('cargo')                                                                                                                                     
mtf/mechs/biped/Inquisitor_ITW-80_SecurityMech.mtf ('communications_equipment')                                                                                                 
mtf/mechs/biped/Jabberwocky_ConstructionMech_JAW-66D.mtf ('cargo')                                                                                                              
mtf/mechs/biped/MuckRaker_GMMM-2_MiningMech.mtf ('cargo')                                                                                                                       
mtf/mechs/biped/Pacifier_SecurityMech_CCU-36.mtf ('liquid_storage')                                                                                                             
mtf/mechs/biped/Pacifier_SecurityMech_CCU-40.mtf ('liquid_storage')                                                                                                             
mtf/mechs/biped/Powerman_SC_XV_HaulerMech.mtf ('cargo')                                                                                                                         
mtf/mechs/biped/Shadow_Hawk_SHD-5S.mtf ('cargo')                                                                                                                                
mtf/mechs/biped/StrongArm_SC_CV_ConstructionMech.mtf ('cargo')                                                                                                                  
mtf/mechs/biped/Turkina_U.mtf ('liquid_storage_(omnipod)')                                                                                                                                                                                                                                                
mtf/mechs/biped/Wing_Wraith_TR7.mtf ('cargo')                                                                                                                                   
mtf/mechs/biped/Wulfen_(Prime).mtf ('cargo_(omnipod)')

Currently, that leads to incomplete JSON data, e.g.:

    "head": {
      "1": "Life Support",
      "2": "Sensors",
      "3": "Cockpit"
    },

MegaMek handling

In MegaMek, those entries end up in two different locations: