S-C-A-N / SCANsat

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

ArgumentOutOfRangeException when using ScanSat and Probe Control Room #257

Closed link4531 closed 7 years ago

link4531 commented 7 years ago

I will keep this brief. When using the Raster Prop Monitor(RPM) in IVA with the Probe control Room Mod, if you select any RPM window that utilizes ScanSat, example MAP or NAV 1/2 the RPM Screens become unresponsive and the log is spammed with "ArgumentOutofRangeException". I believe, that Scansat is causing this error. In case I am wrong in my assumption ( I have 30 minutes of coding experience ), I have also posted the following error on the Probe Control Room thread in the KSP forums.

Extra info: KSP Version 1.2.2 ScanSat Version 1.1.6.11 RPM Version 0.28.0 PCR Version 1.2.2.4

Output_Log: ArgumentOutOfRangeException: Argument is out of range. Parameter name: index at System.Collections.Generic.List`1[SCANsat.SCAN_Data.SCANresourceGlobal].get_Item (Int32 index) [0x00000] in :0 at SCANsat.SCAN_UI.JSISCANsatRPM.RedrawMap () [0x00000] in :0 at SCANsat.SCAN_UI.JSISCANsatRPM.MapRenderer (UnityEngine.RenderTexture screen, Single cameraAspect) [0x00000] in :0 at JSI.MonitorPage.RenderBackground (UnityEngine.RenderTexture screen) [0x00000] in :0 at JSI.RasterPropMonitor.RenderScreen () [0x00000] in :0 at JSI.RasterPropMonitor.OnUpdate () [0x00000] in :0 at InternalProp.OnUpdate () [0x00000] in :0 at InternalModel.OnUpdate () [0x00000] in :0 at Part.InternalOnUpdate () [0x00000] in :0 at Part.Update () [0x00000] in :0

(Filename: Line: -1)

ArgumentOutOfRangeException: Argument is out of range. Parameter name: index at System.Collections.Generic.List`1[SCANsat.SCAN_Data.SCANresourceGlobal].get_Item (Int32 index) [0x00000] in :0 at SCANsat.SCAN_UI.JSISCANsatRPM.RedrawMap () [0x00000] in :0 at SCANsat.SCAN_UI.JSISCANsatRPM.OnUpdate () [0x00000] in :0 at InternalProp.OnUpdate () [0x00000] in :0 at InternalModel.OnUpdate () [0x00000] in :0 at Part.InternalOnUpdate () [0x00000] in :0 at Part.Update () [0x00000] in :0

(Filename: Line: -1)

ArgumentOutOfRangeException: Argument is out of range. Parameter name: index at System.Collections.Generic.List`1[SCANsat.SCAN_Data.SCANresourceGlobal].get_Item (Int32 index) [0x00000] in :0 at SCANsat.SCAN_UI.JSISCANsatRPM.RedrawMap () [0x00000] in :0 at SCANsat.SCAN_UI.JSISCANsatRPM.OnUpdate () [0x00000] in :0 at InternalProp.OnUpdate () [0x00000] in :0 at InternalModel.OnUpdate () [0x00000] in :0 at Part.InternalOnUpdate () [0x00000] in :0 at Part.Update () [0x00000] in :0

.... this continues many times as seen above.

DMagic1 commented 7 years ago

Should be fixed in 17.2.

Is there any way to change the resource overlay selection in Probe Control Room? It looks like the saved resource selection is invalid.

In the worst case you should be able to search your save file for the "SCANRPMStorage" part module and change the "Resource" field to 0. If that doesn't fix it, or that field is already 0 then there could be a problem with resources not being loaded correctly.

link4531 commented 7 years ago

I believe the issue persisted in 17.2 (this is your current beta), however, I will test again. Additionally, I will look at changing the Resource field value to 0 and let you know the outcome.

link4531 commented 7 years ago

Well, you were absolutely right about 17.2 (dev) works like a charm. I was able to open a the MAP/NAV ( scansat) and RPM+PCR worked flawlessly. Performance was good too, I will relay this to the PCR thread. Please consider my posted issue resolved-pending you update to Scansat. Thanks a bunch!

BTW: I only got one exception thrown with 17.2 you probably are already aware, but I thought I should provide this to you anyway. Instead of being spammed with errors, I only got one, shown below. I hope this helps.

JSISCANsatRPM: Active on page 10 (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

NullReferenceException: Object reference not set to an instance of an object at SCANsat.SCAN_UI.JSISCANsatRPM.RedrawMap () [0x00000] in :0 at SCANsat.SCAN_UI.JSISCANsatRPM.MapRenderer (UnityEngine.RenderTexture screen, Single cameraAspect) [0x00000] in :0 at JSI.MonitorPage.RenderBackground (UnityEngine.RenderTexture screen) [0x00000] in :0 at JSI.RasterPropMonitor.RenderScreen () [0x00000] in :0 at JSI.RasterPropMonitor.OnUpdate () [0x00000] in :0 at InternalProp.OnUpdate () [0x00000] in :0 at InternalModel.OnUpdate () [0x00000] in :0 at Part.InternalOnUpdate () [0x00000] in :0 at Part.Update () [0x00000] in :0 (Filename: Line: -1)

GetPixels32 called on a degenerate image (dimensions 0x0) (Filename: Line: 1265)

[SCANsat] Height Map Of [Kerbin] Completed...

DMagic1 commented 7 years ago

Fixed in version 18.