Jump to content

Ghost is not showing

Recommended Posts

My ghost isn't showing, and IDK why


local MakePlayerCharacter = require "prefabs/player_common"

local assets = {
    Asset("SCRIPT", "scripts/prefabs/player_common.lua"),
    Asset( "ANIM", "anim/lucky_avocado_beard.zip" ),
    Asset( "ANIM", "anim/ghost_lucky_avocado_build.zip" )
local prefabs ={    "beardhair",}

-- Custom starting inventory
local start_inv = {

-- When the character is revived from human
local function onbecamehuman(inst)
    -- Set speed when not a ghost (optional)
    inst.components.locomotor:SetExternalSpeedMultiplier(inst, "lucky_avocado_speed_mod", 1)

local function onbecameghost(inst)
    -- Remove speed modifier when becoming a ghost
   inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "lucky_avocado_speed_mod")

-- When loading or spawning the character
local function onload(inst)
    inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman)
    inst:ListenForEvent("ms_becameghost", onbecameghost)

    if inst:HasTag("playerghost") then

-- This initializes for both the server and client. Tags can be added here.
local common_postinit = function(inst) 
    -- Minimap icon
    inst.MiniMapEntity:SetIcon( "lucky_avocado.tex" )

local function OnResetBeard(inst)    
--tune the beard economy...
local BEARD_DAYS = { 1, 3, 9 }
local BEARD_BITS = { 1, 3,  9 } 
local function OnGrowShortBeard(inst)    
inst.AnimState:OverrideSymbol("beard", "lucky_avocado_beard", "beard_short")    
inst.components.beard.bits = BEARD_BITS[1]end local function OnGrowMediumBeard(inst)    
inst.AnimState:OverrideSymbol("beard", "lucky_avocado_beard", "beard_medium")    
inst.components.beard.bits = BEARD_BITS[2]end local function OnGrowLongBeard(inst)    
inst.AnimState:OverrideSymbol("beard", "lucky_avocado_beard", "beard_long")    
inst.components.beard.bits = BEARD_BITS[3]end
-- This initializes for the server only. Components are added here.
local master_postinit = function(inst)
 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)
    -- choose which sounds this character will play
    inst.soundsname = "willow"
    -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
    --inst.talker_path_override = "dontstarve_DLC001/characters/"
    -- Stats    
    --Insulation values for winter/summer. 
    inst.components.temperature.inherentinsulation = -50 --Quicker Freezing
    inst.components.temperature.inherentsummerinsulation = 60 --Slower overheating
    -- Damage multiplier (optional)
    inst.components.combat.damagemultiplier = 1.25
    -- Hunger rate (optional)
    inst.components.hunger.hungerrate = 0.75 * TUNING.WILSON_HUNGER_RATE
    inst.OnLoad = onload
    inst.OnNewSpawn = onload

return MakePlayerCharacter("lucky_avocado", prefabs, assets, common_postinit, master_postinit, start_inv)

Link to comment
Share on other sites

here is some error logs if it helps

[00:02:49]: Could not find anim [death] in bank [ghost]
[00:02:49]: Could not find anim build FROMNUM
[00:02:49]: Serializing user: session/5C9E393516ACACC0/A7IMAGGSU5MV/0000000005
[00:02:49]: SAVING Morgue    7    
[00:02:49]: Start world reset countdown... 120 seconds...    
[00:03:03]: Could not find anim [idle_loop] in bank [ghost]
[00:03:03]: Stop world reset countdown    
[00:03:06]: Serializing user: session/5C9E393516ACACC0/A7IMAGGSU5MV/0000000005
[00:03:21]: DoRestart:    true    

Link to comment
Share on other sites

On 12/11/2019 at 11:13 AM, bullbro said:

Sorry for the delay! Graphics card just got back from repairs so I had to make up for lost time playing games. :p It looks like the issue was with the unexported build...well...not wanting to export. I freshened it up by pasting your editted images over the template again and changing its name. That seems to have fixed the issue 


Another note: You hadn't set his tab to only be usable by him. All other characters can access his crafts



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

  • Create New...