Hornete Posted February 9, 2020 Share Posted February 9, 2020 (edited) 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! 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. 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!) 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! Congratulations! You did it! I'll be going over skin portraits and swap_icons right now 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. 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! Next, open the game up and let the compiler run and badum! You 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. 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! 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 May 25, 2022 by Hornete Deprecated 14 10 1 Link to comment Share on other sites More sharing options...
Mr. Tiddles Posted February 9, 2020 Share Posted February 9, 2020 thanks very cool 2 Link to comment Share on other sites More sharing options...
ADM Posted February 9, 2020 Share Posted February 9, 2020 Oh well, I was wondering if I'll have the opportunity to make skins for Wirlywings properly one day, I'm very proud of your work, thanks you so much ! 1 1 Link to comment Share on other sites More sharing options...
CarlZalph Posted February 9, 2020 Share Posted February 9, 2020 (edited) 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 February 9, 2020 by CarlZalph 1 Link to comment Share on other sites More sharing options...
Hornete Posted February 9, 2020 Author Share Posted February 9, 2020 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 1 Link to comment Share on other sites More sharing options...
GuyNamedChris Posted February 9, 2020 Share Posted February 9, 2020 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. 1 Link to comment Share on other sites More sharing options...
Fuffles Posted February 9, 2020 Share Posted February 9, 2020 Because its not a mod, but a tutorial 3 Link to comment Share on other sites More sharing options...
SophPlays Posted February 10, 2020 Share Posted February 10, 2020 SCREEEEE Thank you for this askjhds 2 Link to comment Share on other sites More sharing options...
icantevenname Posted February 19, 2020 Share Posted February 19, 2020 Why can I only Thank this post only once? I should Thank you 10 times! 1 1 Link to comment Share on other sites More sharing options...
icantevenname Posted February 19, 2020 Share Posted February 19, 2020 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. 1 Link to comment Share on other sites More sharing options...
Hornete Posted February 20, 2020 Author Share Posted February 20, 2020 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! 2 2 Link to comment Share on other sites More sharing options...
Canis Posted March 10, 2020 Share Posted March 10, 2020 this should be pinned tbh 3 1 Link to comment Share on other sites More sharing options...
Ultroman Posted March 10, 2020 Share Posted March 10, 2020 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? 1 1 Link to comment Share on other sites More sharing options...
Hornete Posted March 10, 2020 Author Share Posted March 10, 2020 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 1 1 Link to comment Share on other sites More sharing options...
Ultroman Posted March 10, 2020 Share Posted March 10, 2020 1 hour ago, Hornete said: I hope that makes sense, haha Absolutely stellar information right there, m8! Thanks 2 Link to comment Share on other sites More sharing options...
PanAzej Posted March 15, 2020 Share Posted March 15, 2020 What a great thing. Great work and thanks for sharing! My subscribers will be able to use Mala Mi's skins once again! Working on an update right away. 5 1 Link to comment Share on other sites More sharing options...
Toros Posted March 16, 2020 Share Posted March 16, 2020 This is amazing and easy to use. 10/10. 2 1 Link to comment Share on other sites More sharing options...
ILikeHoneyBees Posted March 19, 2020 Share Posted March 19, 2020 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! 1 Link to comment Share on other sites More sharing options...
Hornete Posted March 19, 2020 Author Share Posted March 19, 2020 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 More sharing options...
ILikeHoneyBees Posted March 19, 2020 Share Posted March 19, 2020 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. 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. 1 Link to comment Share on other sites More sharing options...
Hornete Posted March 19, 2020 Author Share Posted March 19, 2020 10 minutes ago, ILikeHoneyBees said: [snip] Looks like you didn't rename that file, Make sure its renamed to "zeta_rose" Link to comment Share on other sites More sharing options...
ILikeHoneyBees Posted March 19, 2020 Share Posted March 19, 2020 13 minutes ago, Hornete said: 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! thanks so much for the help by the way. I've been waiting since late September to do this! 1 Link to comment Share on other sites More sharing options...
ILikeHoneyBees Posted March 19, 2020 Share Posted March 19, 2020 Okay so I made a really bad mistake and now I had to go back and re-insert the programming. now I've gotten this error and I'm not sure what's wrong. have any advice? Here is the log as well. I don't know if that helps 1 Link to comment Share on other sites More sharing options...
Hornete Posted March 19, 2020 Author Share Posted March 19, 2020 6 minutes ago, ILikeHoneyBees said: [snip] May you show me the zeta_none file? Link to comment Share on other sites More sharing options...
ILikeHoneyBees Posted March 19, 2020 Share Posted March 19, 2020 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 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