Jump to content

Help enabling full beard on start?


Recommended Posts

I'm working on a new character mod (a longhaired cat that is shavable with multiple sprites according to shaven-ness) and am wanting to have the game start with the full coat. Since it's just using the beard script (but instead of picking new separate beard sprites, it's picking new character sprites), it's automatically starting out at the shortest length. Does anyone know if it's possible to make it start at the last beard-day instead of the first?

Link to comment
Share on other sites

Basically, if you use standard beard component, just set the amount of beard's bits and then call the stategraph function to show the "full beard"

Here is an example from the Wilson prefab:

 

inst.AnimState.OverrideSymbol("beard", "beard", "beard_long")

inst.components.beard.bits = 9

 

But this mod can implement fur growing differently, so it really depends on how the mod is written.

Link to comment
Share on other sites

I got it to work! I was just sort of thinking about it dumb. Thank, leemuar for helping me think about it less dumb. In any case, it's really just Wilson's beard feature, but over the span of 10 days, and instead of the animstate line referring to the beard sprite, it refers to a new character sprite.

For reference, the code I ended up with is this (with stand-in numbers for the days and beard-bits):
 

 

 

inst:AddComponent("beard")
inst.components.beard.bits = 10
inst.AnimState:SetBuild("winterfull")
    inst.components.beard.onreset = function()
inst.AnimState:SetBuild("winter")
    end
    inst.components.beard.prize = "beardhair"
 
    --tune the beard economy...
local beard_days = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
local beard_bits = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
 
    
    inst.components.beard:AddCallback(beard_days[1], function()
        inst.components.beard.bits = beard_bits[1]
    end)
    
    inst.components.beard:AddCallback(beard_days[2], function()
        inst.components.beard.bits = beard_bits[2]
    end)
    
    inst.components.beard:AddCallback(beard_days[3], function()
        inst.components.beard.bits = beard_bits[3]
inst.AnimState:SetBuild("winterhalf")
    end)
 
inst.components.beard:AddCallback(beard_days[4], function()
        inst.components.beard.bits = beard_bits[4]
    end)
 
inst.components.beard:AddCallback(beard_days[5], function()
        inst.components.beard.bits = beard_bits[5]
    end)
 
    inst.components.beard:AddCallback(beard_days[6], function()
        inst.components.beard.bits = beard_bits[6]
    end)
    
    inst.components.beard:AddCallback(beard_days[7], function()
        inst.components.beard.bits = beard_bits[7]
    end)
    
    inst.components.beard:AddCallback(beard_days[8], function()
        inst.components.beard.bits = beard_bits[8]
    end)
 
inst.components.beard:AddCallback(beard_days[9], function()
        inst.components.beard.bits = beard_bits[9]
inst.AnimState:SetBuild("winterfull")
    end)
 
inst.components.beard:AddCallback(beard_days[10], function()
        inst.components.beard.bits = beard_bits[10]
    end)
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...