kwsch / NHSE

Animal Crossing: New Horizons save editor
https://berichan.github.io/GetNHSE/
GNU General Public License v3.0
1.01k stars 260 forks source link

Index Out Of Range #503

Closed JKDos closed 2 years ago

JKDos commented 2 years ago

I tried to get help from Discord, but they were stumped.

I started a new island in New Horizons, and when I try to save changes in NHSE, I get this error. Important to note, I will get this error even if I change nothing. I have game version 1.11.1 and NHSE version Build no. 4038

image

If I edit my old saves from my old island, I don't get this error.

berichan commented 2 years ago

Are your old saves in the same location as this one? It seems like a filesystem access issue, are you transferring them off your sd card before editing? No OneDrive or other cloud-based folder?

You can zip and send us the save folder and we can check if it actually is a savefile reading issue.

JKDos commented 2 years ago

Are your old saves in the same location as this one? It seems like a filesystem access issue, are you transferring them off your sd card before editing? No OneDrive or other cloud-based folder?

You can zip and send us the save folder and we can check if it actually is a savefile reading issue.

Yes, my other saves are in the same location. Someone on discord thought it was a read/write issue too. No other saves in the same location have this problem. I keep the saves on my second drive (D:) where I keep my Steam Libary or other games. Just for the sake of trying, I moved the save to the C:\users\ [myuser] \Documents and that didn't help either.

I'll get you the file if I can remember after I get off work today.

EDIT: It's important to note that although this error shows up, the changes do look like they're being saved. Whether or not they're being 100% saved is unknown.

JKDos commented 2 years ago

You can zip and send us the save folder and we can check if it actually is a savefile reading issue.

Here is the save. save-2-082721.zip

kwsch commented 2 years ago
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.SZArrayHelper.get_Item[T](Int32 index)
   at NHSE.Core.EncryptedFilePair.Hash() in C:\Users\Kurt\Documents\GitHub\NHSE\NHSE.Core\Save\Meta\EncryptedFilePair.cs:line 55
   at NHSE.Core.HorizonSave.Save(UInt32 seed) in C:\Users\Kurt\Documents\GitHub\NHSE\NHSE.Core\Save\Meta\HorizonSave.cs:line 33
   at NHSE.WinForms.Editor.Menu_Save_Click(Object sender, EventArgs e) in C:\Users\Kurt\Documents\GitHub\NHSE\NHSE.WinForms\Editor.cs:line 70

image

image

Your profile.dat file appears to be invalid; image

Try replacing the two instances of FF FF with 15 00 in a hex editor (HxD pictured below) so that the SaveRevision correctly reads 21 in NHSE, to match the other file headers: image

NHSE does not mutate these header files, so I'm not sure how you've managed to get your header data to misbehave like this.

JKDos commented 2 years ago

I'm not sure how you've managed to get your header data to misbehave

After speaking with someone again on Discord, I think we've determined this can happen because I used the Resident Move feature Nintendo added to ACNH, which lets you move any non island rep from one save to another. When starting my new island, I had moved one of my characters to my other Switch so I'd start the game which some things already unlocked.

JKDos commented 2 years ago

Try replacing the two instances of FF FF with 15 00 in a hex editor

No more error after that. I'm good to go. Thanks for your help.

kwsch commented 2 years ago

Thanks for the update!

I don't think I want to have any handling for this in the program, as you're the first to report it after so long. Maybe if others have the issue, I can make the program ignore that FF FF :)

dennyrgood commented 2 years ago

I had this same issue, and my main villager was moved from another island ... changing the FF FF to 15 00 at offset 0E and 0F fixed the index save error.

Thank you!!! Denny