Jump to content

Recommended Posts

@mouse,

they work, but some things like follower will already have been removed at that point. u can use OnDespawn then. just be aware that OnDespawn doesnt have access to the savedata yet, so u will have to save whatever u need into a variable on your character, and then save it via the savefunction. my mod kerrigan makes use of that to save her followers.

@mouse,

they work, but some things like follower will already have been removed at that point. u can use OnDespawn then. just be aware that OnDespawn doesnt have access to the savedata yet, so u will have to save whatever u need into a variable on your character, and then save it via the savefunction. my mod kerrigan makes use of that to save her followers.

And they work within AddPlayerPostInit?

Like:

AddPlayerPostInit(function(inst)    inst.OnSave=somefn1    inst.OnLoad=somefn2end)

Nevermind, I found a solution. I made the player perform a dotaskintime function for one second after joining the server while all of the data finishes arm wrestling with each other.

I noticed something though. The inst.OnSave function runs when the player joins the server. Any idea if that's a bug, temporary(until OnDespawn is finished), or permanent?

Anyways, thank you very much for your help.

And they work within AddPlayerPostInit?

Like:

AddPlayerPostInit(function(inst)    inst.OnSave=somefn1    inst.OnLoad=somefn2end)
if u do this, make sure to save the previous function of thoses players, and call them within your savefunction, or u will just overwrite existing savefunction, and for instance delete wendies sister like that^^

 

The inst.OnSave function runs when the player joins the server.

i hope u are aware that the function gets called everytime the server saves, for instance each new day. so the function u make, has to work correctly even while gameplay, so it should'nt matter anyway, when it's being called when u join the game. so i would rather call it a feature than a bug^^ Edited by Seiai

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