Jump to content

Recommended Posts

Amateur modder here.
I've been reskinning some hats in the game, and that's been going fairly well (albeit with a more brute forced approach for the void cowl, but it's working cleanly enough), but the current wall I'm facing is getting the correct head sprites to show with this void cowl reskin I'm working on, since by default the head and face sprites are completely gone.

I think I have most of the logic I need, and am probably just missing something simple.
I can and have changed the head sprites, getting everything to show up, but when I was doing my testing, I found that though HAIR_HAT is working nicely, there are some characters, like Wortox or Warly, that have parts of their head sprite that go up too high, like Wortox's horns, and they still show since those parts are not tied to "hair." But when wearing something like a football helmet, the horns are not there, which implies there is a different head sprite that I should be using instead of the normal one, but despite my efforts, I have yet to find it.

I have tried much of the following, some of which in attempts to use the head sprite the football helmet uses.
I was particularly hopeful with some of the headbase_hat lines, but they never worked. (Also not all of these were tried at the same time, but just a collection of various things I have tried):
 

Spoiler

Long List Of Various Attempts

With the provided images of the sketch for my void cowl reskin, you can see that Wilson works fine, since his hair is tied to the HAIR_HAT, but not for Winona, Wortox, or Warly, but those parts are hidden when wearing other hats that would require it.

Screenshot 2025-06-09 171023.png

Screenshot 2025-06-09 170937.png

Screenshot 2025-06-09 170844.png

Screenshot 2025-06-09 042545.png

Narris_Skins.zip

This just in, the code was not in the spoiler, my apologies, I have not used that tool before.
 

				-- Clearing Prior OverrideSymbols (Just in case since not much else was working)
				inst.AnimState:ClearOverrideSymbol("head")
				inst.AnimState:ClearOverrideSymbol("headbase")

				-- Symbol overrides
				inst.AnimState:OverrideSymbol("head", "hat_football", "head")
				inst.AnimState:OverrideSymbol("headbase", "hat_football", "headbase")
				inst.AnimState:OverrideSymbol("head", "headbase_hat", "head") -- Learned the hard way that the game replaces with BUILDS
				
				-- Show symbols
				inst.AnimState:ShowSymbol("face")
				inst.AnimState:ShowSymbol("head")
				inst.AnimState:ShowSymbol("headbase_hat")

				-- Visibility
				inst.AnimState:Show("HAT")
				inst.AnimState:Hide("HAIR")
				inst.AnimState:Show("HAIR_HAT")
				inst.AnimState:Hide("HAIR_NOHAT")

				inst.AnimState:Hide("HEAD")
				inst.AnimState:Show("HEAD_HAT")
				inst.AnimState:Hide("HEAD_HAT_NOHELM")
				inst.AnimState:Show("HEAD_HAT_HELM")
				
				inst.AnimState:Show("HEADBASE_HAT")
				
				owner.AnimState:Show("HEAD_HAIR") -- Saw many online examples use owner, understandably didn't work but was worth a shot
				inst.AnimState:Show("HEAD_HAIR")
				inst.AnimState:Show("HAT_HAIR")

 

Indeed it does! "hair_hat" is certainly the correct AnimState for the HAIR, but I'm looking for the correct sprite for the HEAD.
hair_hat works for characters like Wilson, where the hair sprite is what pokes through, but for characters like Wortox (his horns), or Winona and Warly (yes it's hair that pokes through, but apparently in this case it is a part of the head sprite), using "hair_hat" does not help.

So in the images I've provided, the problem sprite is AnimState "HEAD"
But I do not know of a head sprite for hats.

But having those characters wear a football helmet has shown to me that there is a sprite that exists for this purpose.

I appreciate your input though!

8 hours ago, Doodle Monster said:

I'm just a beginning moder myself; but it could be the hair_hat? When you have a hat equpited it normally switches to the hair_hat texture. "HEAD_HAIR" is not what the animation is called (Atleast I think)

Indeed it does! "hair_hat" is certainly the correct AnimState for the HAIR, but I'm looking for the correct sprite for the HEAD.
hair_hat works for characters like Wilson, where the hair sprite is what pokes through, but for characters like Wortox (his horns), or Winona and Warly (yes it's hair that pokes through, but apparently in this case it is a part of the head sprite), using "hair_hat" does not help.

So in the images I've provided, the problem sprite is AnimState "HEAD"
But I do not know of a head sprite for hats.

But having those characters wear a football helmet has shown to me that there is a sprite that exists for this purpose.

I appreciate your input though!

Goodness, it is a shame you cannot edit a reply multiple times, I apologize for posting my message twice. I need to get the hang of using this site.

15 hours ago, Doodle Monster said:

Love the art by the way!

Thank you! That there is a bit of a placeholder while I get it working (missing some light shading, and better linework, plus repurposing the animation on the bottom part of the void cowl for the feather to make it more nightmarefuel-y and wave in the wind), but if you already like the sketch, it does wonders for my aspirations as an artist! I really appreciate it.  ^w^

It's based on the Swashy Hat from Don't Starve Hamlet!

15 hours ago, Doodle Monster said:

I think what you are looking for is the "headbase_hat" ; atleast that's what it's called in my moded character! 

Based on my research thus far, and this observation, I'm beginning to wonder if I do have the right call for it, but it's just not going through for one reason or another...
Maybe. In either case I've appreciated the support!

I can't well understand the inst and owner there.

If you are making an ordinary hat, there should only be owner's AnimState setup. If you set the hat's AnimState, it implies that your hat is like lunarplant/void series helms that is dynamic. But those dynamic hats doesn't look like your code either, they have attached fx.

Edited by Rickzzs
10 minutes ago, Rickzzs said:

I can't well understand the inst and owner there.

If you are making an ordinary hat, there should only be owner's AnimState setup. If you set the hat's AnimState, it implies that your hat is like lunarplant/void series helms that is dynamic. But those dynamic hats doesn't look like your code either, they have attached fx.

Using owner's AnimStates crashed the game when I tried to use them (could be due to the:

AddPlayerPostInit(function(inst)

function to keep it client-side, but I'm not certain)
This hat is a reskin for the void cowl, and the code there is definitely just a mashed list of things I have tried (often individually). I don't know what the fx you are referring to are though.

Hope that helps, not sure if I understand what you mean exactly.

Edited by Narri
Code block to be more clear

Oh I see you are making a client reskin mod. And `inst` here refers to the player. Since you have already named your asset the same name as the official one, there is no need to change build. The only thing to do is set visibility and restore symbols.

	local function ApplyVoidCowlFix()
		if inst and inst.replica and inst.replica.inventory then
			local head_item = inst.replica.inventory:GetEquippedItem(EQUIPSLOTS.HEAD)
			if head_item and head_item.prefab == "voidclothhat" and inst.AnimState then
                local owner=inst
                  owner.AnimState:UseHeadHatExchange(false)
            owner.AnimState:ShowSymbol("face")
			owner.AnimState:ShowSymbol("swap_face")
			owner.AnimState:ShowSymbol("beard")
			owner.AnimState:ShowSymbol("cheeks")
			
			owner.AnimState:ClearOverrideSymbol("headbase_hat")

    owner.AnimState:Show("HAT")
    owner.AnimState:Show("HAIR_HAT")
    owner.AnimState:Hide("HAIR_NOHAT")
    owner.AnimState:Hide("HAIR")

      owner.AnimState:Hide("HEAD")
      owner.AnimState:Show("HEAD_HAT")
      owner.AnimState:Show("HEAD_HAT_NOHELM")
      owner.AnimState:Hide("HEAD_HAT_HELM")

			end
		end
	end

Snipaste_2025-06-14_22-47-42.png.dcd2b0b29f49b1432d3e7b63bdd51373.png

Yet there is still an annoying fx, I think it should be removed.

Edited by Rickzzs
22 minutes ago, Rickzzs said:

Oh I see you are making a client reskin mod. And `inst` here refers to the player. Since you have already named your asset the same name as the official one, there is no need to change build. The only thing to do is set visibility and restore symbols.

	local function ApplyVoidCowlFix()
		if inst and inst.replica and inst.replica.inventory then
			local head_item = inst.replica.inventory:GetEquippedItem(EQUIPSLOTS.HEAD)
			if head_item and head_item.prefab == "voidclothhat" and inst.AnimState then
                local owner=inst
                  owner.AnimState:UseHeadHatExchange(false)
            owner.AnimState:ShowSymbol("face")
			owner.AnimState:ShowSymbol("swap_face")
			owner.AnimState:ShowSymbol("beard")
			owner.AnimState:ShowSymbol("cheeks")
			
			owner.AnimState:ClearOverrideSymbol("headbase_hat")

    owner.AnimState:Show("HAT")
    owner.AnimState:Show("HAIR_HAT")
    owner.AnimState:Hide("HAIR_NOHAT")
    owner.AnimState:Hide("HAIR")

      owner.AnimState:Hide("HEAD")
      owner.AnimState:Show("HEAD_HAT")
      owner.AnimState:Show("HEAD_HAT_NOHELM")
      owner.AnimState:Hide("HEAD_HAT_HELM")

			end
		end
	end

Snipaste_2025-06-14_22-47-42.png.dcd2b0b29f49b1432d3e7b63bdd51373.png

Yet there is still an annoying fx, I think it should be removed.

You are a godsend, yes that did the trick (mostly)! I wonder if it was the UseHeadHatExchange that I was missing, I recall seeing it in the voidcowl hat code, but didn't think much of it when I was fiddling with the different sprites. I even did fool with it recently (earlier today), but must not have used it correctly. It seems like it was that and clearing the headbase_hat override symbol (as far as different things that I don't recall using much).

And OH! I see now, the fx you are referring to is the animated cloth bit at the bottom there, the one that sways in the wind! Yes it looks bothersome haha.
Not to worry! I left that in on purpose, as I will be repurposing that animated sprite for the feather when I actually make the official hat sprite, at the moment it's just a part of the placeholder.

There's only one other thing I noticed when testing it, the faces and certain hair sprites place themselves on top of the hat sprite. Even in your image, you can see it slightly with Wortox there. It's not too bad until it's heftily more apparent in other instances.
It's not something my initial build did, as all the sprites there were below the hat, I'm curious what's caused it. (I'll link images below)

In any case, further help or not, I am extremely grateful for this much, thank you, truly!

Screenshot 2025-06-14 083923.png

Screenshot 2025-06-14 092947.png

	fns.fullhelm_onequip = function(inst, owner)
		if owner:HasTag("player") then
			_base_onequip(inst, owner, nil, "headbase_hat")

			owner.AnimState:Hide("HAT")
			owner.AnimState:Hide("HAIR_HAT")
			owner.AnimState:Hide("HAIR_NOHAT")
			owner.AnimState:Hide("HAIR")

			owner.AnimState:Hide("HEAD")
			owner.AnimState:Show("HEAD_HAT")
			owner.AnimState:Hide("HEAD_HAT_NOHELM")
			owner.AnimState:Show("HEAD_HAT_HELM")

			owner.AnimState:HideSymbol("face")
			owner.AnimState:HideSymbol("swap_face")
			owner.AnimState:HideSymbol("beard")
			owner.AnimState:HideSymbol("cheeks")

			owner.AnimState:UseHeadHatExchange(true)
		else
			_base_onequip(inst, owner)

			owner.AnimState:Show("HAT")
			owner.AnimState:Hide("HAIR_HAT")
			owner.AnimState:Hide("HAIR_NOHAT")
			owner.AnimState:Hide("HAIR")
		end
	end

Look at the helm code, it is different from common hat at `headbase_hat_override` 

    local function _onequip(inst, owner, symbol_override, headbase_hat_override)
		_base_onequip(inst, owner, symbol_override)

        owner.AnimState:ClearOverrideSymbol("headbase_hat") --clear out previous overrides
        if headbase_hat_override ~= nil then
            local skin_build = owner.AnimState:GetSkinBuild()
            if skin_build ~= "" then
                owner.AnimState:OverrideSkinSymbol("headbase_hat", skin_build, headbase_hat_override )
            else 
                local build = owner.AnimState:GetBuild()
                owner.AnimState:OverrideSymbol("headbase_hat", build, headbase_hat_override)
            end
        end

Thus you should revert the symbol headbase_hat and redo it with the correct symbol `swap_hat`, which is for common hats like your reskin.

Something like `owner.AnimState:ClearOverrideSymbol("headbase_hat")` `owner.AnimState:OverrideSymbol("swap_hat","hat_voidcloth","headbase_hat")` but there may be a need for position adjustment.

Edited by Rickzzs
On 6/14/2025 at 9:09 PM, Rickzzs said:
	fns.fullhelm_onequip = function(inst, owner)
		if owner:HasTag("player") then
			_base_onequip(inst, owner, nil, "headbase_hat")

			owner.AnimState:Hide("HAT")
			owner.AnimState:Hide("HAIR_HAT")
			owner.AnimState:Hide("HAIR_NOHAT")
			owner.AnimState:Hide("HAIR")

			owner.AnimState:Hide("HEAD")
			owner.AnimState:Show("HEAD_HAT")
			owner.AnimState:Hide("HEAD_HAT_NOHELM")
			owner.AnimState:Show("HEAD_HAT_HELM")

			owner.AnimState:HideSymbol("face")
			owner.AnimState:HideSymbol("swap_face")
			owner.AnimState:HideSymbol("beard")
			owner.AnimState:HideSymbol("cheeks")

			owner.AnimState:UseHeadHatExchange(true)
		else
			_base_onequip(inst, owner)

			owner.AnimState:Show("HAT")
			owner.AnimState:Hide("HAIR_HAT")
			owner.AnimState:Hide("HAIR_NOHAT")
			owner.AnimState:Hide("HAIR")
		end
	end

Look at the helm code, it is different from common hat at `headbase_hat_override` 

    local function _onequip(inst, owner, symbol_override, headbase_hat_override)
		_base_onequip(inst, owner, symbol_override)

        owner.AnimState:ClearOverrideSymbol("headbase_hat") --clear out previous overrides
        if headbase_hat_override ~= nil then
            local skin_build = owner.AnimState:GetSkinBuild()
            if skin_build ~= "" then
                owner.AnimState:OverrideSkinSymbol("headbase_hat", skin_build, headbase_hat_override )
            else 
                local build = owner.AnimState:GetBuild()
                owner.AnimState:OverrideSymbol("headbase_hat", build, headbase_hat_override)
            end
        end

Thus you should revert the symbol headbase_hat and redo it with the correct symbol `swap_hat`, which is for common hats like your reskin.

Something like `owner.AnimState:ClearOverrideSymbol("headbase_hat")` `owner.AnimState:OverrideSymbol("swap_hat","hat_voidcloth","headbase_hat")` but there may be a need for position adjustment.

(I took a small break from the mod, my apologies)

Maybe I don't fully understand the solution, but nothing I tried seemed to work.
From what I understand with my testing though:
* 'owner.AnimState:ClearOverrideSymbol("headbase_hat")' was what let the head sprite I was looking for originally (one that cuts off things like horns or hair that is a part of the head sprite) to work, but it messed with the sprite layering a whole lot (seems to have things like the face go behind the head)
* 'owner.AnimState:UseHeadHatExchange(false)' fixed the layering for the head and face sprites caused by the previous line I mentioned, but also draws some of those over the hat now instead

And the difference between the fullhelm and commonhat code that you pointed out, the 'headbase_hat_overide' is a bit confusing to me, but I assume it's used in the fullhelm code to alter a character's head more uniquely since none of the common hats remove the entire head.
Based on what you recommended I've tried:
* (this is the same) 'owner.AnimState:ClearOverrideSymbol("headbase_hat")'  was already within the function before, but you specifically called this out as important since it's what the fullhelm was using, and wanted to clear it and use the common hat logic
* adding 'owner.AnimState:OverrideSymbol("swap_hat","hat_voidcloth","headbase_hat")'  But unfortunately this didn't appear to do anything from what I can tell.
* Since that didn't work, I also tried several other things (though it was kind of on a whim):

owner.AnimState:OverrideSymbol("swap_hat","hat_voidcloth","headbase_hat_override")
owner.AnimState:OverrideSymbol("swap_hat", "hat_voidcloth", "swap_hat")
owner.AnimState:ShowSymbol("swap_hat")


In summation, it doesn't work, or I'm not understanding correctly (which is likely).
You also mentioned a need for a position adjustment? If the fix does alter something, and it's how the hat looks on the head positionally, I should be able to fix that in spriter.

Edited by Narri
Spelling

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