Soaprman / FEFTwiddler

A save editor for Fire Emblem Fates
GNU General Public License v3.0
54 stars 17 forks source link

Error upon loading a save: Sequence contains no elements #50

Closed JRCrichton closed 8 years ago

JRCrichton commented 8 years ago

Whenever I load up a save, I get this error:

image

With this block of text in the details.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

\ Exception Text ** System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at FEFTwiddler.GUI.Convoy.ConvoyItemPanel.PopulateControls() at FEFTwiddler.GUI.Convoy.ConvoyItemPanel.LoadItem(ChapterSave chapterSave, ConvoyItem convoyItem) at FEFTwiddler.GUI.Convoy.ConvoyMain.MakeItemPanel(ConvoyItem item) at FEFTwiddler.GUI.Convoy.ConvoyMain.FillAllPages() at FEFTwiddler.GUI.Convoy.ConvoyMain.PopulateControls() at FEFTwiddler.GUI.Convoy.ConvoyMain.LoadChapterSave(ChapterSave chapterSave) at FEFTwiddler.GUI.MainForm.LoadChapterData() at FEFTwiddler.GUI.MainForm.openFileToolStripMenuItem_Click(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

\ Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.6.1080.0 built by: NETFXREL3STAGE

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

FEFTwiddler Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0

CodeBase: file:///D:/FEFTwiddler-0.12.0/FEFTwiddler.exe

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.6.1038.0 built by: NETFXREL2

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.6.1075.0 built by: NETFXREL3STAGE

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.6.1078.0 built by: NETFXREL3STAGE

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.6.1038.0 built by: NETFXREL2

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.6.1038.0 built by: NETFXREL2

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.6.1064.2 built by: NETFXREL3STAGE

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Xml.Linq Assembly Version: 4.0.0.0 Win32 Version: 4.6.1038.0 built by: NETFXREL2

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll

\ JIT Debugging ** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

Soaprman commented 8 years ago

Mind uploading your save? I can't fix this otherwise.

Whatever it is, it's probably some item with an ID that FEFTwiddler doesn't know about yet.

JRCrichton commented 8 years ago

Chapter2.zip

Soaprman commented 8 years ago

Some of your items have a byte set that shouldn't be set.

If you check your convoy ingame, you'll notice two separate entries for Steel Sword, one x3 and one x1. On one of these groups (the x3 group), the weapon name byte is set to 01, which is to my knowledge not a valid value. Convoy and inventory items have either a 00 (no name) or >= 02 (named) value. I don't think 01 is a possible value in this byte without manually hex editing it.

In the inventory view in the unit viewer, weapons in this state have an 01 for the third byte in the "raw" view. Mozu and Silas have similar steel swords. Laslow has a regular steel sword.

I'll fix the convoy view so it works like it does ingame (that is, you'll have two steel sword entries).