#Improving the support for tools
1 messages ยท Page 1 of 1 (latest)
just out of curiosity, are the tool durabilities scripted? ๐ค
its using the durability of toolprototype factorio has (for science packs, (and for deleted items like pickaxes)), and the tools durability will vary on their material
if that was what u were asking
for the recipe itself it deducts 1 durability off the file for the rod in this example?
yeah its 1 durability per crafted item rn
dont see why would it be different
the hammer gets damaged for making the plates, needed to craft the file too
wonder how you implemented the durability reduction from recipes, that is all ๐
like as an end user or as a dev?
code wise
its just a event subscription to pre item craft
then checking if the recipe has a tool requirement
then find a tool in inventory
try to check if enough durability
if not just cancel the craft
I see, what if I cancel the craft, will I get back the dura? ๐
nope:3
๐
so real
ok, scripted ๐
I was looking into durability recipes in the past (especially for something like grinding wheels/balls or sawblades) - for crafting machines.
Guess in case of handcrafting this is a viable solution ๐
with machines if its via slots its prob even easier
I'll have another look at this on the weekend ๐
yea
(basically when recipe finished, move sawblade from output to input, drain 1 dura - because the recipe has to require the tool)
yeah thats mega easy
just dont encode the sawblade in the recipe directly
and handle it urself
via the machines code
well then the recipe could work without a sawblade - that's my thought ๐ค
there is probably some way to not allow the machine to craft
i havent looked at all events/hooks there are