Mutagen-Modding / Mutagen

A .NET library for analyzing, creating, and manipulating Bethesda mods
GNU General Public License v3.0
121 stars 32 forks source link

Possible bug in Skytim Key pickup sound records #361

Closed TokcDK closed 2 years ago

TokcDK commented 2 years ago

Created some patcher patching key records adding missing pickup/putdown sounds and itemvendorkey keyword. But it have incorrect set sounds. In xEdit it looks like this: 2022-08-19_091450

placed console command says 'PickUpSound sound set to 03ED75:Skyrim.esm' after it was set which equals correct formkey for the sound but xEdit shows different result in patch for sounds like field values was shifted up. Or this is a bug of mutagen or I made somethin wrong in the patcher code but there is not so many of code and I tried several ways to set values usinf formkey,formlink and sounddescriptorgetter.

Mutagen0.39.3 Synthesis 0.23.7 Skyrim LE

Noggog commented 2 years ago

I think the error is on this line https://github.com/TokcDK/SynFixKeyMissingSoundKeyword/blob/3c9307fc0db164f8aec1ff0bfacc66b0075cb7f9/SynFixKeyMissingSoundKeyword/Program.cs#L48

Youre setting the pick up sound when it looks like you're intending to do the put down sound

Noggog commented 2 years ago

Also, while I'm in the area.. you don't need to make a formlink object here necessarily. https://github.com/TokcDK/SynFixKeyMissingSoundKeyword/blob/3c9307fc0db164f8aec1ff0bfacc66b0075cb7f9/SynFixKeyMissingSoundKeyword/Program.cs#L23

You can omit these and just put the generic type in the resolve call directly, passing in the formkey

But in general I recommend using https://github.com/Mutagen-Modding/Mutagen.Bethesda.FormKeys#create-your-own-mappings

Hoping to make it a bit easier to generate these at some point

TokcDK commented 2 years ago

I think the error is on this line https://github.com/TokcDK/SynFixKeyMissingSoundKeyword/blob/3c9307fc0db164f8aec1ff0bfacc66b0075cb7f9/SynFixKeyMissingSoundKeyword/Program.cs#L48

Youre setting the pick up sound when it looks like you're intending to do the put down sound

Hah, really, I did not noticed it even.)) I tried so many ways to set the value and didnt noticed that forgot to change copypasted line target variable.))

Also, while I'm in the area.. you don't need to make a formlink object here necessarily. https://github.com/TokcDK/SynFixKeyMissingSoundKeyword/blob/3c9307fc0db164f8aec1ff0bfacc66b0075cb7f9/SynFixKeyMissingSoundKeyword/Program.cs#L23

This is just lines for tests when I tried to use different types to set as I said in first message. In 1st variant I used only formkey. Patch is not finished and will not appear in Synthesis list before I will refresh depedencies manually(atleast one useful feature in this github bug).

But in general I recommend using https://github.com/Mutagen-Modding/Mutagen.Bethesda.FormKeys#create-your-own-mappings

I know about it but in this case it was faster just to copy formkey data from xedit than install extra package because of couple records.

..It was very late when I was making the patcher and didnt noticed so simple thing.) When I opened the issue I still was sure I mistake somethere but for any case decided to open it.) Sorry for disturb and thank you.) Closing then.)

Noggog commented 2 years ago

Cool cool. Yeah I forget what I've suggested to who, so I just always do haha. Cheers!