Kerbal Inventory System (KIS)

Kerbal Inventory System (KIS)

1M Downloads

Only root part of craft loading

SirDiazo opened this issue ยท 2 comments

commented

Good morning, I'm trying to help one of my users track down an issue he's having and I believe I've narrowed it down to this mod. (KIS Ver. 1.0.1 used.)

Trying to load a spaceplane, only the root part appears and the following error appears in the log which I believe is the cause:

ArgumentException: An element with the same key already exists in the dictionary.
at System.Collections.Generic.Dictionary`2[System.Int32,KIS.KIS_Item].Add (Int32 key, KIS.KIS_Item >value) [0x00000] in :0
at KIS.ModuleKISInventory.AddItem (.AvailablePart availablePart, .ConfigNode partNode, Single qty, >Int32 slot) [0x00000] in :0
at KIS.ModuleKISInventory.OnLoad (.ConfigNode node) [0x00000] in :0
at PartModule.Load (.ConfigNode node) [0x00000] in :0
at Part.LoadModule (.ConfigNode node, System.Int32& moduleIndex) [0x00000] in unknown>:0
at ShipConstruct.LoadShip (.ConfigNode root) [0x00000] in :0
at ShipConstruction.LoadShip (System.String filePath) [0x00000] in :0
at EditorLogic.Start () [0x00000] in :0

Note this is happening in the ShipConstruct.Loadship method and as it is a critical error, it causes KSP to error out and stop loading the craft, which is why only the root part appears in the editor.

Leaving everything else the same, if I delete the KIS.dll file (but leave the KIS parts), the plane loads sucessefully.

The following files are in the attached .zip:
JK-Series SSTO mk_IIa.craft Craft file as the player submitted to me, I have made no changes
output_log with KIS.txt Output_log.txt from when the KIS.dll file is present and only the root part shows in editor.
output_log without KIS.txt Output_log.txt from the run with the KIS.dll file deleted.
https://drive.google.com/file/d/0B6-5UOjSWq7bSXdzWVF6ZmVRZ1E/view?usp=sharing

Both output_logs were simply load the game, move to editor, try to load the craft, alt-f4 once KSP had finished trying to load.

Mods required to load the .craft file:
MechJeb
RemoteTech
B9 Procedural WIngs
SXT Stock Extention Parts Pack
Near Future Electrical
Real Chute
TAC Life Support
OPT Spaceplane Parts

commented

I was apparently having the same thing as this here and didn't realize it: Link to forum post:

http://forum.kerbalspaceprogram.com/threads/113111-0-90-Kerbal-Inventory-System-%28KIS%29-1-0-2?p=1850592&viewfull=1#post1850592

craft file: http://sta.sh/01x42r2js1eo
Mods required:
B9 Aerospace
KWrocketry
Novapunch
vens stock revamp (might not actually be required, but mentioning anyway)
Taurus HCV
MKS/OKS
Karbonite
FTT
Hangar mod (using the radial adaptor from it)
Modular Rocket Systems.
KIS
KAS

That should be it.

commented

I don't know why it happens, but to prevent this I added a check in KIS 1.1 to verify if the item slot is used or not on loading.
If already used, KIS will try to load the item in another slot. If there isn't any slot available, the item will be ignored and an error message will be shown in the console.