Thank you for answers and suggestion. I have no idea why it doesn't work for me, I even tried the steps you describe, starting with downloading df_40_11_win_s.zip. Could you please tell what "check" function of binpatch returns after successfully applying the patch?
When I apply the patch, like this
binpatch apply pressureplate_04011
the prompt says that the patch was applied (if it doesn't find the file it clearly states in red that it can't find the patch). But when I check for changes like this
binpatch check pressureplate_04011
it always says that the patch is removed, which means that no changes were actually made.
What worries me is if I deliberately put a wrong value in the patch file, like changing expected original value of 4B to 4A for example, then applying the patch also says that it was applied. Which means the function returned success even though it shouldn't/couldn't, instead it that example it should write something like "conflict at address" I think.
Luckily, I didn't delete that install yet.
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is removed
[DFHack]# binpatch apply pressureplate_04011
pressureplate_04011: applied the patch
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is applied
[DFHack]# binpatch remove pressureplate_04011
pressureplate_04011: removed the patch
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is removed
[DFHack]#No errors.
Editing the original 4B to 4A:
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: conflict at address db8310
[DFHack]#Let's see... you apply the patch, no complaints, but check says it's removed. Same thing when you deliberately corrupt the patch.
The file is being treated as garbage.
Lines in a patch file that don't have three hexnumbers, with a colon between the first and the second, are silently ignored.
And binpatch doesn't give a warning if
no valid patch lines are found.
Check that the contents are exactly as you posted,
and check that it's an ASCII text file instead of Unicode or word-processor formatted. Open it in
Notepad Wordpad, then Save-As and make sure the Encoding is ANSI or UTF-8.
Another thing I just noticed: you
can't edit the patch file while Dwarf Fortress is still running. You have to stop and restart DF every time. (Or use an editor that can overwrite a locked file.) That's due to a bug in
binpatch.lua.
EDIT: I've reported the bug on the Github tracker.So your tests may be invalid.