Jump to content

cant get a skin to change


Recommended Posts

so i have a problem  not sure what is going on  but something isnt right. okay so my delima is trying to have character ghosts to correspond with their elegants

but when i start the game and die i only get the default skin originally i thought it was dealing with this bit in the log.txt

[00:02:27]: Could not find anim [death] in bank [ghost]
[00:02:27]: Serializing user: session/025B7712BD5F856F/KU_XQT2AFpN_/0000000020
[00:02:27]: SAVING Morgue    38    
[00:02:27]: Start world reset countdown... 120 seconds...    
[00:02:35]: Could not find anim [idle_loop] in bank [ghost]
[00:02:35]: Stop world reset countdown 

  [00:02:38]: Could not find anim [transform] in bank [wilson]

however when editing the scml files to match with the set anims described i managed to get the error away

[00:02:15]: SAVING Morgue    40    
[00:02:15]: Start world reset countdown... 120 seconds...    
[00:02:20]: attempt to call a nil value
[00:02:22]: Stop world reset countdown    
[00:02:25]: Could not find anim [transform] in bank [wilson]

 

but I am still shown a default skin set. I have been told from my partner that i may have something to deal with the stategraph but thats the last ive asked

local function wendy_becomeghost(inst, data)
    local skin = inst.components.skinner:GetClothing().base
    skin = string.sub(skin, 7) --removes the "wilson_" part
    skin = skin == "none" and "normal" or skin -- if its "none", renames it to "normal"
    inst.AnimState:SetBuild("ghost_wendy_" .. skin) -- sets the build to the skin
    print("Skin set to: " .. skin)
end

AddPrefabPostInit("wendy", function(inst)

    inst:ListenForEvent("becomeghost", wendy_becomeghost)
end)

this is the code i was given looking at the log it shows its working but isnt actually changing the skin

it has wendy in there cause thats the only character i have that has all the skins so i can test if it works

 

Edited by EsaiXD
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...