However, I cannot actually achieve patching. I try to use following line in dfhack.init:
binpatch apply pressureplate_04011.dif
I also tried explicitly targeting the executable, but there's no difference:
binpatch apply "Dwarf Fortress.exe" pressureplate_04011.dif
It says patch applied, but I see no change.
pressureplate_04011.dif itself looks like this:
009B6D10: 4B 30
009B6D11: 00 4B
Isn't that supposed to work?
It works for me. I did this:
- Extracted df_40_11_win_s.zip to a new test directory,
- Extracted dfhack-0.40.11-r1-Windows.7z there,
- Created a subdirectory named hack\patches\v0.40.11 SDL ,
- In that subdirectory, created a file named pressureplate_04011.dif ,
- Pasted your patch content into that file,
- And started DF to the main menu.
- At the DFHack commandline,
- binpatch check pressureplate_04011
- Note that I did not append the .dif extension.
- binpatch apply pressureplate_04011
- binpatch remove pressureplate_04011
- DFHack did not complain about any of that, which surprised me a bit.
- Then I created a pocket world and started a new embark, crafted a few mechanisms,
- And began to construct a creature-triggered pressure plate. I noted the min weight of 5K.
- I backed out of all the menus, and again did:
- binpatch apply pressureplate_04011
- And constructed a pressure plate. I noted the min weight of 50K.
I concluded that the patch does change the weight strings.
I suggest checking your patch file. Are you using the right command? Is the file in the right place? Do you have multiple copies scattered around, with different contents? Do you have a file named pressureplate_04011.dif.dif ? (Note the doubled extension.)
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.