Jump to content

Recommended Posts

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!

 

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...

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 by Serpens

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...