OnExit in EE

I am setting string local variable on item in players inventory in OnExit. But next login (which is after restart), this variable is “”.

I thought EE executed OnExit before the player is gone from module so why is it not working?

You might be falling victim to a variant of this issue:

Hmm looks like the Vault failed to merge my accounts together in the forum. The above post was me.

Actually in this case I don’t believe it’s that bug.

EE does execute OnExit before the player-character is gone from the module - However my own testing indicates that OnExit is still AFTER the character save/export of the .bic file.

So you can retrieve information about the player character, and even change things, but the character file has already saved at that point and so any changes aren’t persistent.

I solved my issue another way, but potentially manually invoking a character save/export at the end of the OnExit script might work?

1 Like

Thanks for confirmation. I already reinstated my OnPreModuleExit event in nwnx to deal with this, but it is nice to know this is not an error in my scripting, but missing functionality.