Closed giovannidotgen closed 2 years ago
Do you have other levels in the ini file that have fglayout/bglayout instead of layout? Because that would cause a crash.
That did solve the issue partially. I am now able to load non-GHZ levels. GHZ based levels (including the Ending) now throw this exception at me:
Program: SonLVL
Build Date: 07/18/2022 03:48:03
OS Version: Microsoft Windows NT 6.2.9200.0
Log:
Operating system: Microsoft Windows NT 6.2.9200.0
Opening INI file "E:\Giovanni's Files\SEGA Genesis Stuff\Sonic ROM Hacking\Disassemblies\s1Hivebrain OM3\Sonic 1 2005 INIs\SonLVL.ini"...
Game type is S1.
Loading Green Hill Zone Act 1...
Loading 16x16 blocks from file "../map16/GHZ.bin", using compression Enigma...
Loading 256x256 chunks from file "../map256_u/GHZ.bin", using compression Uncompressed...
Loading 8x8 tiles from file "../artnem/8x8ghz.bin", using compression Nemesis...
Loading layout from file "../levels/ghz1.bin", using compression Uncompressed...
Loading layout from file "../levels/ghz2.bin", using compression Uncompressed...
Loading palette file "../pallet/sonic.bin"...
Source: 0 Destination: 0 Length: 16
Loading palette file "../pallet/ghz.bin"...
Source: 0 Destination: 16 Length: 48
Loading layout from file "../levels/ghz3.bin", using compression Uncompressed...
Loading layout from file "../levels/ending.bin", using compression Uncompressed...
System.AggregateException: Si sono verificati uno o più errori. ---> System.IndexOutOfRangeException: Indice oltre i limiti della matrice.
in SonicRetro.SonLVL.API.S2.Layout.ReadLayout(Byte[] rawdata, LayoutData layout) in C:\Programs\SonLVL\SonLVLAPI\S2\Layout.cs:riga 7
in SonicRetro.SonLVL.API.LayoutFormatCombined.ReadLayout(String filename, CompressionType compression, LayoutData layout) in C:\Programs\SonLVL\SonLVLAPI\LayoutFormat.cs:riga 47
in SonicRetro.SonLVL.API.LayoutFormatCombined.TryReadLayout(String filename, CompressionType compression, LayoutData layout) in C:\Programs\SonLVL\SonLVLAPI\LayoutFormat.cs:riga 55
in SonicRetro.SonLVL.API.LevelData.LoadLevelLayout(String levelname) in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:riga 622
in SonicRetro.SonLVL.API.LevelData.<>c__DisplayClass70_0.<LoadLevel>b__0() in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:riga 166
in System.Threading.Tasks.Task.InnerInvoke()
in System.Threading.Tasks.Task.Execute()
--- Fine della traccia dello stack dell'eccezione interna ---
in System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
in System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
in System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
in System.Threading.Tasks.Parallel.Invoke(Action[] actions)
in SonicRetro.SonLVL.API.LevelData.LoadLevel(String levelname, Boolean loadGraphics) in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:riga 166
in SonicRetro.SonLVL.GUI.MainForm.backgroundLevelLoader_DoWork(Object sender, DoWorkEventArgs e) in C:\Programs\SonLVL\SonLVL\MainForm.cs:riga 567
---> (Eccezione interna 0) System.IndexOutOfRangeException: Indice oltre i limiti della matrice.
in SonicRetro.SonLVL.API.S2.Layout.ReadLayout(Byte[] rawdata, LayoutData layout) in C:\Programs\SonLVL\SonLVLAPI\S2\Layout.cs:riga 7
in SonicRetro.SonLVL.API.LayoutFormatCombined.ReadLayout(String filename, CompressionType compression, LayoutData layout) in C:\Programs\SonLVL\SonLVLAPI\LayoutFormat.cs:riga 47
in SonicRetro.SonLVL.API.LayoutFormatCombined.TryReadLayout(String filename, CompressionType compression, LayoutData layout) in C:\Programs\SonLVL\SonLVLAPI\LayoutFormat.cs:riga 55
in SonicRetro.SonLVL.API.LevelData.LoadLevelLayout(String levelname) in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:riga 622
in SonicRetro.SonLVL.API.LevelData.<>c__DisplayClass70_0.<LoadLevel>b__0() in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:riga 166
in System.Threading.Tasks.Task.InnerInvoke()
in System.Threading.Tasks.Task.Execute()<---
No levels in the INI file feature the fglayout/bglayout parameters.
Whoops! This one was also a me error. The ending level was not 4KB in size, which may have screwed something up within the loading process, fairly enough. All levels load just fine now, thanks for the assistance!
I'm trying to load a Sonic 1 level with this specific format:
However, when loading up the level, the program throws an error at me, requiring the parameter "key" not to be null, although I'm unsure of what this "key" parameter is.
For the record, I have tried loading as a layout a file that does not exist in my machine, which would normally load up the "level" with no issue, but in this case, the level is not loaded.
Here's my SonLVL.INI file, along with the specific level I'm trying to load: