Project Zomboid

Project Zomboid

Spiffo's Workshop
Welcome to Spiffo's Workshop, the place to find Project Zomboid mods, maps, buildings, and other things to tinker with. For our Modding Policy, click the "Learn More" Button below.
Learn More
Crafting while walking
Hi, I am the creator of the mod Tobacco+ Hotkey and I was wondering if it's possible to change the default way a craft recipe called "TakeACigarette" (or other similar added by various mods) is performed, basically I'd simply put would like to make it so that you can unpack a cigarette or a whole pack while walking around. By default it's interrupted when you press W/S/A/D, even THOUGH there's apparently a field called stopOnWalk which, to my surprise, is actually set to false, yet the character will stop the action when start to walk.

Maybe you need to focus on the craftRecipe script? Maybe you need to create your own timed action? I have no idea how to do that, been trying for some time now. I've seen there's a property called CanWalk in some of the craftRecipe definitions but it's commented out everywhere it's added. It also does nothing when de-commented. Then I also found in ISHandcraftAction.lua this fragment:

o.stopOnWalk = not craftRecipe:isCanWalk(); if character and (character:HasTrait("AllThumbs") or character:isWearingAwkwardGloves()) then o.stopOnWalk = true; end

but I'm further confused in that in the official documentation[projectzomboid.com] there is no method like this existing on the Recipe class. There's only such method existing on Zombie class but that's obviously unrelated. I tried setCanWalk(true) but that method does not exist. Any help? Is it even possible?