tangyuanyuan Posted October 25, 2022 Share Posted October 25, 2022 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: I can see my character wearing clothes.... But when I change the form of the character: 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 ! Link to comment https://forums.kleientertainment.com/forums/topic/144057-about-the-game-can-switch-the-shape-of-the-role/ Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now