Chesed Posted August 30, 2021 Share Posted August 30, 2021 (edited) I'm making a character who has several visual transformations that just affect his head and face. I was using AnimState:SetBuild to swap between them, but just changed to using the skinner component instead (as changing the character's outfit in the wardobe would reset him to his default appearance otherwise). Unfortunately, now when he changes his clothes his transformations overwrite the clothing until he turns back to normal. I would like him to work like Wurt's powered up form or Wormwood's blooming instead. I took a look at skinner.lua and can see where the exceptions are being made for Wurt and such to allow clothes to override their transformations, but I'm a novice at coding and don't know where to begin modifying it it in my modmain to add my own exceptions. All other mods I've looked at for reference have either used AnimState:SetBuild or use Wurt's "powerup", which I can't use; my character has multiple transformations. Is this possible to do? If someone could help me out I'd appreciate it. I'm unfortunately not able to send my character files. Thanks for reading. Edited March 12 by Chesed Link to comment Share on other sites More sharing options...
Monti18 Posted September 1, 2021 Share Posted September 1, 2021 If you don't have more than 4 different forms, you can use wormwoods stages, otherwise I'm not sure how to do it 1 Link to comment Share on other sites More sharing options...
Chesed Posted September 1, 2021 Author Share Posted September 1, 2021 Yeah, unfortunately that doesn't work for me either - he currently has 15 visual transformations haha. Even using all the exceptions Klei made for the other characters wouldn't even cover half of them. I was hopeful it was possible because I've seen someone tweak the skinner component for their character before for another purpose, but I could only find that one person doing it. I had a feeling it might be a big ask. Thank you for taking the time to reply in any case! Link to comment Share on other sites More sharing options...
Chesed Posted January 27 Author Share Posted January 27 Resurrecting this because my mod is almost finished and this issue still remains and is the biggest thing my playtesters are complaining about. To make matters worse, updates to the game have made this a bigger problem as his transformations overwrite Wonkey's curse as well. (THANKS KLEI.) I'm seriously desperate. I don't care how janky the solution is at this point. Just hoping someone out there has any ideas or leads. Link to comment Share on other sites More sharing options...
IronHunter Posted January 28 Share Posted January 28 (edited) If its just the head and face symbols and none of the clothing symbols. Why not try addoverridebuild? Just make sure your builds only include the symbols you want overriden. Edited January 28 by IronHunter 1 Link to comment Share on other sites More sharing options...
Rickzzs Posted January 28 Share Posted January 28 Skinner component is born for this, why not make use of it? You can just make transformations skins, using Modded Skins or Glassic API. It is supposed to work if you do CreatePrefabSkin right. I think one more thing is something like this: wurt = { {type = "normal_skin", play_emotes = true}, {type = "powerup", play_emotes = true}, { type = "ghost_skin", anim_bank = "ghost", idle_anim = "idle", scale = ghost_preview_scale, offset = {0, ghost_preview_y_offset} } }, After all are done, you can use skinner:SetSkinMode() to switch between these types of skin. Link to comment Share on other sites More sharing options...
Chesed Posted January 28 Author Share Posted January 28 5 hours ago, Rickzzs said: Skinner component is born for this, why not make use of it? You can just make transformations skins, using Modded Skins or Glassic API. It is supposed to work if you do CreatePrefabSkin right. I think one more thing is something like this: wurt = { {type = "normal_skin", play_emotes = true}, {type = "powerup", play_emotes = true}, { type = "ghost_skin", anim_bank = "ghost", idle_anim = "idle", scale = ghost_preview_scale, offset = {0, ghost_preview_y_offset} } }, After all are done, you can use skinner:SetSkinMode() to switch between these types of skin. I am already doing this. My first post says I am currently using the skinner component and that is why the problem started happening. The problem comes in that my character has over ten transformations and they cannot all use "powerup". It causes those transformations to look the same. There are not enough powerup/wormwood bloom/wanda aging skin types to borrow to cover every transformation. Calling the skin type anything else causes it to override outfits from the wardrobe. Therefore, half of my character's transformations cannot wear clothes. This is why I am asking for help. If your next advice is "use less transformations" believe me: I won't be making a character like this again! 12 hours ago, IronHunter said: If its just the head and face symbols and none of the clothing symbols. Why not try addoverridebuild? Just make sure your builds only include the symbols you want overriden. You are a livesaver, I was hoping that something like this existed so I could only target his head and face but I had no idea what it would be called. Thank you so much for pointing me in the right direction. You've saved me a massive headache. It will be a while before I'm able to test it out, but I'll see how this works out for him. I'll be back in a fortnight or so to share how it goes. Link to comment Share on other sites More sharing options...
IronHunter Posted January 29 Share Posted January 29 8 hours ago, Chesed said: 21 hours ago, IronHunter said: If its just the head and face symbols and none of the clothing symbols. Why not try addoverridebuild? Just make sure your builds only include the symbols you want overriden. You are a livesaver, I was hoping that something like this existed so I could only target his head and face but I had no idea what it would be called. Thank you so much for pointing me in the right direction. You've saved me a massive headache. It will be a while before I'm able to test it out, but I'll see how this works out for him. I'll be back in a fortnight or so to share how it goes. I have tested this and it works flawlessly for me, like I said the ideal solution is to just make your alternative builds just have the symbols you want to override. So just the head and face. If you need help accomplishing this let me know. Its pretty much as easy as deleting the unused symbols from your alternative build .scml from all the animations and deleting the symbols entirely from the .scml folder structure. If you don't delete the unused symbols like the body etc it'll override the body whenever its called ruining your skin. This solution is best for usage for parts like the head, face etc. 1 Link to comment Share on other sites More sharing options...
Rickzzs Posted January 29 Share Posted January 29 (edited) 1 hour ago, IronHunter said: I have tested this and it works flawlessly for me, like I said the ideal solution is to just make your alternative builds just have the symbols you want to override. So just the head and face. If you need help accomplishing this let me know. Its pretty much as easy as deleting the unused symbols from your alternative build .scml from all the animations and deleting the symbols entirely from the .scml folder structure. If you don't delete the unused symbols like the body etc it'll override the body whenever its called ruining your skin. This solution is best for usage for parts like the head, face etc. This works, but I didn't see Klei use this function. How can you revert the build to the base skin that must contain clothing symbols? Is there a ClearOverrideBuild? Edited January 29 by Rickzzs Link to comment Share on other sites More sharing options...
IronHunter Posted January 29 Share Posted January 29 (edited) 1 hour ago, Rickzzs said: This works, but I didn't see Klei use this function. How can you revert the build to the base skin that must contain clothing symbols? Is there a ClearOverrideBuild? There is in fact a ClearOverrideBuild(build) It works as you expect it to work Quick test of the function, it simply clears all symbols that are in said build, so if the build provided in ClearOverrideBuild contains the torso symbol it'll clear that as well. For the purposes of this mod calling this function and using any of the alternative builds for the overrides should do the trick of clearing the face and head symbols. As long as the build provided for ClearOverrideBuild doesn't contain any skinned symbols it shouldn't affect those, so resetting back to default face and head should be fine if you use any of the custom overridebuilds that contain all the respective symbols. Edited January 29 by IronHunter 1 Link to comment Share on other sites More sharing options...
Chesed Posted March 11 Author Share Posted March 11 (edited) Very sorry it took me so long to follow up. On 1/29/2023 at 1:05 AM, IronHunter said: I have tested this and it works flawlessly for me, like I said the ideal solution is to just make your alternative builds just have the symbols you want to override. So just the head and face. If you need help accomplishing this let me know. Its pretty much as easy as deleting the unused symbols from your alternative build .scml from all the animations and deleting the symbols entirely from the .scml folder structure. If you don't delete the unused symbols like the body etc it'll override the body whenever its called ruining your skin. This solution is best for usage for parts like the head, face etc. First off – your solution worked perfectly! I managed to switch everything over without any major issues and all of the transformations can wear clothes now. Thank you again! Unfortunately the part of my delay in my response was because I was working on adding a skin to my character and wanted to be sure this worked with the skin, and there’s one small issue. For reference, this is what I added to my item’s onequip: Quote if owner.components.skinner and owner.components.skinner.skin_name =="wheneer_survivor" then owner.AnimState:AddOverrideBuild("wheneer_black_survivor") else owner.AnimState:AddOverrideBuild("wheneer_black") end It does work, but as I kind of realised while doing this, putting it the onequip doesn’t account for my character changing his skin while he’s wearing a mask. If he does that, his head doesn’t change until he unequips it. I tried to look for something I could have the item listen for so it could update the build when my character changes skin, but even after searching the forums and some game files I have no idea. You wouldn’t happen to know something I could use? Very sorry to bother you again. I could do it another way if needed, but this seems like would be the most straightforward one. Edit: FOUND IT! It was "onskinschanged", duh. That fixes everything! Thank you again for helping me! I'll leave all this up in case it helps someone in the future. Edited March 12 by Chesed Solved my problem 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