Calculate used durability of tool?

Place to get help with not working mods / modding interface.
gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

Calculate used durability of tool?

Post by gheift »

Hello,

is there a way to calculate the consumed durability of e.g. the iron-axe for mining an entity?

A tree has health of 50, hardness of 0.5 and a mining time of 2, the iron-axe has a power of 2.5, needs

Code: Select all

mining_time / (.01 * (power - hardness) = 100 ticks
By testing, the iron-axe looses 50 durability.

By using a steel-axe with the power of 4, it needs ~ 58 ticks.
By testing, the steel-axe looses 29 durability.

Do I only have to multiply the used time with the hardness of the item to get the consumed durability?

Code: Select all

durability = math.ceil(mining_time / (.01 * (power - hardness))) * hardness
Thanks,
Gerhard
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Calculate used durability of tool?

Post by Ranakastrasz »

Test it with bobs mod axes or expanded tools. Or mod the tool stats until you confirm or deny your theory. The add to wiki.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Post Reply

Return to “Modding help”