Jump to content

Additional Drying Rack meats? [mod help!]


Recommended Posts

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

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 :razz:

 

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)
end
end
AddPrefabPostInit("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

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.

×
  • Create New...