Jump to content

Corrupt .craft file


Recommended Posts

So I've run into this issue before, and I've read that it's got something to do with messed up struts/fuel lines. Problem is, this ship is a massive, complex beastie and I really, really, really don't want to have to delete all the struts/fuel lines and re-place them, because it'll take forever and probably end up making the ship (and my computer) go ker-boom in the process :(

For the curious, here's the error in the VAB:

ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index

at System.Collections.Generic.List`1[Part].get_Item (Int32 index) [0x00000] in <filename unknown>:0

at ShipConstruct.get_Item (Int32 index) [0x00000] in <filename unknown>:0

at plugintutorial1.VABScaleDetector.OnStart (StartState state) [0x00000] in <filename unknown>:0

at Part.ModulesOnStart () [0x00000] in <filename unknown>:0

at Part+.MoveNext () [0x00000] in <filename unknown>:0

Basically, the craft file has become corrupt, and just complains about index-out-of-bounds in the VAB (and NullReferenceExceptions when I try to launch it).

EDIT: Wrote a perl script to find surface-attached that don't actually exist (which was the problem; see below).

Edited by NGTOne
Link to comment
Share on other sites

Fixed this problem using a Perl script I wrote (available below) and some manual editing with Notepad++.

https://gist.github.com/NGTOne/9d8148b4de0a2e52170f

Output from the script when run against the posted craft file:

Unlinked part found at line 149438

Unlinked part found at line 149439

The issue was a pair of "link=..." entries for struts that didn't actually exist.

Edited by NGTOne
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...