taleden / EDSY

EDSY is a web-based ship outfitting simulator tool for the game Elite Dangerous
22 stars 7 forks source link

Incorrect utility hardpoint slots in SLEF export #30

Open lanzz opened 3 weeks ago

lanzz commented 3 weeks ago

I've noticed that when I export SLEF from EDSY to Inara, sometimes utility modules will be missing. Digging around a bit revealed that EDSY will generate the SLEF with malformed tiny hardpoint slot names like "Slot": "TinyHardpoint21" instead of "Slot": "TinyHardpoint3", and Inara (understandably) does not know what to do with those.

Here's a sample malformed SLEF I got today from EDSY v4.8.18.1 (I've just reformatted it for clarity); you'll see that tiny hardpoints 1 and 2 are fine, but then instead of 3, 4, 5 and 6 there's 21, 31, 41 and 51.

[
    {
        "header": {
            "appName": "EDSY",
            "appVersion": 408189901,
            "appURL": "https://edsy.org/#/L=HF6YDYv509LC0S00,HQZI07H_W0HQZI07P_W0HQZI07P_W0EkiI03P_W0EjSI03O_W0EjSI03O_W0,DBwI49L_W0DBwI49L_W0DBw20DBw20DBw20DBw20,9opH45I_W0AAAH47I_W0APoG45I_W0AdtG45J_W0AsO14B8gG03L_W0BMkH45G_W0Bb614,,7UJH07K_W015OG05I_W013qG05I_W012GG05I_W010iG0BJ_W00nG34,TFS_0Justice_0of_0Toren,LA_D206"
        },
        "data": {
            "event": "Loadout",
            "Ship": "python_nx",
            "ShipName": "TFS Justice of Toren",
            "ShipIdent": "LA-206",
            "HullValue": 56812626,
            "ModulesValue": 234724116,
            "UnladenMass": 866.9,
            "CargoCapacity": 0,
            "MaxJumpRange": 25.055433,
            "FuelCapacity": {
                "Main": 16,
                "Reserve": 0.83
            },
            "Rebuy": 14576837,
            "Modules": [
                {
                    "Slot": "CargoHatch",
                    "Item": "modularcargobaydoor",
                    "On": true,
                    "Priority": 0
                },
                {
                    "Slot": "LargeHardpoint1",
                    "Item": "hpt_slugshot_gimbal_large",
                    "On": true,
                    "Priority": 2,
                    "Value": 1751040,
                    "Engineering": {
                        "BlueprintName": "Weapon_HighCapacity",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_corrosive_shell",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 12.8,
                                "OriginalValue": 8
                            },
                            {
                                "Label": "PowerDraw",
                                "Value": 1.86,
                                "OriginalValue": 1.55
                            },
                            {
                                "Label": "DamagePerSecond",
                                "Value": 239.365079,
                                "OriginalValue": 215.428571
                            },
                            {
                                "Label": "RateOfFire",
                                "Value": 5.291005,
                                "OriginalValue": 4.761905
                            },
                            {
                                "Label": "AmmoClipSize",
                                "Value": 6,
                                "OriginalValue": 3
                            },
                            {
                                "Label": "AmmoMaximum",
                                "Value": 288,
                                "OriginalValue": 180
                            }
                        ]
                    }
                },
                {
                    "Slot": "LargeHardpoint2",
                    "Item": "hpt_slugshot_gimbal_large",
                    "On": true,
                    "Priority": 2,
                    "Value": 1751040,
                    "Engineering": {
                        "BlueprintName": "Weapon_HighCapacity",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_screening_shell",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 12.8,
                                "OriginalValue": 8
                            },
                            {
                                "Label": "PowerDraw",
                                "Value": 1.86,
                                "OriginalValue": 1.55
                            },
                            {
                                "Label": "DamagePerSecond",
                                "Value": 239.365079,
                                "OriginalValue": 215.428571
                            },
                            {
                                "Label": "RateOfFire",
                                "Value": 5.291005,
                                "OriginalValue": 4.761905
                            },
                            {
                                "Label": "AmmoClipSize",
                                "Value": 6,
                                "OriginalValue": 3
                            },
                            {
                                "Label": "AmmoMaximum",
                                "Value": 360,
                                "OriginalValue": 180
                            },
                            {
                                "Label": "ReloadTime",
                                "Value": 2.5,
                                "OriginalValue": 5
                            }
                        ]
                    }
                },
                {
                    "Slot": "LargeHardpoint3",
                    "Item": "hpt_slugshot_gimbal_large",
                    "On": true,
                    "Priority": 2,
                    "Value": 1751040,
                    "Engineering": {
                        "BlueprintName": "Weapon_HighCapacity",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_screening_shell",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 12.8,
                                "OriginalValue": 8
                            },
                            {
                                "Label": "PowerDraw",
                                "Value": 1.86,
                                "OriginalValue": 1.55
                            },
                            {
                                "Label": "DamagePerSecond",
                                "Value": 239.365079,
                                "OriginalValue": 215.428571
                            },
                            {
                                "Label": "RateOfFire",
                                "Value": 5.291005,
                                "OriginalValue": 4.761905
                            },
                            {
                                "Label": "AmmoClipSize",
                                "Value": 6,
                                "OriginalValue": 3
                            },
                            {
                                "Label": "AmmoMaximum",
                                "Value": 360,
                                "OriginalValue": 180
                            },
                            {
                                "Label": "ReloadTime",
                                "Value": 2.5,
                                "OriginalValue": 5
                            }
                        ]
                    }
                },
                {
                    "Slot": "LargeHardpoint4",
                    "Item": "hpt_beamlaser_turret_large",
                    "On": true,
                    "Priority": 2,
                    "Value": 19399600,
                    "Engineering": {
                        "BlueprintName": "Weapon_Efficient",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_thermal_vent",
                        "Modifiers": [
                            {
                                "Label": "PowerDraw",
                                "Value": 0.7852,
                                "OriginalValue": 1.51
                            },
                            {
                                "Label": "DamagePerSecond",
                                "Value": 17.8064,
                                "OriginalValue": 14.36
                            },
                            {
                                "Label": "DistributorDraw",
                                "Value": 1.9305,
                                "OriginalValue": 3.51
                            },
                            {
                                "Label": "ThermalLoad",
                                "Value": 2.044,
                                "OriginalValue": 5.11
                            }
                        ]
                    }
                },
                {
                    "Slot": "MediumHardpoint1",
                    "Item": "hpt_beamlaser_turret_medium",
                    "On": true,
                    "Priority": 2,
                    "Value": 2099900,
                    "Engineering": {
                        "BlueprintName": "Weapon_Efficient",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_thermalshock",
                        "Modifiers": [
                            {
                                "Label": "PowerDraw",
                                "Value": 0.4836,
                                "OriginalValue": 0.93
                            },
                            {
                                "Label": "DamagePerSecond",
                                "Value": 9.85428,
                                "OriginalValue": 8.83
                            },
                            {
                                "Label": "DistributorDraw",
                                "Value": 1.188,
                                "OriginalValue": 2.16
                            },
                            {
                                "Label": "ThermalLoad",
                                "Value": 1.412,
                                "OriginalValue": 3.53
                            }
                        ]
                    }
                },
                {
                    "Slot": "MediumHardpoint2",
                    "Item": "hpt_beamlaser_turret_medium",
                    "On": true,
                    "Priority": 2,
                    "Value": 2099900,
                    "Engineering": {
                        "BlueprintName": "Weapon_Efficient",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_thermalshock",
                        "Modifiers": [
                            {
                                "Label": "PowerDraw",
                                "Value": 0.4836,
                                "OriginalValue": 0.93
                            },
                            {
                                "Label": "DamagePerSecond",
                                "Value": 9.85428,
                                "OriginalValue": 8.83
                            },
                            {
                                "Label": "DistributorDraw",
                                "Value": 1.188,
                                "OriginalValue": 2.16
                            },
                            {
                                "Label": "ThermalLoad",
                                "Value": 1.412,
                                "OriginalValue": 3.53
                            }
                        ]
                    }
                },
                {
                    "Slot": "TinyHardpoint1",
                    "Item": "hpt_shieldbooster_size0_class5",
                    "On": true,
                    "Priority": 2,
                    "Value": 252900,
                    "Engineering": {
                        "BlueprintName": "ShieldBooster_Resistive",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_shieldbooster_chunky",
                        "Modifiers": [
                            {
                                "Label": "Integrity",
                                "Value": 42.24,
                                "OriginalValue": 48
                            },
                            {
                                "Label": "PowerDraw",
                                "Value": 1.5,
                                "OriginalValue": 1.2
                            },
                            {
                                "Label": "DefenceModifierShieldMultiplier",
                                "Value": 26,
                                "OriginalValue": 20
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": 15.34,
                                "OriginalValue": 0
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": 15.34,
                                "OriginalValue": 0
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": 15.34,
                                "OriginalValue": 0
                            }
                        ]
                    }
                },
                {
                    "Slot": "TinyHardpoint2",
                    "Item": "hpt_shieldbooster_size0_class5",
                    "On": true,
                    "Priority": 2,
                    "Value": 252900,
                    "Engineering": {
                        "BlueprintName": "ShieldBooster_Resistive",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_shieldbooster_chunky",
                        "Modifiers": [
                            {
                                "Label": "Integrity",
                                "Value": 42.24,
                                "OriginalValue": 48
                            },
                            {
                                "Label": "PowerDraw",
                                "Value": 1.5,
                                "OriginalValue": 1.2
                            },
                            {
                                "Label": "DefenceModifierShieldMultiplier",
                                "Value": 26,
                                "OriginalValue": 20
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": 15.34,
                                "OriginalValue": 0
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": 15.34,
                                "OriginalValue": 0
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": 15.34,
                                "OriginalValue": 0
                            }
                        ]
                    }
                },
                {
                    "Slot": "TinyHardpoint21",
                    "Item": "hpt_shieldbooster_size0_class5",
                    "On": true,
                    "Priority": 2,
                    "Value": 281000
                },
                {
                    "Slot": "TinyHardpoint31",
                    "Item": "hpt_shieldbooster_size0_class5",
                    "On": true,
                    "Priority": 2,
                    "Value": 281000
                },
                {
                    "Slot": "TinyHardpoint41",
                    "Item": "hpt_shieldbooster_size0_class5",
                    "On": true,
                    "Priority": 2,
                    "Value": 281000
                },
                {
                    "Slot": "TinyHardpoint51",
                    "Item": "hpt_shieldbooster_size0_class5",
                    "On": true,
                    "Priority": 2,
                    "Value": 281000
                },
                {
                    "Slot": "Armour",
                    "Item": "python_nx_armour_reactive",
                    "On": true,
                    "Priority": 1,
                    "Value": 143245787,
                    "Engineering": {
                        "BlueprintName": "Armour_HeavyDuty",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_armour_chunky",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 68.9,
                                "OriginalValue": 53
                            },
                            {
                                "Label": "DefenceModifierHealthMultiplier",
                                "Value": 398.96,
                                "OriginalValue": 250
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": 26.6125,
                                "OriginalValue": 25
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": -36.99,
                                "OriginalValue": -40
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": 21.72,
                                "OriginalValue": 20
                            }
                        ]
                    }
                },
                {
                    "Slot": "PowerPlant",
                    "Item": "int_powerplant_size6_class5",
                    "On": true,
                    "Priority": 1,
                    "Value": 11673990,
                    "Engineering": {
                        "BlueprintName": "PowerPlant_Boosted",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_powerplant_highcharge",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 22,
                                "OriginalValue": 20
                            },
                            {
                                "Label": "Integrity",
                                "Value": 93,
                                "OriginalValue": 124
                            },
                            {
                                "Label": "PowerCapacity",
                                "Value": 37.044,
                                "OriginalValue": 25.2
                            },
                            {
                                "Label": "HeatEfficiency",
                                "Value": 0.5,
                                "OriginalValue": 0.4
                            }
                        ]
                    }
                },
                {
                    "Slot": "MainEngines",
                    "Item": "int_engine_size6_class5",
                    "On": true,
                    "Priority": 0,
                    "Value": 14561577,
                    "Engineering": {
                        "BlueprintName": "Engine_Dirty",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_engine_overloaded",
                        "Modifiers": [
                            {
                                "Label": "Integrity",
                                "Value": 105.4,
                                "OriginalValue": 124
                            },
                            {
                                "Label": "PowerDraw",
                                "Value": 8.4672,
                                "OriginalValue": 7.56
                            },
                            {
                                "Label": "EngineOptimalMass",
                                "Value": 1260,
                                "OriginalValue": 1440
                            },
                            {
                                "Label": "EngineOptPerformance",
                                "Value": 145.6,
                                "OriginalValue": 100
                            },
                            {
                                "Label": "EngineHeatRate",
                                "Value": 2.288,
                                "OriginalValue": 1.3
                            }
                        ]
                    }
                },
                {
                    "Slot": "FrameShiftDrive",
                    "Item": "int_hyperdrive_overcharge_size5_class5",
                    "On": true,
                    "Priority": 0,
                    "Value": 5512266,
                    "Engineering": {
                        "BlueprintName": "FSD_LongRange",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_fsd_heavy",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 26,
                                "OriginalValue": 20
                            },
                            {
                                "Label": "Integrity",
                                "Value": 93.84,
                                "OriginalValue": 120
                            },
                            {
                                "Label": "PowerDraw",
                                "Value": 0.69,
                                "OriginalValue": 0.6
                            },
                            {
                                "Label": "FSDOptimalMass",
                                "Value": 1894.1,
                                "OriginalValue": 1175
                            }
                        ]
                    }
                },
                {
                    "Slot": "LifeSupport",
                    "Item": "int_lifesupport_size4_class2",
                    "On": true,
                    "Priority": 1,
                    "Value": 25533
                },
                {
                    "Slot": "PowerDistributor",
                    "Item": "int_powerdistributor_size6_class5",
                    "On": true,
                    "Priority": 0,
                    "Value": 3475690,
                    "Engineering": {
                        "BlueprintName": "PowerDistributor_HighFrequency",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_powerdistributor_fast",
                        "Modifiers": [
                            {
                                "Label": "WeaponsCapacity",
                                "Value": 45.6,
                                "OriginalValue": 50
                            },
                            {
                                "Label": "WeaponsRecharge",
                                "Value": 7.8416,
                                "OriginalValue": 5.2
                            },
                            {
                                "Label": "EnginesCapacity",
                                "Value": 31.92,
                                "OriginalValue": 35
                            },
                            {
                                "Label": "EnginesRecharge",
                                "Value": 4.8256,
                                "OriginalValue": 3.2
                            },
                            {
                                "Label": "SystemsCapacity",
                                "Value": 31.92,
                                "OriginalValue": 35
                            },
                            {
                                "Label": "SystemsRecharge",
                                "Value": 4.8256,
                                "OriginalValue": 3.2
                            }
                        ]
                    }
                },
                {
                    "Slot": "Radar",
                    "Item": "int_sensors_size5_class5",
                    "On": true,
                    "Priority": 1,
                    "Value": 1117188,
                    "Engineering": {
                        "BlueprintName": "Sensor_LongRange",
                        "Level": 5,
                        "Quality": 1,
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 40,
                                "OriginalValue": 20
                            },
                            {
                                "Label": "SensorTargetScanAngle",
                                "Value": 21,
                                "OriginalValue": 30
                            },
                            {
                                "Label": "Range",
                                "Value": 12180,
                                "OriginalValue": 6960
                            }
                        ]
                    }
                },
                {
                    "Slot": "FuelTank",
                    "Item": "int_fueltank_size4_class3",
                    "On": true,
                    "Priority": 1,
                    "Value": 22257
                },
                {
                    "Slot": "Slot01_Size6",
                    "Item": "int_shieldgenerator_size6_class5_strong",
                    "On": true,
                    "Priority": 1,
                    "Value": 24269300,
                    "Engineering": {
                        "BlueprintName": "ShieldGenerator_Reinforced",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_shield_health",
                        "Modifiers": [
                            {
                                "Label": "PowerDraw",
                                "Value": 7.161,
                                "OriginalValue": 6.51
                            },
                            {
                                "Label": "ShieldGenStrength",
                                "Value": 219.42,
                                "OriginalValue": 150
                            },
                            {
                                "Label": "BrokenRegenRate",
                                "Value": 2.88,
                                "OriginalValue": 3.2
                            },
                            {
                                "Label": "EnergyPerRegen",
                                "Value": 0.84,
                                "OriginalValue": 0.6
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": 49.9,
                                "OriginalValue": 40
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": -0.2,
                                "OriginalValue": -20
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": 58.25,
                                "OriginalValue": 50
                            }
                        ]
                    }
                },
                {
                    "Slot": "Slot02_Size4",
                    "Item": "int_hullreinforcement_size4_class2",
                    "On": true,
                    "Priority": 0,
                    "Value": 195000,
                    "Engineering": {
                        "BlueprintName": "HullReinforcement_HeavyDuty",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_hullreinforcement_chunky",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 11.2,
                                "OriginalValue": 8
                            },
                            {
                                "Label": "DefenceModifierHealthAddition",
                                "Value": 624.36,
                                "OriginalValue": 330
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": 15.034,
                                "OriginalValue": 2
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": 15.034,
                                "OriginalValue": 2
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": 15.034,
                                "OriginalValue": 2
                            }
                        ]
                    }
                },
                {
                    "Slot": "Slot03_Size3",
                    "Item": "int_hullreinforcement_size3_class2",
                    "On": true,
                    "Priority": 0,
                    "Value": 84000,
                    "Engineering": {
                        "BlueprintName": "HullReinforcement_HeavyDuty",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_hullreinforcement_chunky",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 5.6,
                                "OriginalValue": 4
                            },
                            {
                                "Label": "DefenceModifierHealthAddition",
                                "Value": 491.92,
                                "OriginalValue": 260
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": 14.6005,
                                "OriginalValue": 1.5
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": 14.6005,
                                "OriginalValue": 1.5
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": 14.6005,
                                "OriginalValue": 1.5
                            }
                        ]
                    }
                },
                {
                    "Slot": "Slot04_Size2",
                    "Item": "int_hullreinforcement_size2_class2",
                    "On": true,
                    "Priority": 0,
                    "Value": 36000,
                    "Engineering": {
                        "BlueprintName": "HullReinforcement_HeavyDuty",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_hullreinforcement_chunky",
                        "Modifiers": [
                            {
                                "Label": "Mass",
                                "Value": 2.8,
                                "OriginalValue": 2
                            },
                            {
                                "Label": "DefenceModifierHealthAddition",
                                "Value": 359.48,
                                "OriginalValue": 190
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": 14.167,
                                "OriginalValue": 1
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": 14.167,
                                "OriginalValue": 1
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": 14.167,
                                "OriginalValue": 1
                            }
                        ]
                    }
                },
                {
                    "Slot": "Slot05_Size1",
                    "Item": "int_hullreinforcement_size1_class2",
                    "On": true,
                    "Priority": 0,
                    "Value": 15000,
                    "Engineering": {
                        "BlueprintName": "HullReinforcement_Thermic",
                        "Level": 5,
                        "Quality": 1,
                        "ExperimentalEffect": "special_hullreinforcement_explosive",
                        "Modifiers": [
                            {
                                "Label": "DefenceModifierHealthAddition",
                                "Value": 120.175,
                                "OriginalValue": 110
                            },
                            {
                                "Label": "KineticResistance",
                                "Value": -9.45,
                                "OriginalValue": 0.5
                            },
                            {
                                "Label": "ThermicResistance",
                                "Value": 40.3,
                                "OriginalValue": 0.5
                            },
                            {
                                "Label": "ExplosiveResistance",
                                "Value": -7.261,
                                "OriginalValue": 0.5
                            }
                        ]
                    }
                },
                {
                    "Slot": "Slot06_Size1",
                    "Item": "int_supercruiseassist",
                    "On": true,
                    "Priority": 3,
                    "Value": 8208
                }
            ]
        }
    }
]

My guess is that string concatenation happens in a place where numeric addition is intended. I've only ever seen it happen with utility slots, never with any other kind of slot so far.