Jump to content

How do I grow facial hair?


Recommended Posts

I have a custom made character which works just fine.  I want him to grow longer hair and facial hair though and I can't figure it out at all.  Is there an easy way to copy a file over, rename it, and edit some graphics maybe?

Link to comment
Share on other sites

I did that.  I copied it into mine as well as the beard.zip to the anim folder.  Nothing happened.  I'll admit, I don't know LUA, but I just have to get this figured out.

 

I've also checked out the Drok character who grows hair and a beard, but I still couldn't get anything to work.

 

EDIT:  It decided to work just now!!  Now I need to edit the graphics to fit my character.

Edited by Boge
Link to comment
Share on other sites

Okay, I have the Wilson beard growing on my character, which doesn't quite fit.  How do I edit it to customize to my character?  Here is my character's LUA...I had to use another custom character to start with, so some of it is from Heavy.

 

local MakePlayerCharacter = require "prefabs/player_common"
 
local assets = {
 
        Asset( "ANIM", "anim/player_basic.zip" ),
        Asset( "ANIM", "anim/player_idles_shiver.zip" ),
        Asset( "ANIM", "anim/player_actions.zip" ),
        Asset( "ANIM", "anim/player_actions_axe.zip" ),
        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),
        Asset( "ANIM", "anim/player_actions_shovel.zip" ),
        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),
        Asset( "ANIM", "anim/player_actions_eat.zip" ),
        Asset( "ANIM", "anim/player_actions_item.zip" ),
        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),
        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),
        Asset( "ANIM", "anim/player_actions_fishing.zip" ),
        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),
        Asset( "ANIM", "anim/player_bush_hat.zip" ),
        Asset( "ANIM", "anim/player_attacks.zip" ),
        Asset( "ANIM", "anim/player_idles.zip" ),
        Asset( "ANIM", "anim/player_rebirth.zip" ),
        Asset( "ANIM", "anim/player_jump.zip" ),
        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),
        Asset( "ANIM", "anim/player_teleport.zip" ),
        Asset( "ANIM", "anim/wilson_fx.zip" ),
        Asset( "ANIM", "anim/player_one_man_band.zip" ),
        Asset( "ANIM", "anim/shadow_hands.zip" ),
        Asset( "SOUND", "sound/sfx.fsb" ),
        Asset( "SOUND", "sound/wilson.fsb" ),
        Asset( "ANIM", "anim/beard.zip" ),
 
-- include character's custom assets
        Asset( "ANIM", "anim/boge.zip" ),
Asset( "ANIM", "anim/hat_ushanka.zip"),
Asset( "ANIM", "anim/food_sandvich.zip"),
Asset( "ANIM", "anim/ghost_boge_build.zip" ),
 
}
 
local prefabs = {
"hat_ushanka", 
"food_sandvich",
"beardhair",
};
 
local start_inv = {
-- custom starting inventory
};
 
local function common_postinit(inst)
inst.avatar_tex   = "avatar_boge.tex"
inst.avatar_atlas = "images/avatars/avatar_boge.xml"
inst.avatar_ghost_tex   = "avatar_ghost_boge.tex"
    inst.avatar_ghost_atlas = "images/avatars/avatar_ghost_boge.xml"
end
 
local function master_postinit(inst)
 
-- choose which sounds this character will play
inst.soundsname = "wilson"
 
-- minimap icon
inst.MiniMapEntity:SetIcon( "boge.tex" )
 
-- stats
local WalkSpeed = (TUNING.WILSON_WALK_SPEED * 1.0)
local RunSpeed = (TUNING.WILSON_RUN_SPEED * 1.0)
 
inst.components.health:SetMaxHealth(200)
inst.components.hunger:SetMax(150)
inst.components.sanity:SetMax(100)
inst.components.combat.damagemultiplier = 1
inst:AddComponent("dapperness")
inst.components.dapperness.dapperness = TUNING.DAPPERNESS_SMALL
-- withstands cold 2x more than wilson
inst.components.temperature.hurtrate = (TUNING.WILSON_HEALTH / TUNING.FREEZING_KILL_TIME) / 2
 
-- works faster
inst:AddComponent("worker")
inst.components.worker:SetAction(ACTIONS.CHOP, 1)
inst.components.worker:SetAction(ACTIONS.MINE, 1)
inst.components.worker:SetAction(ACTIONS.HAMMER, 1)
 
-- food
inst.components.eater:SetOmnivore (true)
 
--/outdated code, and wrong... 
--/why did I ever thought to edit the tuning class back in the day?
--/don't uncomment the code below, it will crash the game.
--TUNING.STACK_SIZE_LARGEITEM = 15
--TUNING.STACK_SIZE_MEDITEM = 30
--TUNING.STACK_SIZE_SMALLITEM = 60
--TUNING.EVERGREEN_CHOPS_SMALL = 4
--TUNING.EVERGREEN_CHOPS_NORMAL = 8
--TUNING.EVERGREEN_CHOPS_TALL = 12
--TUNING.ROCKS_MINE = 4
--TUNING.ROCKS_MINE_MED = 3
--TUNING.ROCKS_MINE_LOW = 2
--TUNING.MARBLEPILLAR_MINE = 8
--TUNING.MARBLETREE_MINE = 6
end
 
local function OnResetBeard(inst)
    inst.AnimState:ClearOverrideSymbol("beard")
end
 
--tune the beard economy...
local BEARD_DAYS = { 2, 3, 4 }
local BEARD_BITS = { 1, 3,  9 }
 
local function OnGrowShortBeard(inst)
    inst.AnimState:OverrideSymbol("beard", "beard", "beard_short")
    inst.components.beard.bits = BEARD_BITS[1]
end
 
local function OnGrowMediumBeard(inst)
    inst.AnimState:OverrideSymbol("beard", "beard", "beard_medium")
    inst.components.beard.bits = BEARD_BITS[2]
end
 
local function OnGrowLongBeard(inst)
    inst.AnimState:OverrideSymbol("beard", "beard", "beard_long")
    inst.components.beard.bits = BEARD_BITS[3]
end
 
local function master_postinit(inst)
    inst:AddComponent("beard")
    inst.components.beard.onreset = OnResetBeard
    inst.components.beard.prize = "beardhair"
    inst.components.beard:AddCallback(BEARD_DAYS[1], OnGrowShortBeard)
    inst.components.beard:AddCallback(BEARD_DAYS[2], OnGrowMediumBeard)
    inst.components.beard:AddCallback(BEARD_DAYS[3], OnGrowLongBeard)
end
 
return MakePlayerCharacter("boge", prefabs, assets, common_postinit, master_postinit, start_inv)
 
 
Oddly, the custom stats aren't working now.
Edited by Boge
Link to comment
Share on other sites

@Boge, that should be working as far as I can tell. There might be something else causing issues, but I'd need to see the entire mod to determine what exactly is causing it.

 

Yeah, I edited my previous message.  It's working, but how do I use my own custom beard rather than Wilson's beard?

Link to comment
Share on other sites

Yeah, I edited my previous message.  It's working, but how do I use my own custom beard rather than Wilson's beard?

 

You need to use k-tools krane.exe and decompile beards animation and build files. That will give you the base for beards, you will then need to use spriter to create your new beard along with an image editing software.

Link to comment
Share on other sites

You need to use k-tools krane.exe and decompile beards animation and build files. That will give you the base for beards, you will then need to use spriter to create your new beard along with an image editing software.

 

Searched around a bit, and I'm not sure how to decompile the files.  Is it the whole .zip file, or the .bin files inside it?

 

Also, I might have gotten an old version.  I double click the exe and it just flashes a cmd prompt real quick.  I can't read it.

Link to comment
Share on other sites

@Boge, you will need to read the documentation which comes with k-tools in order to figure out how to properly use it. There is also documentation else where on the forums under the Don't Starve mod and tools sub-forum. It's a command line application, so you will need to be familiar with the command prompt or terminal app of your operating system.

Link to comment
Share on other sites

Okay, so I get the files edited and placed back into another .zip with the anim.bin, atlas-0.tex, and build.bin.

 

How do I make it so my characters beard uses that particular .zip file rather than the Wilson beard?

Link to comment
Share on other sites

@Boge, well if you are using Spriter then you should be able to set the entity name, which will basically be the bank. If you're not using Spriter then you need to rename the build name with the tools which came with k-tools. Once you've completed that, look in your code at the OverrideSymbol for the beard:

 

 inst.AnimState:OverrideSymbol("beard", "beard", "beard_short")

 

This function parameters/arguments are as followed: Animation Symbol, Animation Bank, Override Symbol from Animation Bank.

 

You should only need to change the Animation Bank portion of the code or the second parameter/argument.

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...