Mario384 Posted March 28, 2015 Share Posted March 28, 2015 Okay, so basically I set up ghost mode to trigger for characters using a different stategraph than the normal one. When they revive, however, everything gets reset to a regular player's stategraph. So, I set a function which goes off when you respawn from a ghost. It's supposed to set the stategraph, build, and bank back to normal, but the player still becomes like a regular one upon revival. Any suggestions? Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/ Share on other sites More sharing options...
DarkXero Posted March 28, 2015 Share Posted March 28, 2015 The lazy way:function setChar(inst) inst.AnimState:SetBank("deerclops") inst.AnimState:SetBuild("deerclops_build") inst:SetStateGraph("SGdeerclops")endAddPlayerPostInit(function(inst) inst:DoTaskInTime(0, setChar) inst:ListenForEvent("respawnfromghost", function() inst:DoTaskInTime(10, setChar) end)end)Setting them after being revived do work, the problem is WHEN you set each thing. If you set them too early, you break everything; just in time, either nothing happens or it's perfect; a bit late, and it works. Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-625687 Share on other sites More sharing options...
Mario384 Posted March 28, 2015 Author Share Posted March 28, 2015 (edited) The lazy way:function setChar(inst) inst.AnimState:SetBank("deerclops") inst.AnimState:SetBuild("deerclops_build") inst:SetStateGraph("SGdeerclops")endAddPlayerPostInit(function(inst) inst:DoTaskInTime(0, setChar) inst:ListenForEvent("respawnfromghost", function() inst:DoTaskInTime(10, setChar) end)end)Setting them after being revived do work, the problem is WHEN you set each thing. If you set them too early, you break everything; just in time, either nothing happens or it's perfect; a bit late, and it works.@DarkXero,, it appears this makes every character a deerclops. Did I do something wrong, or does something about it being local need to be put in? Edited March 28, 2015 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-625691 Share on other sites More sharing options...
DarkXero Posted March 28, 2015 Share Posted March 28, 2015 @Mario384, correct, but I used AddPlayerPostInit for testing purposes. That should go inside the master_postinit of the character. Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-625708 Share on other sites More sharing options...
Mario384 Posted March 28, 2015 Author Share Posted March 28, 2015 @Mario384, correct, but I used AddPlayerPostInit for testing purposes. That should go inside the master_postinit of the character. Well, after editing some of this around, it works now. Thanks for all your help, man, without your assistance this wouldn't have been possible. Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-625709 Share on other sites More sharing options...
Mario384 Posted March 29, 2015 Author Share Posted March 29, 2015 (edited) @DarkXero, well, after a bit of further testing after my previous post, apparently it's not working (sort of). It doesn't change unless the player relogs, and when you return everything is as it should be. Not sure if this is on the code's side, or some sort of bug. Edited March 29, 2015 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-625780 Share on other sites More sharing options...
DarkXero Posted April 5, 2015 Share Posted April 5, 2015 @Mario384, are you still experiencing this problem? Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-627617 Share on other sites More sharing options...
Mario384 Posted April 6, 2015 Author Share Posted April 6, 2015 @Mario384, are you still experiencing this problem? Yeah, I still need to relog to get it to work. Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-627670 Share on other sites More sharing options...
DarkXero Posted April 6, 2015 Share Posted April 6, 2015 (edited) @Mario384, I would like a zip or link to where I can get the files. I'm not sure where the problem is. Try bumping the 10 from DoTaskInTime to 20. Else, I would need more details as to how find the bug. Because when I tried, my character would start as Deerclops, then die, then perform a resurrection with Wilson anims, then appear as Wilson, then change to Deerclops, no need for relogging. But then again I don't know how are you handling this. I just patch things up to run something similar to yours. Edited April 6, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-627681 Share on other sites More sharing options...
Mario384 Posted April 6, 2015 Author Share Posted April 6, 2015 http://forums.kleientertainment.com/files/file/1105-dst-playable-deerclops/ Here's one where you can get the file for deerclops. I believe the reason why it works for you is because you're replacing Wilson. Meanwhile, mine is a seperate character. Also, setting it to 20 for DoTaskInTime did not prevail. Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-627737 Share on other sites More sharing options...
DarkXero Posted April 6, 2015 Share Posted April 6, 2015 You put my functions inside alocal function CheckForGhostRespawn(inst) inst:DoTaskInTime(0, setChar) inst:ListenForEvent("respawnfromghost", function() inst:DoTaskInTime(10, setChar) end)endthen never ran a CheckForGhostRespawn. They never get executed. Put them as is, inside the master_postinit, without them being the definition for the CheckForGhostRespawn. Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-627755 Share on other sites More sharing options...
Mario384 Posted April 6, 2015 Author Share Posted April 6, 2015 You put my functions inside alocal function CheckForGhostRespawn(inst) inst:DoTaskInTime(0, setChar) inst:ListenForEvent("respawnfromghost", function() inst:DoTaskInTime(10, setChar) end)endthen never ran a CheckForGhostRespawn. They never get executed. Put them as is, inside the master_postinit, without them being the definition for the CheckForGhostRespawn.I can't believe I didn't realize that was what was wrong with it. Once again, friend, I thank you dearly, your knowledge has helped me greatly. Link to comment https://forums.kleientertainment.com/forums/topic/52444-setting-stategraphs-and-builds-after-being-revived-doesnt-work/#findComment-627818 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