Jump to content

[DEPRECATED] [Tutorial] Making Custom Skins for Modded Characters!


Hornete
 Share

Recommended Posts

THIS TUTORIAL IS NOW DEPRECATED

Spoiler

Hey all! For the past few days i've been working on some code to put the head/base skin option for Modded Characters. And I have finished! And felt it was optimised enough to share to the public!

All I ask for you, is to credit me if you do end up using this!

6xGNXwkcheFcOY_X-pkgw2sebGT0RH53ntzkQTDRyjpwZ3z38T7OsF7TUtS91SCutMdD-nbrZPUuVhCxTT_VlSc_33DeBWW9lgF2a3twCreWzqHBKaYNi01MJ7-1Wkt4Kw

What do I need?

-My File! (You can rename it to whatever you want, but I named it to "skins_api" for this tutorial)

-Some basic knowledge of compiling

-You should probably have a finished character mod before attempting skins, haha

 

Something to note, Make sure, for the name of your skins you will HAVE to name it in the way shown below


"prefab-name-of-your-character_skin-set"

Some correctly named skins would be...

"wagstaff_roseate"
"wheeler_nature"
"warbucks_victorian"
"wilba_formal"

The skin names below are NOT correctly named

"nature_wilba"
"gladiator_wheeler"
"magma_wagstaff"


--For reference, Here is a list of all the skin sets in the game!

GoH - formal
Survivor - survivor
Triumphant - shadow
Roseate - rose
Costume - [skip]
Gladiator - gladiator
Snowfallen - ice
Verdant - nature
Victorian - victorian
Magmatic - magma
Hallowed - [skip]
Wrestler - wrestler


 

Now that we made that clear, You're going to want to create... well your actual skin! If you've followed the Extended Character Template (Which i'm pretty sure you obviously have) you can simply download it again, or if you already have it, and then get your exported folder and start drawing your new skin!

What'd I reccomend is copying all your characters files over to this new exported folder and then start drawing your new pngs.

LxaOhm35TdjazWAyuZSH92ZHlt3qwyTqcDh5U3dEnnUrC_bRKhesjWV8UHC3efmO5ayqjEpubwcIArZ3NFtylgOhuDLDPS-csb7O5Nxk37Ddp_BB_vOjpCZQ1ua1qB3gXA

Now you can finish drawing the assets or set it up and move on to the code and finish the art later. Once you are done your art run the game and the autocompiler should run exporting your skin into an zipped folder in the anims folder.

You'll want to download the file I put in the beginning of this tutorial and put it in your mod, like this! (Again, using the name skins_api, but you can name it to whatever you like!)
89i6HyDrpUeLiarpfvoVxrTa-lS_MB9odtxnsKxhQHExKRk9_C7-3ESEwr4qOIyUEFy4DFtm7pfK7ap7GC4nYY3DvzcivwBwpL1IGb2PEigVkDX9Q2tXu-s3DJ-63hwgBw

Now, you'll want to put this code in your modmain.lua


--Hornet: I am currently using wilba as an example, youll want to change all instances of "wilba" to the prefab name of your character!
--Skins
local _G = GLOBAL
local PREFAB_SKINS = _G.PREFAB_SKINS
local PREFAB_SKINS_IDS = _G.PREFAB_SKINS_IDS
local SKIN_AFFINITY_INFO = GLOBAL.require("skin_affinity_info")

modimport("skins_api") --Hornet: We import the file! If you named your file something else other than skins_api then youll want to rename this function to the name of the file

SKIN_AFFINITY_INFO.wilba = {
	"wilba_victorian", --Hornet: These skins will show up for the character when the Survivor filter is enabled
}

--[[ --Hornet: The table of skins youre going to have, You can have as many skins as you want!

PREFAB_SKINS["wilba"] = {
	"wilba_none", 
	"wilba_roseate",
	"wilba_victorian",
} --And So on!

]]

PREFAB_SKINS_IDS = {} --Make sure this is after you  change the PREFAB_SKINS["character"] table
for prefab,skins in pairs(PREFAB_SKINS) do
    PREFAB_SKINS_IDS[prefab] = {}
    for k,v in pairs(skins) do
      	  PREFAB_SKINS_IDS[prefab][v] = k
    end
end



AddSkinnableCharacter("wilba") --Hornet: The character youd like to skin, make sure you use the prefab name. And MAKE sure you run this function AFTER you import the skins_api file

--Skin STRINGS

STRINGS.SKIN_NAMES.wilba_none = "Wilba"
STRINGS.SKIN_NAMES.wilba_victorian = "The Victorian"

STRINGS.SKIN_QUOTES.wilba_victorian = "\"WILBA'TH DOTH NOT WANT WEARETH O' MOTHERS DRESS!\""
STRINGS.SKIN_DESCRIPTIONS.wilba_victorian = "Wilba's tendency to go Full Hog was simply not enough to stop her mother from dressing her up all fancy-like."

 

Now that you've done that, it's time to actually create the skins code-wise! You will want to head over to your characters _none file.

I named it "wilba_skins" but you can keep it as character_none! Whatever you wish


--Hornet: This is how I did my skins prefab file!, Obviously youll need to change all instances of wilba to your characters prefab name
local prefabs = {}

table.insert(prefabs, CreatePrefabSkin("wilba_none", --This skin is the regular default skin we have, You should already have this
{
	base_prefab = "wilba", --What Prefab are we skinning? The character of course!
	build_name_override = "wilba",
	type = "base", --Hornet: Make sure you have this here! You should have it but ive seen some character mods with out
	rarity = "Character",
	skip_item_gen = true,
	skip_giftable_gen = true,
	skin_tags = { "BASE", "WILBA", },
	skins = {
		normal_skin = "wilba",      --These are your skin modes here, now you should have 2. But I actually have 4 for WIlba! Due to her werewilba form and transformation animation
		werewilba_skin = "werewilba",  --If your character is a character like Woodie or Wilba with multiple transformations then youll want to have multiple skin modes
		transform_skin = "werewilba_transform", --Usually your character should have "normal_skin" and "ghost_skin" and Yes! You can actually edit the ghost skin to your liking
		ghost_skin = "ghost_wilba_build",
	},
	assets = {
		Asset( "ANIM", "anim/wilba.zip" ), --Self-explanatory, these are the assets your character is using!
		Asset( "ANIM", "anim/werewilba.zip" ),
		Asset( "ANIM", "anim/werewilba_transform.zip" ),
		Asset( "ANIM", "anim/ghost_wilba_build.zip" ),
	},

}))

table.insert(prefabs, CreatePrefabSkin("wilba_victorian", --Now heres the fun part, Our skin! I did "wilba_victorian" but you can do whatever skin set you want!
{
	base_prefab = "wilba",
	build_name_override = "wilba_victorian", --The build name of your new skin,
	type = "base",
	rarity = "Elegant", --I did the Elegant Rarity, but you can do whatever rarity you want!
	rarity_modifier = "Woven", --Ive put the rarity_modifier to Woven, Doesnt make a difference other than say youve woven the skin
	skip_item_gen = true,
	skip_giftable_gen = true,
	skin_tags = { "BASE", "WILBA", "VICTORIAN"}, --Notice in this skin_tags table I have "VICTORIAN", This tag actually makes the little gorge icon show up on the skin! Other tags will do the same thing such as forge, yotc, yotp, yotv, yog and so on!
	skins = {
		normal_skin = "wilba_victorian", --Rename your "normal_skin" accordingly
		werewilba_skin = "werewilba",
		transform_skin = "werewilba_transform",
		ghost_skin = "ghost_wilba_build", --And if you did a ghost skin, rename that too!
	},

	assets = {
		Asset( "ANIM", "anim/wilba_victorian.zip" ),
		Asset( "ANIM", "anim/werewilba.zip" ),
		Asset( "ANIM", "anim/werewilba_transform.zip" ),
		Asset( "ANIM", "anim/ghost_wilba_build.zip" ),
	},

}))

--If youd like to make more skins, simply copy the CreatePrefabSkin function and accordingly make new skins you want!

return unpack(prefabs)

 Congratulations! You've created your prefab skin!

And now, it's time to test!
Ud0K4KSlE544HNt8D8O7xBSex1WemuzhWrxGsUARDc4S93WvaqnkAKXX-Uw4lwqP0vGJXXPyOETVK7g_LYB9FOEfCiG7P8tAcZyc3jiqQr38eT_f6v4k7evtWOBDHqfpfg

Congratulations! You did it! I'll be going over skin portraits and swap_icons right now

GrzPUDUrhk89YOEMueF0OOBwXqe0PppcA_4A1TAZhT1cqUtS_kEBjVIbleBN0Vpf31G3QklmDmfTPxv5TvzjA4qvBkCTNfTNru6Rp_Qb4UV3OamK42tzCQdvf5ntnoDIPw

You may have noticed there's no icon here. Well that's because there's no SWAP_ICON!

You will find your swap_icon image in the exported folder of your skin. 

1rRoJOoanYYdIY5jY5L7USdEGcTyAGqdu7quRQRUt1oCQLgj6cVu4GFHzcXmtmQluxIiGPrV7O293VPwoBZekeyX4EY-F0Qya-z3smsuAtQtX85wirdLdeNffKuA1nJyqw

The image should be around 192x192. Make sure the pivot of the symbol is in the middle in the spriter file!

If you for some reason don't have this swap_icon, you'll want to make a new folder named SWAP_ICON, put your 192x192 image. Go to spriter and plop the image down, and make sure the pivot of the symbol is in the middle!

qzqgRYrx9Sdi_8pUFEPTJNZqnmTi6lnkQfb9YWBcWqNmxkezqCU9U1FLJ92Pphcy0pM3Oo7eRHBV9nAHPqS0o5y8tR7UWOVFpoS3GWk0E3oMJrwVG7uWDnc7izzDX2PBgw

Next, open the game up and let the compiler run and badum!

FSLpJ2VdOArKNQr_a3Jb1TNIu8FJwJA_AfgXm_J-0XWUE9-ey6iFPC75V0f4da1VdZgX614ZL1E54ayJ-PouMkqhBV8ukEVraOPiTeZeMtngv2h_QWbYh1Bwh_SjRBknIAYou should get something like this once you load into the game.

 

Portraits

Once you're done drawing your portrait, you'll want to have your xml and tex as usual

You can use the game’s autocompiler to compile your tex and .xml from a .png or use Handsome matts Tools(https://forums.kleientertainment.com/files/file/73-handsome-matts-tools/) to manually decompile the tex.

SPPV_xl_ZKKETG2ug_Ea5gB-guckGQEKoDHFFdWZ3KQvOGRRCdrYsOLhoye3t5ZJss1EFxNkLNCIqsGKHnV03T92cZRHQawau5InH9K1KGxmLH3DV1m4KJRyR6Jf6xSJrA

However, you’re probably going to need to change your xml file to this


<Atlas><Texture filename="wilba_victorian.tex" /><Elements><Element 
	name="wilba_victorian_oval.tex" 
	u1="0.0009765625"
	u2="0.9580078125" 
	v1="0.36181640625" 
	v2="0.99951171875"
 /></Elements></Atlas>

If you haven't noticed, the name variable here is going to need a "_oval" at the end of the skin name, so go ahead and put that in if it isn't like that already!

U4YJK3fA9NzeFpOpS0Zi3DayfmvtUF_kD4SCqnBr87RIYuyF722kjsVD9ThAQCV4iBdhAgs-V-Huu5NtNVxN7dY7U_QcMWMTVlE0np7M0RgQLA2uj1NeLZCngXWe3AL9fw

Woo! And of course don't forget to declare the big portrait assets in modmain.lua like this.


Asset( "IMAGE", "bigportraits/wilba_victorian.tex" ), --Into the Assets table in modmain.lua
Asset( "ATLAS", "bigportraits/wilba_victorian.xml" ),


 

And there you have it! That's all! Let's go over some obvious things

 

Am I allowed to create skins for Official Don't Starve Together Characters?

No.

Am I allowed to create skins for Non DST Don't starve characters such as Walani, Wagstaff, Wheeler, Wilba, Woodlegs and Wilbur?

Maybe? I get a lot of mixed answers from people and i'm not too sure on that. Obviously you can see I've been using Wilba as an example this entire time. I'm not going to release these skins without an official clear answer

 

If there's something you don't understand please PLEASE tell me! It's my first tutorial and i'm not sure if I explained everything well. Happy modding!

Edited by Hornete
Deprecated
  • Like 14
  • Thanks 10
  • Health 1
Link to comment
Share on other sites

What's the difference between this and: https://steamcommunity.com/sharedfiles/filedetails/?id=835602689

I haven't done anything with either yours or his, but seems like recreating a wheel if one already exists.

 

Well, besides the mod apparently needing updated?  Hah, it might be broken I 'unno.

Edited by CarlZalph
  • Sad 1
Link to comment
Share on other sites

24 minutes ago, CarlZalph said:

What's the difference between this and: https://steamcommunity.com/sharedfiles/filedetails/?id=835602689

I haven't done anything with either yours or his, but seems like recreating a wheel if one already exists.

 

Well, besides the mod apparently needing updated?  Hah, it might be broken I 'unno.

That mod is broken :p

  • Haha 1
Link to comment
Share on other sites

32 minutes ago, CarlZalph said:

What's the difference between this and: https://steamcommunity.com/sharedfiles/filedetails/?id=835602689

I haven't done anything with either yours or his, but seems like recreating a wheel if one already exists.

 

Well, besides the mod apparently needing updated?  Hah, it might be broken I 'unno.

The original modded skins is taking a while to update, it's broken rn. Also this one doesn't seem to be on the workshop.

  • Thanks 1
Link to comment
Share on other sites

On 2/19/2020 at 1:56 AM, icantevenname said:

Just a small thing I wanna say, you can give the _none skin a description just like the other skins.

Also, I wanna ask what are the Skin Tags that calls the other icons. I tried looking at how the official skins are titled, but it didn't help.

Here ya' go
 

"COSTUME" --Hallowed nights
"HALLOWED" -ALso hallowed nights
"VICTORIAN" - Gorge
"LAVA" - Gladiator and Magmatic
"ICE" - Snowfallen
"ROSE" - Roseate
"SHADOW" - Triumphant
"SURVIVOR" - Survivor
"YULE" -Merry maker

Tell me if there's any im missing!

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

6 minutes ago, Ultroman said:

This is great! Stealing this for the tutorial collection ;)

BTW, how do these skins jive with character transformations? Like wereform, beastform, whatever...This old tutorial doesn't support skins, right?

You'll need to do something like this,
 

inst.components.skinner:SetSkinMode("werewilba_skin")

This sets the different skins modes, and if we go to our skin prefabs here
 

table.insert(prefabs, CreatePrefabSkin("wilba_victorian",
{
	base_prefab = "wilba",
	build_name_override = "wilba_victorian",
	type = "base",
	rarity = "Elegant",
	rarity_modifier = "Woven",
	skip_item_gen = true,
	skip_giftable_gen = true,
	skin_tags = { "BASE", "WILBA", "VICTORIAN"},
	skins = {
		normal_skin = "wilba_victorian",
		werewilba_skin = "werewilba",
		transform_skin = "werewilba_transform",
		ghost_skin = "ghost_wilba_build",
	},
	assets = {
		Asset( "ANIM", "anim/wilba_victorian.zip" ),
		Asset( "ANIM", "anim/werewilba.zip" ),
		Asset( "ANIM", "anim/werewilba_transform.zip" ),
		Asset( "ANIM", "anim/ghost_wilba_build.zip" ),
	},
}))

Usually, the skinmode is "normal_skin", but for Wilba in my mod and Woodie in the game, they set the skin mode to something like "werewilba_skin", which will then change the characters form to whatever build you set as your "werewilba_skin"

I hope that makes sense, haha

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hello!

So I'm Trying to make a skin and I get this error when I load the character (this is the final test. all the art is done. I even have the swap icon!) I used the extended character template to test the artwork as I've gone along. I've changed all the names and I'm unsure what the problem is. I know that the code consistetly fails at this line

 

constructor(self, ...)

 

in the segment..

 

local function DoAddClassPostConstructBefore(classdef, postfn)
    local constructor = classdef._ctor
    classdef._ctor = function (self, ...)
        postfn(self, ...) --Put our post init BEFORE kleis code
        constructor(self, ...)
    end
end

the error is below. I would appreciate any help.
Thanks!
 

image.png

  • Like 1
Link to comment
Share on other sites

1 hour ago, ILikeHoneyBees said:

snip

In the CreatePrefabSkin functions you have, do you have this line?

type = "base"

 

Your game will crash if you do not have this line and thatd the likely cause of why you are crashing.

Link to comment
Share on other sites

15 hours ago, Hornete said:

In the CreatePrefabSkin functions you have, do you have this line?

type = "base"

 

Your game will crash if you do not have this line and thatd the likely cause of why you are crashing.

 

I did have that. but some of my names were wrong XD. I fixed that and I got to the character outfit area. the skin did register. but when I selected it the art files wern't showing up. I switched out the animation files to the ones from my test character (ECT with the skin's art files) and put them in. I then noticed that the portrait art was showing the default for both the none skin and the skin I'm trying to make. so I went and checked the coding and changed the asset files to a file just called (I'll just use CharacterName for now. but that's not what it was actally called, it was called zeta. you see, I'm not the person who made the mod. While I am in contact with them as I'm making it and have their premission) CharacterName. to CharacterName_none. I then tested the files and noiticed the game crashed over the missing .tex and .xml files. I replaced them and, well. now the game just closes without an error. I checked the logs and this is what I got right at the end. I've taken the exported folder out so the base art files arn't in the mod folder anymore. 

image.thumb.png.953e67d66765420fdb3f79265d597015.png

it's the last line. I get that consistenly. I've tried with other characters that have used this turtoiral it works. but I'm usure what I have done wrong. this keeps showing up. Do you have any idea what the problem could be?

Thanks in advance.

  • Like 1
Link to comment
Share on other sites

13 minutes ago, Hornete said:

image.thumb.png.8cd8ca8cd3424aef52b1e3631750945b.png
Looks like you didn't rename that file, Make sure its renamed to "zeta_rose"

I didn't even think about that! I'll give it a try now and let you know the results! :D thanks so much for the help by the way. I've been waiting since late September to do this!

  • Like 1
Link to comment
Share on other sites

4 minutes ago, Hornete said:

May you show me the zeta_none file?

here ya go

 

local assets =
{
    Asset( "ANIM", "anim/zeta.zip" ),
    Asset( "ANIM", "anim/ghost_zeta_build.zip" ),
}

local skins =
{
    normal_skin = "zeta",
    ghost_skin = "ghost_zeta_build",
}

local base_prefab = "zeta"

local tags = {"ZETA", "CHARACTER"}

return CreatePrefabSkin("zeta_none",
{
    base_prefab = base_prefab,
    skins = skins,
    assets = assets,
    tags = tags,

    skip_item_gen = true,
    skip_giftable_gen = true,
})

--Hornet: This is how I did my skins prefab file!, Obviously youll need to change all instances of wilba to your characters prefab name
local prefabs = {}

table.insert(prefabs, CreatePrefabSkin("zeta_none", --This skin is the regular default skin we have, You should already have this
{
    base_prefab = "zeta", --What Prefab are we skinning? The character of course!
    build_name_override = "zeta",
    type = "base", --Hornet: Make sure you have this here! You should have it but ive seen some character mods with out
    rarity = "Character",
    skip_item_gen = true,
    skip_giftable_gen = true,
    skin_tags = { "BASE", "ZETA", },
    skins = {
        normal_skin = "zeta_none",      --These are your skin modes here, now you should have 2. But I actually have 4 for WIlba! Due to her werewilba form and transformation animation
        ghost_skin = "ghost_zeta_build",
    },
    assets = {
        Asset( "ANIM", "anim/zeta.zip" ), --Self-explanatory, these are the assets your character is using!
        Asset( "ANIM", "anim/ghost_zeta_build.zip" ),
    },

}))

table.insert(prefabs, CreatePrefabSkin("zeta_rose", --Now heres the fun part, Our skin! I did "wilba_victorian" but you can do whatever skin set you want!
{
    base_prefab = "zeta",
    build_name_override = "zeta_rose", --The build name of your new skin,
    type = "base",
    rarity = "Elegant", --I did the Elegant Rarity, but you can do whatever rarity you want!
    rarity_modifier = "Woven", --Ive put the rarity_modifier to Woven, Doesnt make a difference other than say youve woven the skin
    skip_item_gen = true,
    skip_giftable_gen = true,
    skin_tags = { "BASE", "ZETA", "ROSE"}, --Notice in this skin_tags table I have "VICTORIAN", This tag actually makes the little gorge icon show up on the skin! Other tags will do the same thing such as forge, yotc, yotp, yotv, yog and so on!
    skins = {
        normal_skin = "zeta_rose", --Rename your "normal_skin" accordingly
        
        ghost_skin = "ghost_zeta_build", --And if you did a ghost skin, rename that too!
    },

    assets = {
        Asset( "ANIM", "anim/zeta_rose.zip" ),
        Asset( "ANIM", "anim/ghost_zeta_build.zip" ),
    },

}))

--If youd like to make more skins, simply copy the CreatePrefabSkin function and accordingly make new skins you want!

return unpack(prefabs)

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