Jump to content

Recommended Posts

Hi there! I'm a bit stuck with attempts to handle quitting the game in my mod. I need it to restore the states of some components, like season and so on.

I've tried listening for "player deactivated" and "deactivate world", but it seems that mod has been removed before these events are invoked.

Are there any ways to catch the fact, that mod is going to be unloaded?

Link to comment
https://forums.kleientertainment.com/forums/topic/137706-onexit-onquit-events/
Share on other sites

"function ComponentNameHere:OnSave()"? See components/inventory.lua for example.

If it's for an existing component, I'm not quite sure how you handle the loading part, since OnLoad is called before a mod's AddComponentPostInit.

Edited by Bumber64
  • Like 1

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