Jump to content

Tutorial: Drying Racks


Recommended Posts

So this is going to be a quick and dirty tutorial, though I'll come back and clean it up later.

With the release of Turn of Tides (and now Hook Line and Inker), Klei have added in new functions to the dryable component that make modded drying rack items super easy.

For example:
unknown.png

Beautiful fish jerky.

We achieve this with the following postinit:

local function DriedFishbiteInit(inst)
  	if inst.components.dryable then	
  		inst.components.dryable:SetProduct("fishbite_dried")
      inst.components.dryable:SetDryTime(TUNING.DRY_FAST)
      inst.components.dryable:SetBuildFile("meat_rack_food_faf")
      if CurrentRelease.GreaterOrEqualTo("R09_ROT_HOOKLINEANDINKER") then
        inst.components.dryable:SetDriedBuildFile("meat_rack_food_faf") -- We wrap this function because it only exists in the beta
      end  
    end    
end

if CurrentRelease.GreaterOrEqualTo("R09_ROT_HOOKLINEANDINKER") then
  AddPrefabPostInit("fishmeat_small", DriedFishbiteInit) -- Again, this prefab only exists in the beta
end

AddPrefabPostInit("fish", DriedFishbiteInit)

Of course, you can also do this with new brand new items by adding the dryable component in the usual way.

When creating your builds in spriter you're going to need two swap symbols; one for the ingredient and one for the product. The drying rack uses the ingredient and product prefab names to fetch these symbols, so make sure they're correct. You can see here how it's set up for a prefab called "pasta_wet" that turns into "pasta_dry".

image.thumb.png.e0710b83e2a4a25fe29c4f1ece662b9a.png

You don't actually need to set up the animation like this, but it helps to visualise. The important thing is that you set up the pivot correctly, as this will be where the rope connects with your item. From my testing, you still need to make a dummy anim with the same prefab name as the symbol (though I could be mistaken).

Typically, both your ingredient and product symbols had to be in the exact same build file, but that has changed with the latest beta. Now you're able to set a separate build file for the product with the following function (which is wrapped to make sure it only runs on the beta):

if CurrentRelease.GreaterOrEqualTo("R09_ROT_HOOKLINEANDINKER") then
        inst.components.dryable:SetDriedBuildFile("meat_rack_food_faf")
end 

Nice and simple!

Edited by Tosh
Forgot to add in the SetDryTime function
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...