S-C-A-N / SCANsat

Real Scanning, Real Science, at Warp Speed!
219 stars 97 forks source link

ModuleSCANresourceScanner threw during OnStart: System.NullReferenceException #411

Open Gordon-Dry opened 2 years ago

Gordon-Dry commented 2 years ago

Trying to start the ModuleSCANresourceScanner it does not deploy the animation. On scene load it already threw this exception:

Module ModuleSCANresourceScanner threw during OnStart: System.NullReferenceException: Object reference not set to an instance of an object
  at SCANsat.SCAN_PartModules.SCANsat.getAltString () [0x0000c] in <5a779e0d8edb4222b7a30eefe694c524>:0 
  at SCANsat.SCAN_PartModules.SCANsat.OnStart (PartModule+StartState state) [0x0010b] in <5a779e0d8edb4222b7a30eefe694c524>:0 
  at SCANsat.SCAN_PartModules.ModuleSCANresourceScanner.OnStart (PartModule+StartState state) [0x00000] in <5a779e0d8edb4222b7a30eefe694c524>:0 
  at Part.ModulesOnStart () [0x00120] in <cd473063d3a2482f8d93d388d0c95035>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Module SCANresourceDisplay threw during OnStart: System.NullReferenceException: Object reference not set to an instance of an object
  at SCANsat.SCAN_PartModules.SCANresourceDisplay.OnStart (PartModule+StartState state) [0x000da] in <5a779e0d8edb4222b7a30eefe694c524>:0 
  at Part.ModulesOnStart () [0x00120] in <cd473063d3a2482f8d93d388d0c95035>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Module SCANresourceDisplay threw during OnStart: System.NullReferenceException: Object reference not set to an instance of an object
  at SCANsat.SCAN_PartModules.SCANresourceDisplay.OnStart (PartModule+StartState state) [0x000da] in <5a779e0d8edb4222b7a30eefe694c524>:0 
  at Part.ModulesOnStart () [0x00120] in <cd473063d3a2482f8d93d388d0c95035>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Module SCANresourceDisplay threw during OnStart: System.NullReferenceException: Object reference not set to an instance of an object
  at SCANsat.SCAN_PartModules.SCANresourceDisplay.OnStart (PartModule+StartState state) [0x000da] in <5a779e0d8edb4222b7a30eefe694c524>:0 
  at Part.ModulesOnStart () [0x00120] in <cd473063d3a2482f8d93d388d0c95035>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Module SCANresourceDisplay threw during OnStart: System.NullReferenceException: Object reference not set to an instance of an object
  at SCANsat.SCAN_PartModules.SCANresourceDisplay.OnStart (PartModule+StartState state) [0x000da] in <5a779e0d8edb4222b7a30eefe694c524>:0 
  at Part.ModulesOnStart () [0x00120] in <cd473063d3a2482f8d93d388d0c95035>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Excerpt of the affected part's MM cache entry:

UrlConfig
{
    parentUrl = Bluedog_DB/Parts/ProbeExpansion/AIMP/bluedog_AIMP_Magnetometer.cfg
    PART
    {
        name = bluedog_AIMP_Magnetometer
        module = Part
        author = CobaltWolf
        scale = 1
        rescaleFactor = 1
        node_attach = 0.0, 0.012836, 0.0, 0.0, 1.0, 0.0, 0
        TechRequired = survivability
        entryCost = 3000
        cost = 825
        category = Science
        subcategory = 0
        title = AIMP/IMP Folding Magnetometer Boom
        manufacturer = Goddard Space Flight Center
        description = This instrument is used for measuring a planet's magnetic field. It breaks magnetometer convention by folding up instead of telescoping. It's harder to fit within a fairing, but is lighter. Sufficiently crafty pilots can use it to right a lander that has tipped over, though this is not recommended. Used on the Explorer 18, 21, 28, 33 and 35 spacecraft.\n<#7FD5FF>Has SCANSAT Ore, Metallic Ore, Rare and Exotic Metals scanner</color>
        attachRules = 1,1,0,0,0
        mass = 0.002
        crashTolerance = 10
        maxTemp = 1200
        emissiveConstant = 0.85
        thermalMassModifier = 4.0
        angularDrag = 1
        dragModelType = default
        maximum_drag = 0.1
        minimum_drag = 0.1
        bulkheadProfiles = srf
        tags = mag magnetometer folding science magnetic AIMP IMP MIP
        radiatorMax = 0.51
        minimumRBMass = 0.002
        MODEL
        {
            model = Bluedog_DB/Parts/ProbeExpansion/AIMP/bluedog_AIMP_Magnetometer
        }
        MODULE
        {
            name = ModuleResourceScanner
            MaxAbundanceAltitude = 360000
            RequiresUnlock = True
            ScannerType = 0
            ResourceName = Ore
        }
        MODULE
        {
            name = ModuleCargoPart
            packedVolume = 10
        }
        MODULE
        {
            name = ModuleB9PartSwitch
            moduleID = meshSwitchAttach
            switcherDescription = Attachment
            switcherDescriptionPlural = Attachments
            affectDragCubes = False
            affectFARVoxels = False
            uiGroupName = partSwitch
            uiGroupDisplayName = Part Switch
            SUBTYPE
            {
                name = Top
                transform = Bottom
                attachNode = 0.0, 0.012836, 0.0, 0.0, 1.0, 0.0
            }
            SUBTYPE
            {
                name = Horizontal
                transform = Horizontal
                attachNode = 0.021354, 0.0, 0.0, 1.0, 0.0, 0.0
            }
        }
        MODULE
        {
            name = ModuleB9PartSwitch
            moduleID = meshSwitchDeploy
            switcherDescription = Deploy
            affectDragCubes = False
            affectFARVoxels = False
            uiGroupName = partSwitch
            uiGroupDisplayName = Part Switch
            SUBTYPE
            {
                name = Straight
                transform = Straight
            }
            SUBTYPE
            {
                name = Angled
                transform = Angled
            }
        }
        MODULE
        {
            name = ModuleB9PartSwitch
            moduleID = meshSwitchStyle
            switcherDescription = Style
            affectDragCubes = False
            affectFARVoxels = False
            uiGroupName = partSwitch
            uiGroupDisplayName = Part Switch
            SUBTYPE
            {
                name = AIMP
                transform = AIMP
            }
            SUBTYPE
            {
                name = IMP
                transform = IMP
            }
        }
        MODULE
        {
            name = Experiment
            experiment_id = bd_magScan
            data_rate = 0.00363756613756614
            ec_rate = 0.2
            anim_deploy = Log Magnetometer Data
            allow_shrouded = False
        }
        MODULE
        {
            name = ModuleSCANresourceScanner
            sensorType = 12583296
            fov = 3
            min_alt = 10000
            max_alt = 240000
            best_alt = 200000
            scanName = Metallic Scan
            RESOURCE
            {
                name = ElectricCharge
                rate = 0.04
            }
        }
        MODULE
        {
            name = SCANresourceDisplay
            sensorType = 128
            ResourceName = MetallicOre
        }
        MODULE
        {
            name = SCANresourceDisplay
            sensorType = 256
            ResourceName = Ore
        }
        MODULE
        {
            name = SCANresourceDisplay
            sensorType = 4194304
            ResourceName = RareMetals
        }
        MODULE
        {
            name = SCANresourceDisplay
            sensorType = 8388608
            ResourceName = ExoticMinerals
        }
        MODULE
        {
            name = GeometryPartModule
        }
        MODULE
        {
            name = FARAeroPartModule
        }
        MODULE
        {
            name = FARPartModule
        }
        MODULE
        {
            name = ShipEffectsCollisions
            num1 = 9
            num2 = 4.5
            num3 = 2.25
            num4 = 0.225
            CollisionEnter
            {
                SOUNDLAYER
                {
                    name = Hull_Impact-Low
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Hull_Impact-Low-1
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Hull_Impact-Low-2
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Hull_Impact-Low-3
                    loop = false
                    spread = 0.1
                    channel = ShipBoth
                    volume = 0.0 0.0
                    volume = 0.225 0.0
                    volume = 2.25 1.0
                    volume = 4.5 0.0
                    pitch = 0.0 0.8
                    pitch = 0.225 0.95
                    pitch = 4.5 1.05
                    massToVolume = 0.0 0.5
                    massToVolume = 15.0 0.8
                    massToVolume = 30.0 1.0
                    massToPitch = 0.0 1.2
                    massToPitch = 15.0 1.0
                    massToPitch = 30.0 0.8
                }
                SOUNDLAYER
                {
                    name = Hull_Impact-High
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Hull_Impact-High-1
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Hull_Impact-High-2
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Hull_Impact-High-3
                    loop = false
                    spread = 0.1
                    channel = ShipBoth
                    volume = 0.0 0.0
                    volume = 4.5 0.0
                    volume = 9 1.0
                    pitch = 0.0 0.8
                    pitch = 4.5 0.95
                    pitch = 9 1.05
                    massToVolume = 0.0 0.5
                    massToVolume = 15.0 0.8
                    massToVolume = 30.0 1.0
                    massToPitch = 0.0 1.2
                    massToPitch = 15.0 1.0
                    massToPitch = 30.0 0.8
                }
                SOUNDLAYER
                {
                    name = Ground_Impact-Low
                    data = concrete-dirt
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Ground_Impact-Low-1
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Ground_Impact-Low-2
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Ground_Impact-Low-3
                    loop = false
                    spread = 0.25
                    channel = ShipBoth
                    volume = 0.0 0.0
                    volume = 0.1 0.0
                    volume = 15 1.0
                    volume = 30 0.0
                    pitch = 0.0 0.8
                    pitch = 0.1 0.8
                    pitch = 15 1.2
                }
                SOUNDLAYER
                {
                    name = Ground_Impact-High
                    data = concrete-dirt
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Ground_Impact-High-1
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Ground_Impact-High-2
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Impacts/Ground_Impact-High-3
                    loop = false
                    spread = 0.25
                    channel = ShipBoth
                    volume = 0.0 0.0
                    volume = 15 0.0
                    volume = 30 1.0
                    pitch = 0.0 0.8
                    pitch = 15 0.8
                    pitch = 30 1.2
                }
            }
            CollisionStay
            {
                SOUNDLAYER
                {
                    name = Hull_CollisionScrape-concrete
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Hull_Scrape-1
                    data = concrete
                    loop = true
                    loopAtRandom = true
                    spread = 0.12
                    channel = ShipBoth
                    volume = 0.0 0.0
                    volume = 1.0 0.0
                    volume = 15.0 0.8
                    volume = 30.0 1.0
                    massToVolume = 0.0 0.5
                    massToVolume = 25 0.8
                    massToVolume = 50 1.0
                    massToPitch = 0.0 1.2
                    massToPitch = 25 1.0
                    massToPitch = 50 0.8
                }
                SOUNDLAYER
                {
                    name = Hull_CollisionScrape-dirt
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Hull_Scrape-2
                    data = dirt
                    loop = true
                    loopAtRandom = true
                    spread = 0.12
                    channel = ShipBoth
                    volume = 0.0 0.0
                    volume = 1.0 0.0
                    volume = 15.0 0.8
                    volume = 30.0 1.0
                    massToVolume = 0.0 0.5
                    massToVolume = 25 0.8
                    massToVolume = 50 1.0
                    massToPitch = 0.0 1.2
                    massToPitch = 25 1.0
                    massToPitch = 50 0.8
                }
                SOUNDLAYER
                {
                    name = Hull_CollisionScrape-Metal
                    audioClip = RocketSoundEnhancement/Sounds/Physics/Hull_Scrape-3
                    data = concrete-vessel
                    loop = true
                    loopAtRandom = true
                    spread = 0.12
                    channel = ShipBoth
                    volume = 0.0 0.0
                    volume = 1.0 0.0
                    volume = 30.0 1.0
                    massToVolume = 0.0 0.5
                    massToVolume = 25 0.8
                    massToVolume = 50 1.0
                    massToPitch = 0.0 1.1
                    massToPitch = 25 1.0
                    massToPitch = 50 0.9
                }
            }
        }
        MODULE
        {
            name = ModuleB9PartInfo
        }
        MODULE
        {
            name = ModulePartInfo
            originalPartName = bluedog_AIMP_Magnetometer
        }
        MODULE
        {
            name = ChillingOut
            active = True
        }
    }
}

Log and MM cache: KSP logs 2021-11-29-01.zip

Gordon-Dry commented 2 years ago

Could be related to https://github.com/Kerbalism/Kerbalism/issues/784#issuecomment-981764343