HomShaBom Posted June 11, 2016 Share Posted June 11, 2016 (edited) What causes pigmen to wear hats that you give to them? Looking in the prefab file I have determined: When Pigman is created his "hat" AnimState is hidden Pigman has an inventory component When an item that is equippable on the head is handed to the Pigman, he equips said hat in the head slot of his inventory After the hat is equiped, his "hat" AnimState is shown. What I can't figure out is what the "hat" animstate even is. I tried using Krane to decompile the pigman anim into a spriter project and i see nothing in at all called "hat" and I can't find anything in the prefab file or anywhere else that would determine where the hat gets drawn. Like how does it know where the pig's head is and to draw the hat on top of that? I'm lost. Edited June 11, 2016 by HomShaBom Link to comment Share on other sites More sharing options...
MF99K Posted June 12, 2016 Share Posted June 12, 2016 (edited) On 6/10/2016 at 10:06 PM, HomShaBom said: What causes pigmen to wear hats that you give to them? Looking in the prefab file I have determined: When Pigman is created his "hat" AnimState is hidden Pigman has an inventory component When an item that is equippable on the head is handed to the Pigman, he equips said hat in the head slot of his inventory After the hat is equiped, his "hat" AnimState is shown. What I can't figure out is what the "hat" animstate even is. I tried using Krane to decompile the pigman anim into a spriter project and i see nothing in at all called "hat" and I can't find anything in the prefab file or anywhere else that would determine where the hat gets drawn. Like how does it know where the pig's head is and to draw the hat on top of that? I'm lost. are you trying to make a hat using pigmen animation files? or are you just trying to make a hat, or just trying to understand the code? Edited June 12, 2016 by mf99k Link to comment Share on other sites More sharing options...
HomShaBom Posted June 12, 2016 Author Share Posted June 12, 2016 I'm trying to make a new prefab that i can put a hat on, so i was looking at the pigman files to figure out how it works for them. Link to comment Share on other sites More sharing options...
rezecib Posted June 13, 2016 Share Posted June 13, 2016 @HomShaBom "HAT" is a symbol. When you make the spriter project, you'll see that next to the project file it has several folders for images-- the symbol names come from these folders. These may not generate when decompiling because it doesn't have an image to put there, as the symbol will need to have another build's symbol (the hat's build) overridden into it. As for how to create it... I think you could get away with starting out with a hat image, doing an animation with that image, and then replacing the image file it with a blank/completely transparent image of the same size. The project should still reference it and include it in its animations, and then you can override other hats into the symbol for it. This might take some iteration as I'm not sure there's a good way to get the size/location of the hat images in their own builds. That being said... this is kind of beyond my expertise, as I mostly stick to code. But hopefully that gets you on a path to learn more about it yourself. You might also want to check the single-player mod forums, they have a much larger collection of threads/guides about doing art, since it hasn't really changed in DST, such as this one. 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