inferjus4 Posted June 1, 2019 Share Posted June 1, 2019 I have a hat mod and I would like to add durability to it (the same the Pith Hat has). The problem is I do not know what should I add to prefab to make hat lose durability when worn. Here is the mod if you would like to check it: https://steamcommunity.com/sharedfiles/filedetails/?id=1753641858&tscn=1559403242. Link to comment https://forums.kleientertainment.com/forums/topic/106995-how-to-add-durability-to-hat/ Share on other sites More sharing options...
noobyt3 Posted June 2, 2019 Share Posted June 2, 2019 i reccomend looking into the C:\Program Files (x86)\Steam\steamapps\common\dont_starve\data\scripts\prefabs folder and looking at the coding Link to comment https://forums.kleientertainment.com/forums/topic/106995-how-to-add-durability-to-hat/#findComment-1203582 Share on other sites More sharing options...
inferjus4 Posted June 2, 2019 Author Share Posted June 2, 2019 7 hours ago, noobyt3 said: i reccomend looking into the C:\Program Files (x86)\Steam\steamapps\common\dont_starve\data\scripts\prefabs folder and looking at the coding I will probably do it since people keep ignoring my posts. Link to comment https://forums.kleientertainment.com/forums/topic/106995-how-to-add-durability-to-hat/#findComment-1203699 Share on other sites More sharing options...
MissSora22 Posted June 3, 2019 Share Posted June 3, 2019 You have to add to: local function onequip(inst, owner, fname_override) this part: if inst.components.fueled then inst.components.fueled:StartConsuming() end and to local function onunequip(inst, owner) this part: if inst.components.fueled then inst.components.fueled:StopConsuming() end and this inst:AddComponent("fueled") inst.components.fueled.fueltype = "USAGE" inst.components.fueled:InitializeFuelLevel(TUNING.GASMASK_PERISHTIME) inst.components.fueled:SetDepletedFn(generic_perish) You don`t have to use this TUNING.GASMASK_PERISHTIME, you can take an other one form the tuning file, but this one would be the same usage lost than the gasmask Link to comment https://forums.kleientertainment.com/forums/topic/106995-how-to-add-durability-to-hat/#findComment-1204429 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now