Jump to content

How do I add a mod character skin mode for the wardrobe?


Recommended Posts

Hello fellow modders.

So I recently started to play DST again and I found something interesting in the wardrobe when you cycle views with some characters in the game, where it shows you the other states/modes of the characters

You know how when you cycle views with Wolfgang so you can see what he looks like when he's mighty, wimpy or a ghost?

Spoiler

image.thumb.png.bf34f5d210b0bb532f7146012b1cda34.pngimage.thumb.png.148eaddb05277d4c8abeff40135683c2.pngimage.thumb.png.006121b94702c4a0bdc0f4a06ca61952.png

Yeah, that's exactly what I'm aiming to do for my character mods and I know for sure it's possible because I just read this from the game's recent patch notes.

Quote
  • Added support for mod character mode previewing using AddModCharacter(). Argument supplied is a table containing a table for each mode in order, with values for name, play_emotes, build, bank, idle_anim, scale, and offset.

However, I'm having a hard time trying to set the code up and I'm really stumped on what to do.

I tried taking the code that does this stuff for the official characters and still nothing changed and now I'm stuck with this line of code

AddModCharacter("stormish", "MALE", {{name = "normal_skin", scale = 1.5}, {name = "human_skin"}, {name = "ghost_skin", scale = 0.75, offset = {0, -25}}})

I'm not really sure if I'm doing this correctly, if anyone here already added that feature for their character mod, please show me how it's done, thanks in advance.

Edited by Stormish
Link to comment
Share on other sites

9 hours ago, Stormish said:

I tried taking the code that does this stuff for the official characters and still nothing changed and now I'm stuck with this line of code

Where did you find this code? I'd like to take a look.

Link to comment
Share on other sites

3 minutes ago, Hornete said:

Where did you find this code? I'd like to take a look.

The code is from skinsutils.lua, which I believe contains many global functions for skins for any character in the game.

Here's the code btw

Spoiler

function GetSkinModes(character)
	if skintypesbycharacter == nil then
		skintypesbycharacter = {
			woodie = { { type = "normal_skin" }, { type = "werebeaver_skin", scale = 0.82 }, { type = "ghost_skin", scale = ghost_preview_scale, offset = { 0, ghost_preview_y_offset } }, { type = "ghost_werebeaver_skin", scale = ghost_preview_scale, offset = { 0, ghost_preview_y_offset } } },
			wolfgang = { { type = "normal_skin" }, { type = "wimpy_skin", scale = 0.9 }, { type = "mighty_skin", scale = 1.25 }, { type = "ghost_skin", scale = ghost_preview_scale, offset = { 0, ghost_preview_y_offset } } },
			wormwood = { { type = "normal_skin" }, { type = "stage_2" }, { type = "stage_3" }, { type = "stage_4" }, { type = "ghost_skin", scale = ghost_preview_scale, offset = { 0, ghost_preview_y_offset } } },

			default = { { type = "normal_skin" }, { type = "ghost_skin", scale = ghost_preview_scale, offset = { 0, ghost_preview_y_offset } } }
		}
	end
	return skintypesbycharacter[character] or skintypesbycharacter.default
end

 

 

Link to comment
Share on other sites

Here is my solution if you want to add a ghost skin to your character.

local ghost_preview_y_offset = -25
local ghost_preview_scale = 0.75
AddModCharacter("yourcharacter", "YOURGENDER", {--see the yourcharacter_none file for your skins
     --by default the default skin is already included and not needed
		ghost_skin = {build = "ghost_yourcharacter_build", bank = "ghost", idle_anim = "idle", scale = ghost_preview_scale, offset = {0, ghost_preview_y_offset}},
	})

If you want to add other skins you will need to do so in a similar template:
 

characterskin = {
	build = "characterbuild", --.zip file name without extention or path
	bank = "characterbank", --"wilson" or "ghost" unless you are not using the default animation banks like werebeaver
	idle_anim = "character_idleanim", --default animation to play such as "idle_loop" or "idle" for ghosts see SG_wilson
	play_emotes = boolean, --enable or disable emotes, werebeaver and ghost cannot play emotes so I believe its disabled by default
	scale = 1, --multiplier to change the size see wolfgang mighty form
	offset = {x,y}, --x,y offset
  }
skinspuppet.lua --default values
local new_build = skintype.build or self.default_build
local new_bank = skintype.bank or "wilson"
local new_idle_anim = skintype.idle_anim or "idle_loop"
local new_play_emotes = skintype.play_emotes or false

Hope this helps

  • Like 1
Link to comment
Share on other sites

1 hour ago, IronHunter said:

Here is my solution if you want to add a ghost skin to your character.


local ghost_preview_y_offset = -25
local ghost_preview_scale = 0.75
AddModCharacter("yourcharacter", "YOURGENDER", {--see the yourcharacter_none file for your skins
     --by default the default skin is already included and not needed
		ghost_skin = {build = "ghost_yourcharacter_build", bank = "ghost", idle_anim = "idle", scale = ghost_preview_scale, offset = {0, ghost_preview_y_offset}},
	})

If you want to add other skins you will need to do so in a similar template:
 


characterskin = {
	build = "characterbuild", --.zip file name without extention or path
	bank = "characterbank", --"wilson" or "ghost" unless you are not using the default animation banks like werebeaver
	idle_anim = "character_idleanim", --default animation to play such as "idle_loop" or "idle" for ghosts see SG_wilson
	play_emotes = boolean, --enable or disable emotes, werebeaver and ghost cannot play emotes so I believe its disabled by default
	scale = 1, --multiplier to change the size see wolfgang mighty form
	offset = {x,y}, --x,y offset
  }

skinspuppet.lua --default values
local new_build = skintype.build or self.default_build
local new_bank = skintype.bank or "wilson"
local new_idle_anim = skintype.idle_anim or "idle_loop"
local new_play_emotes = skintype.play_emotes or false

Hope this helps

Ok, this is unfortunate.

I tried using the same code you pasted here and it still seems like nothing changed, did Klei not implement the feature properly or something?

Also here's what my code looks like now:

local ghost_preview_y_offset = -25
local ghost_preview_scale = 0.75

AddModCharacter("jangton", "MALE", {
	skeleton_skin = {
		build = "jangton_skeleton",
		bank = "wilson",
		idle_anim = "idle_loop",
		play_emotes = true,
		scale = 1,
		offset = {0, 0}
	},
	ghost_skin = {
		build = "ghost_jangton_build",
		bank = "ghost",
		idle_anim = "idle",
		scale = ghost_preview_scale,
		offset = {0, ghost_preview_y_offset}
	},
})

 

Link to comment
Share on other sites

Weird it works for me flawlessly, what is not working? Because I know by default the cycle menu should have the bigpicture and default model, if you got wilson or its invisible showing up then its likely a typo somewhere.


I am also assuming you are running this in modmain

This code is literally what I am using just with the name and gender swapped for my various characters.

Edited by IronHunter
  • Like 1
Link to comment
Share on other sites

5 minutes ago, IronHunter said:

Weird it works for me flawlessly, what is not working? Because I know by default the cycle menu should have the bigpicture and default model, if you got wilson or its invisible showing up then its likely a typo somewhere.


I am also assuming you are running this in modmain

This code is literally what I am using just with the name and gender swapped for my various characters.

Uh, Hey! Do you know if it's possible to show a character with a hat equipped? In my case I wanna show Wagstaff with his goggles equipped if that's possible?

Link to comment
Share on other sites

1 hour ago, Hornete said:

Uh, Hey! Do you know if it's possible to show a character with a hat equipped? In my case I wanna show Wagstaff with his goggles equipped if that's possible?

It doesn't seem the default code supports hats, it should be possible to mod it so it does. But that might require modifying one of those widget files, which at this time is not something I am too comfortable with doing.

  • Like 1
Link to comment
Share on other sites

11 hours ago, IronHunter said:

Weird it works for me flawlessly, what is not working? Because I know by default the cycle menu should have the bigpicture and default model, if you got wilson or its invisible showing up then its likely a typo somewhere.


I am also assuming you are running this in modmain

This code is literally what I am using just with the name and gender swapped for my various characters.

I am definitely running this in modmain.

And no, it doesn't show me Wilson or nothing, it shows me the default model of the character itself with its own ghost, but it doesn't show the other skins at all, I did a bit of research and changed the ghost build to the Wilson ghost build and unfortunately, the ghost skin build doesn't change in the wardrobe.

Also if you don't mind, can you send me one of your character's modmain files only to make sure that I'm doing this right?

Edited by Stormish
Link to comment
Share on other sites

4 hours ago, Stormish said:

I am definitely running this in modmain.

And no, it doesn't show me Wilson or nothing, it shows me the default model of the character itself with its own ghost, but it doesn't show the other skins at all, I did a bit of research and changed the ghost build to the Wilson ghost build and unfortunately, the ghost skin build doesn't change in the wardrobe.

Also if you don't mind, can you send me one of your character's modmain files only to make sure that I'm doing this right?

So the ghost skin works then? but the other doesn't because by default it doesn't show ghost skins for modded characters. Make sure your character_none file has the assets properly for your respective skins. Missing assets will not load
 

local ghost_preview_y_offset = -25
local ghost_preview_scale = 0.75
AddModCharacter("brittany", "FEMALE", {
		--brittany = {build = "brittany", bank = "wilson", idle_anim = "idle_loop", play_emotes = true},
		ghost_skin = {build = "ghost_brittany_build", bank = "ghost", idle_anim = "idle", scale = ghost_preview_scale, offset = {0, ghost_preview_y_offset}},
	})

--replace brittany with your character name, I commented out the other one but its basically just an example to get it to work. As this is really all I did for making it work in my characters.
--the commented out one was to test if it would work, and it does give my character's her skin when tested. So it should work for any of your characters.

 

  • Like 1
Link to comment
Share on other sites

5 hours ago, IronHunter said:

So the ghost skin works then? but the other doesn't because by default it doesn't show ghost skins for modded characters. Make sure your character_none file has the assets properly for your respective skins. Missing assets will not load
 


local ghost_preview_y_offset = -25
local ghost_preview_scale = 0.75
AddModCharacter("brittany", "FEMALE", {
		--brittany = {build = "brittany", bank = "wilson", idle_anim = "idle_loop", play_emotes = true},
		ghost_skin = {build = "ghost_brittany_build", bank = "ghost", idle_anim = "idle", scale = ghost_preview_scale, offset = {0, ghost_preview_y_offset}},
	})

--replace brittany with your character name, I commented out the other one but its basically just an example to get it to work. As this is really all I did for making it work in my characters.
--the commented out one was to test if it would work, and it does give my character's her skin when tested. So it should work for any of your characters.

 

No, nothing works, the ghost skin and the default skin works by default for any modded character period, but changing the ghost skin or the default skin or even adding another skin for the character doesn't work AT ALL, it's like they're the same thing and nothing new happened to the character.

If you feel like this is tiring, do you mind if I give you my modmain file or even my whole mod files? Because I have no idea why this is not working at all.

Also I tested the charactername thing and it feels like there was no result, and I even disabled all mods (client mods and server mods) and only enabled the 2 character mods that I have added these features for and nothing happened.

Edited by Stormish
Link to comment
Share on other sites

1 hour ago, Stormish said:

No, nothing works, the ghost skin and the default skin works by default for any modded character period, but changing the ghost skin or the default skin or even adding another skin for the character doesn't work AT ALL, it's like they're the same thing and nothing new happened to the character.

If you feel like this is tiring, do you mind if I give you my modmain file or even my whole mod files? Because I have no idea why this is not working at all.

Also I tested the charactername thing and it feels like there was no result, and I even disabled all mods (client mods and server mods) and only enabled the 2 character mods that I have added these features for and nothing happened.

Really? because for me the ghost skin never showed up on my characters until I added the skin via the methods I posted above.

I also managed to get custom skins to show up the same way without needing to make any other changes. Feel free to upload your stuff.

I just can't share my personal mod at this time.

  • Like 1
Link to comment
Share on other sites

11 hours ago, IronHunter said:

Really? because for me the ghost skin never showed up on my characters until I added the skin via the methods I posted above.

I also managed to get custom skins to show up the same way without needing to make any other changes. Feel free to upload your stuff.

I just can't share my personal mod at this time.

Alright, just sent you the files in a PM.

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