net-lisias-ksp / KSP-Recall

Recall for KSP blunders, screw ups and borks.
GNU General Public License v2.0
25 stars 2 forks source link

ArgumentOutOfRangeException causes saving to break and makes my save file unplayable. #49

Closed OperativeLoop closed 2 years ago

OperativeLoop commented 2 years ago

Exceptions similar to this show up several times in my log, looks like whenever something tries to do a save. Not sure if this is caused by KSP-Recall or not, this started happening when I grabbed latest updates for my modlist, including updates to: Stockalike Station Parts Expansion Redux, KSP Community Fixes, Kopernicus Planetary System Modifier, and Space Dust.

[EXC 09:15:11.811] ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <9577ac7a62ef43179789031239ba8798>:0) System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <9577ac7a62ef43179789031239ba8798>:0) KSP_Recall.AttachedOnEditor.AttachedOnEditor.SaveTo (ConfigNode node) (at :0) KSP_Recall.AttachedOnEditor.AttachedOnEditor.OnSave (ConfigNode node) (at :0) PartModule.Save (ConfigNode node) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) ProtoPartModuleSnapshot..ctor (PartModule module) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) ProtoPartSnapshot..ctor (Part PartRef, ProtoVessel protoVessel, System.Boolean preCreate) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) ProtoPartSnapshot..ctor (Part PartRef, ProtoVessel protoVessel) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) ProtoVessel..ctor (Vessel VesselRef, System.Boolean preCreate) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) ProtoVessel..ctor (Vessel VesselRef) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) Vessel.BackupVessel () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) FlightState..ctor () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) Game.Updated (GameScenes startSceneOverride) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) Game.Updated () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) QuickSaveLoad.doSave (System.String filename, System.String screenMsg) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) QuickSaveLoad.quickSave (System.Boolean saveAs) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) QuickSaveLoad.Update () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0) UnityEngine.DebugLogHandler:LogException(Exception, Object) ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object) UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

KSP.log

Lisias commented 2 years ago

Hi, @OperativeLoop !

You are not alone on this problem, check this post on Forum:

https://forum.kerbalspaceprogram.com/index.php?/topic/192048-18/&do=findComment&comment=4149703

Your problem is exactly the same one described on the link. With luck, you will be able to fix it by doing this:

Let me know if it works for you.

In a way or another, as soon as I release the next TweakScale, please ditch this one and install the production release! :)

Lisias commented 2 years ago

@OperativeLoop , I'm doing some diagnosing on issue #52 that relates to your problem too.

As I explained on Forum on this post, I fighting two different problems, and there's a chance that your KSP is being bitten by both.

The first is definitively on me, revert to Recall 0.2.2.3 until I fix the damned thing properly (still working on it).

The second may be that concurrency problem on Main Menu introduced by Making History. It's a long shot, but it worths a try. Rename <KSP_Root>/GameData/SquadExpansion/MakingHistory/makinghistory.kspexpansion to <KSP_Root>/GameData/SquadExpansion/MakingHistory/makinghistory.kspexpansion.NOLOAD and if your KSP improves somehow.

Let me know the results.

Lisias commented 2 years ago

The Schrödinger's Fault: it's not my fault, but is also is - depending if I'm looking on it or not.

Oukey, #52 demonstrated that I had royally borked something on the UpgradeCode - problem: I wasn't seeing where.

Now I got it. On 0.2.2.4 I was interrupted on April, 19 and only come back to it at May, 1st. And I forgot to update the moduleVersion to 6 in the mean time!

Anyway, problem (finally) diagnosed and fixed. And the upgrading was hugely simplified (less is more sometimes).

Fixed on commit https://github.com/net-lisias-ksp/KSP-Recall/commit/dfa81fb41cd2603746e57a61ea434d89ed7bf377

Lisias commented 2 years ago

Oukey, it was my fault after all! :)

The trampolim is working. Closing it.

It will be published on KSP-Recall 0.3.0.1 , to be released today.