BrotatoTips Posted December 14, 2014 Share Posted December 14, 2014 hello. im new to scripting and ive learned quite a bit this past week. so i can at least read most of the logs and fix files. but im having a major issue that i found while testing my custom character with DST. with the help of rezecib, who assisted me with most of the compatibility, i was able to make my character compatible with the standard gamemode. i was testing the character in endless on my own hosted server to test its conditions, and if he dies, he can resurrect from the portal once. if he dies again and tries to resurrect, it will crash the game without showing a silhouette of the character. im not sure what is still broken and i seek assistance. ill post both my mod files, and the log. thank you in advance.log.txtCharacter.zip Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/ Share on other sites More sharing options...
Developer PeterA Posted December 15, 2014 Developer Share Posted December 15, 2014 Hey @WitchDoctEr16, I took a quick look at your log file. Your death cause was nil, so I believe that inst.deathcause never get set somehow. I suspect that happened because inst._parent was nil in AddMorgueRecord. I'm not entirely sure why that would have happened though. Looking at your prefab lua code. What's the purpose of this line? inst:ListenForEvent("respawnfromghost") My suggestion would be to take a look at the differences between your character mod and ones that are known to work such as Ika Musume (http://steamcommunity.com/sharedfiles/filedetails/?id=350365996) Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-586707 Share on other sites More sharing options...
BrotatoTips Posted December 15, 2014 Author Share Posted December 15, 2014 the line inst:listenforevent("respawnfromghost") was a part i forgot to remove. crash was originally supposed to glow at night but i couldnt get it to work so i removed it. i forgot that line. thanks for the advice. ill look at that file. i was comparing to the cthulhu character. im not sure whats got it down thou. thank you for the reply. Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-586735 Share on other sites More sharing options...
Ridder Geel Posted December 16, 2014 Share Posted December 16, 2014 It might be crashing after second time respawn due to 2*40 = 80, your max health is 80, so your character would spawn with 0 health.It's the penalty they set up for dieing multiple times with the same character...I had this problem as well with HP lower than 100 or so, this is most likely due to this line in health.lua:function Health:GetPenaltyPercent() return (self.penalty*TUNING.EFFIGY_HEALTH_PENALTY)/ self.maxhealthendIt would return a percent larger than 100, thus giving you negative health.This might be the problem you are encountering, at least this was the case for me, i fixed it by simply setting the max amount of inst.components.health.numrevives to something smaller than 2 or such. Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-586977 Share on other sites More sharing options...
BrotatoTips Posted December 16, 2014 Author Share Posted December 16, 2014 (edited) i do recall a death sound when resurrecting twice. how would i go about setting the numrevives? would i just put:inst.components.health.numrevives = 2into the master_post.init? Edited December 16, 2014 by WitchDoctEr16 Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-586999 Share on other sites More sharing options...
Ridder Geel Posted December 16, 2014 Share Posted December 16, 2014 nope, what you should do is... inst:ListenForEvent("death", ondeath)in the init, and then have another function:local function ondeath(inst) inst.components.health.numrevives = 0endSet it to 0, that way it doesnt go any higher than 1 when reviving, so your hp when getting revived is 40.Maybe the official function should check for percentages higher than 100 and just cap them at 90 or something like that... But that's not my call Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-587056 Share on other sites More sharing options...
BrotatoTips Posted December 16, 2014 Author Share Posted December 16, 2014 Thank you! you actually fixed it i understand how it works slightly, and i apriciate the help. now i could apply this to anything i may need u the man Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-587068 Share on other sites More sharing options...
rezecib Posted December 16, 2014 Share Posted December 16, 2014 @WitchDoctEr16, You can also look at how I dealt with numrevives for Maxwell in More DST Characters:local function HealthPostInit(self) local OldRecalculatePenalty = self.RecalculatePenalty local function RecalculatePenalty(self, forceupdatewidget) local mult = GLOBAL.TUNING.REVIVE_HEALTH_PENALTY_AS_MULTIPLE_OF_EFFIGY mult = mult * GLOBAL.TUNING.EFFIGY_HEALTH_PENALTY local maxrevives = (self.maxhealth - 30)/mult if self.numrevives > maxrevives then self.numrevives = maxrevives end OldRecalculatePenalty(self, forceupdatewidget) end self.RecalculatePenalty = RecalculatePenaltyendAddComponentPostInit('health', HealthPostInit) What this approach does it makes sure that the penalty never brings you below a max of 30 health. Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-587097 Share on other sites More sharing options...
sunnyyyyholic Posted May 9, 2015 Share Posted May 9, 2015 thanks!! Link to comment https://forums.kleientertainment.com/forums/topic/46304-dst-custom-character-second-resurrect-crash/#findComment-635873 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