OhSnapple Posted March 20, 2015 Share Posted March 20, 2015 I'm currently working on a "better hambat" mod. It's a simple mod, that allows you to get the most out of your spoiling hambat. This is the entirety of my mod: function BetterBat(inst) inst:AddComponent("cookable") inst.components.cookable.product = "kabobs" inst:AddComponent("dryable") inst.components.dryable:SetProduct("meat_dried") inst.components.dryable:SetDryTime(TUNING.DRY_MED) inst:AddComponent("tradable") inst.components.tradable.goldvalue = TUNING.GOLD_VALUES.MEAT*2 end AddPrefabPostInit("hambat",BetterBat) Everything works exactly how I want, but the hambat doesn't have any animations on the drying rack. I'm fine using the existing meat animations, I'm just not sure how to link it all up. Link to comment Share on other sites More sharing options...
Mobbstar Posted March 21, 2015 Share Posted March 21, 2015 You need some AnimState:OverrideSymbol magic for that. I myself am not very experienced with that, but maybe the crop mods help. (since crop animations work similiarly). Link to comment Share on other sites More sharing options...
OhSnapple Posted March 21, 2015 Author Share Posted March 21, 2015 Well, I seemed to have "solved" it. I really just copy pasted some coding from the "Better Drying Rack" mod made by Mouse.I'm not savvy enough to do my own coding Heres the finished mod:TUNING=GLOBAL.TUNING function onstartdrying(inst, dryable)if not inst:HasTag("burnt") then inst.AnimState:PlayAnimation("drying_pre")inst.AnimState:PushAnimation("drying_loop", true)if dryable=="hambat" then dryable="meat"end inst.AnimState:OverrideSymbol("swap_dried", "meat_rack_food", dryable)endendAddPrefabPostInit("meatrack", function(inst)inst.components.dryer:SetStartDryingFn(onstartdrying)inst.components.dryer:SetContinueDryingFn(onstartdrying)end) AddPrefabPostInit("hambat", function(inst)inst:AddComponent("dryable")inst.components.dryable:SetProduct("meat_dried")inst.components.dryable:SetDryTime(TUNING.DRY_MED)end) function BetterBat(inst) inst:AddComponent("cookable") inst.components.cookable.product = "kabobs" inst:AddComponent("tradable") inst.components.tradable.goldvalue = TUNING.GOLD_VALUES.MEAT*2 end AddPrefabPostInit("hambat",BetterBat) 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.