arcusmaximus / VNTranslationTools

Tools for translating visual novels
MIT License
304 stars 46 forks source link

Failed to extract BGI scripts #130

Open TachibanaKimika opened 1 year ago

TachibanaKimika commented 1 year ago

I encountered an error while using VNTextPatch.exe extractlocal . ./output/ --format=ethornell to extract text from 恋にはあまえが必要です : The given key was not present in the dictionary.

I suspect that this may be due to the presence of Emoji in the game text (for example, “❤” appears in this game text). Afterward, I changed https://github.com/arcusmaximus/VNTranslationTools/blob/36fbe909d02f2e9bb187443e03e2df595f56bfec/VNTextPatch.Shared/Scripts/Ethornell/EthornellV0Disassembler.cs#L227 and https://github.com/arcusmaximus/VNTranslationTools/blob/36fbe909d02f2e9bb187443e03e2df595f56bfec/VNTextPatch.Shared/Scripts/Ethornell/EthornellV1Disassembler.cs#L636 to ReadOperands(OperandTemplates.TryGetValue(opcode, out var value) ? value : "");. Then i got a new error using the replaced code: Unable to read beyond the end of the stream (this error only occurred once after scripts were fully extracted). However, the result of unpacking the text is right except for Emoji (after modification, where ❤ should have appeared originally, \u0002 appeared).

I've attached the script files for reference. scripts.zip

Cosetto commented 1 year ago

Try this one