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 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 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 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 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.