Jump to content

Recommended Posts

Hello everyone!
I have a question about character module creation.
We all know that the skin changing plugin is [[ inst.components.skinner:SetSkinMode]] . I can use it to change the appearance of the character inside the game and make a polymorphic character. But after I dressed my character there was a strange problem.

This is the initial state of my character:

image.png.8a1d959e4d6675647a4612980d20293c.png

I can see my character wearing clothes....

But when I change the form of the character:

image.png.753a34db608f8a53fd8dca56227c841c.png

The clothes are actually missing!

I went looking for the code for a character like Wanda, but couldn't figure out what I was doing wrong.

This is the code that defines my character's appearance , It contains two different external appearance compression packages .

 

 

return CreatePrefabSkin("welin_none",
{
    base_prefab = "welin",
    type = "base",
    assets = assets,
    skins = {
    normal_skin = "welin",
    up_one_skin = "welin_up_one",
    ghost_skin = "ghost_welin_build",
},
    skin_tags = {"WELIN","CHARACTER", "BASE"},
    build_name_override = "welin",
    rarity = "Character",
    rarity_modifier = "CharacterModifier",
    skip_item_gen = false,
    skip_giftable_gen = false,
    torso_tuck_builds = { "welin", "welin_up_one",},
    has_alternate_for_body = { "welin_up_one", },
    has_alternate_for_skirt = { "welin_up_one", },
})

 

 

This is the code I used to replace the form (the box inside did not work)

 

 

local function imveryangry(inst,silent)--变身换的皮肤
inst:DoTaskInTime(0.8, function(inst)
    if inst:HasTag("concentraction") then
    inst.components.skinner:SetSkinMode("up_one_skin")
    --inst.overrideskinmode = "up_one_skin"
--[[        if not inst.sg:HasStateTag("ghostbuild") then
        UpdateSkinMode(inst, "up_one_skin", not silent)
    end]]
      inst.SoundEmitter:PlaySound("dontstarve/characters/wendy/abigail/shield/on")
    else
    inst.components.skinner:SetSkinMode("normal_skin")
    --inst.overrideskinmode = nil
    --[[if not inst.sg:HasStateTag("ghostbuild") then
        UpdateSkinMode(inst, "normal_skin", not silent)
    end]]
      inst.SoundEmitter:PlaySound("dontstarve/characters/wendy/abigail/shield/on")
    end
    end)
end

 

Is there any expert who knows how to keep the clothes when changing the skin? I do not want to change the state and then naked .

Please help me, it's the first time a newcomer does a module !

 

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