Mario384 Posted March 22, 2015 Share Posted March 22, 2015 I've been trying to fix a mod of mine, and the playable character it adds in is a Deerclops, it orginally worked a few updates ago, but it seems using SetBuild no longer works, so the character no longer appears. Did something change in the last few updates surrounding this, or is this a bug? Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/ Share on other sites More sharing options...
DarkXero Posted March 22, 2015 Share Posted March 22, 2015 (edited) Maybe this is skin related?I tried with the spider but I got Wilson's floating eyes stuck in 6 floating limbs. Edited March 22, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624020 Share on other sites More sharing options...
Mario384 Posted March 25, 2015 Author Share Posted March 25, 2015 (edited) Maybe this is skin related?I tried with the spider but I got Wilson's floating eyes stuck in 6 floating limbs. Hmm, I'm not really sure... From what I can tell, it should work, and the characters do have their gameplay functionality, but they just aren't appearing right/appearing at all. I suppose desperate times calls for desperate measures, since I want to fix those mods and try to see how Deerclops vs. Survivors would work. Anyways, @PeterA, do you know if anything with the new skin system had anything to do with this? Edited March 25, 2015 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624764 Share on other sites More sharing options...
Developer bizziboi Posted March 25, 2015 Developer Share Posted March 25, 2015 @Mario384, Any chance you could send me your mod so we can have a look at it? Setbuild is used for all characters so it seems it at least somewhat works.... Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624918 Share on other sites More sharing options...
Developer PeterA Posted March 25, 2015 Developer Share Posted March 25, 2015 ^@Mario384, yeah, what bizziboi said Also, are you on the RoG branch or default DST? Thanks for reporting the problem! Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624919 Share on other sites More sharing options...
DarkXero Posted March 25, 2015 Share Posted March 25, 2015 Mod is here: http://forums.kleientertainment.com/files/file/1105-dst-playable-deerclops/ I'm in the RoG branch, I tried using SetBank("deerclops") then SetBuild("deerclops_build") in realtime in console and I went invisible.However, using ThePlayer.AnimState:SetBuild("wx78"), for example, works. Using ThePlayer.AnimState:SetBuild("deerclops_build") without switching bank also yields no effect. Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624942 Share on other sites More sharing options...
Developer bizziboi Posted March 25, 2015 Developer Share Posted March 25, 2015 @DarkXero, If I do: ThePlayer:SetBank("deerclops") ThePlayer:SetBuild("deerclops_build") SetStateGraph("SGDeerClops") I can walk around as DeerClops. Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624962 Share on other sites More sharing options...
DarkXero Posted March 25, 2015 Share Posted March 25, 2015 (edited) ThePlayer.AnimState:SetBank("deerclops")ThePlayer.AnimState:SetBuild("deerclops_build")ThePlayer:SetStateGraph("SGDeerclops") in succession in console does the trick. However, calling them in that order in AddPlayerPostInit or in a character prefab will result in an invisible entity that has the deerclops stategraph. If you run these three in AddPlayerPostInit or AddPrefabPostInit, then when you make ThePlayer.AnimState:SetBuild("deerclops_build"), you don't have to set bank or stategraph. Edited March 25, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624966 Share on other sites More sharing options...
Developer PeterA Posted March 25, 2015 Developer Share Posted March 25, 2015 @Mario384 and @DarkXero, you are correct that it's changes to the skin code that is causing a problem here. There are a couple of options to fix this. The first is to copy the builds that you want to use into your mod and make sure that the prefab name matches the build name. Currently the Build gets set to the prefab name if no skin is set. The other option is to change your master_postinit to have the followinginst.OnSetSkin = function(skin_name) inst.AnimState:SetBuild("deerclops_build")endThanks for letting us know about this issue. It's something we'll have to look into further. Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624968 Share on other sites More sharing options...
DarkXero Posted March 25, 2015 Share Posted March 25, 2015 (edited) Nice, thanks, @PeterA, @bizziboi. Can confirm that works. For future reference:AddPlayerPostInit(function(inst) inst.AnimState:SetBank("deerclops") inst:DoTaskInTime(0, function() inst.AnimState:SetBuild("deerclops_build") end) inst:SetStateGraph("SGdeerclops")end)also works. Edited March 26, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624971 Share on other sites More sharing options...
Developer PeterA Posted March 26, 2015 Developer Share Posted March 26, 2015 @DarkXero and @Mario384, you probably want to keep the existing line, and do it like this. inst.AnimState:SetBuild("deerclops_build")inst.OnSetSkin = function(skin_name) inst.AnimState:SetBuild("deerclops_build")endThe skin code is still very early and is likely to see changes in the future, so keeping the original line should "somewhat" future proof you if OnSetSkin goes away. Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-624973 Share on other sites More sharing options...
Mario384 Posted March 26, 2015 Author Share Posted March 26, 2015 (edited) Haha, you guys are great! I'll test these solutions on the mod when I get home today. EDIT: The mod now works. Thanks for everyone's help! Edited March 26, 2015 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/52269-setbuild-issue/#findComment-625059 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