Feldoth Posted March 23, 2017 Share Posted March 23, 2017 Hello, I'm trying to debug an issue where various bits of code attached to a custom character, and executed via DoPeriodicTask do not work while inside a cave. These functions are universally executed in master_postinit (using the extended sample character as a base), and about the only idea I have as to why they aren't working is that this code may not be being executed after a cave transition. What I'm not sure about is what I should hook into in order to run this code on transition (I've found an event for before the transition, but not one for after). I'm hoping someone can tell me if there is such an event, and what it is. I'm sure there must be some way to do this, but I've been unable to find it. Alternatively if somebody knows another reason why these would stop working in a cave, please let me know! Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/76684-issue-with-timed-events-and-character-transition-to-caves/ Share on other sites More sharing options...
Feldoth Posted March 25, 2017 Author Share Posted March 25, 2017 I didn't get a response on this, so I tried moving my code into a component - that changed the problem but didn't fix it. I was able to get my periodic events to run using this method, but the component's OnLoad function does not get called when running a cave server. I've ended up using a persistent string to save data, however this isn't work on the cave server for some reason (I haven't had much chance to troubleshoot that yet). Any insights into why any of this works like this would be useful... Link to comment https://forums.kleientertainment.com/forums/topic/76684-issue-with-timed-events-and-character-transition-to-caves/#findComment-891005 Share on other sites More sharing options...
Serpens Posted March 25, 2017 Share Posted March 25, 2017 (edited) I have no experience creating a custom character, but I can imagine that code in master_postinit is only executed at server. And if you do stuff that should also be done for client in it, it of course does not work for clients/with caves active. Saving some values for your character is indeed better in a component, with OnSave and OnLoad. What values do you want to save? Only boolean/strings/numbers ? Or also instances? You could post the code of your component. Edited March 25, 2017 by Serpens Link to comment https://forums.kleientertainment.com/forums/topic/76684-issue-with-timed-events-and-character-transition-to-caves/#findComment-891042 Share on other sites More sharing options...
RedHairedHero Posted March 28, 2017 Share Posted March 28, 2017 common_postinit is used for both the server and client, perhaps moving it over to this function instead will help resolve the issue. Link to comment https://forums.kleientertainment.com/forums/topic/76684-issue-with-timed-events-and-character-transition-to-caves/#findComment-893146 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