X-Hax / sa_tools

Sonic Adventure Toolset
http://info.sonicretro.org/SA_Tools
109 stars 24 forks source link

SA2EventViewer: Crashing event files #83

Open MainMemory opened 4 years ago

MainMemory commented 4 years ago

I tried opening e0003 in SA2EventViewer after adding the GCModel field, and it crashed.

System.ArgumentException: position data
   at SonicRetro.SAModel.GC.VertexData.SetAttributeData(GXVertexAttribute attribute, Object data) in E:\Programs\sa_tools\SAModel\GC\VertexData.cs:line 101
   at SonicRetro.SAModel.GC.VertexData.Load(Byte[] file, UInt32 address, UInt32 imageBase) in E:\Programs\sa_tools\SAModel\GC\VertexData.cs:line 188
   at SonicRetro.SAModel.GC.GCAttach..ctor(Byte[] file, Int32 address, UInt32 imageBase, Dictionary`2 labels) in E:\Programs\sa_tools\SAModel\GC\GCAttach.cs:line 43
   at SonicRetro.SAModel.Attach.Load(Byte[] file, Int32 address, UInt32 imageBase, ModelFormat format, Dictionary`2 labels) in E:\Programs\sa_tools\SAModel\Attach.cs:line 68
   at SonicRetro.SAModel.NJS_OBJECT..ctor(Byte[] file, Int32 address, UInt32 imageBase, ModelFormat format, NJS_OBJECT parent, Dictionary`2 labels, Dictionary`2 attaches) in E:\Programs\sa_tools\SAModel\NJS_OBJECT.cs:line 113
   at SA2EventViewer.Event.GetGCModel(Byte[] file, Int32 address, UInt32 imageBase, Dictionary`2 models) in E:\Programs\sa_tools\SA2EventViewer\EventData.cs:line 104
   at SA2EventViewer.EventEntity..ctor(Byte[] file, Int32 address, UInt32 imageBase, Boolean battle, Dictionary`2 models, List`1 motions) in E:\Programs\sa_tools\SA2EventViewer\EventData.cs:line 176
   at SA2EventViewer.EventScene..ctor(Byte[] file, Int32 address, UInt32 imageBase, Boolean battle, Dictionary`2 models, List`1 motions) in E:\Programs\sa_tools\SA2EventViewer\EventData.cs:line 131
   at SA2EventViewer.Event..ctor(String filename) in E:\Programs\sa_tools\SA2EventViewer\EventData.cs:line 57
   at SA2EventViewer.MainForm.LoadFile(String filename) in E:\Programs\sa_tools\SA2EventViewer\MainForm.cs:line 139
   at SA2EventViewer.MainForm.openToolStripMenuItem_Click(Object sender, EventArgs e) in E:\Programs\sa_tools\SA2EventViewer\MainForm.cs:line 129
PiKeyAr commented 3 years ago

Looks like E0003 from SA2PC plays fine in the current version image

PiKeyAr commented 3 years ago

E_0024 does crash though in some chunk model related code. System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' ChunkAttach.cs line 307.

End-User-Person commented 3 years ago

That happens because one of the shape motions is wrong in the first scene of that file, which throws an exception unless you skip to the next scene.