Not sure why this is but maybe it helps someone else.
Recently someone came back into the dfhack irc channel with an odd problem. Just can't mine. Sure before he had a messed up hand and that probably got in the way of things checking out properly. This time fresh healthy adventurer with a pick in each hand. Still couldn't mine.
having had some very minor success with lua I decided to try looking at his problem... and the Predicate check in advfort specifically. But not being an adventurer person I checked a random actually mining miner in fortmode first.
:lua unit=dfhack.gui.getSelectedUnit() print(dfhack.TranslateName(unit.name,true)) for k,v in pairs(unit.inventory) do print(k,v.mode) if df.item_weaponst:is_instance(v.item) then if v.item.subtype.skill_melee==df.job_skill.MINING then if unit.body.weapon_bp==v.body_part_id print("yay") end end end end
Ending up with that bit of commandline above. All was golden. So having puzzled out all the pieces to make the above line I took the plunge (maybe my third adventurer ever) gave myself some mining skill... and via the console a pick. Puzzled out making sure it was equipped, and tried the script. No "yay". Curious I tried mining a wall anyway. Nope hated my adventurers limbs -or something as that was the part that refused to "yay" when rebuilt from scratch.
so I go to line 195 and I change it to:
if v.item.subtype.skill_melee==item_skill then --and args.unit.body.weapon_bp==v.body_part_id then
and then escape out the the advfort gui before I hit save in UltraEdit. Restarting the gui I found chopping trees, and mining now worked.
I mean it's still doing a skillcheck, and still requiring it equipped to FIND it to check the skill so... it should be helpful... *ramble ramble ramble* In any event... Surely the adventuremode body isn't that different? I hope this helps narrow down any issues or is helpful in any way.