XML - Hot Tip! (OnRemove)

Hi All,

I made quite an important discovery today …

If you have made use of calling a script when a GUI is “removed” (by player closing a GUI and using the OnRemove callback), then this may be important for you. It was for me.

If a player saves a game with such a GUI open on their screen (such as a journal or a character sheet in my case for just two examples), then reload that saved game some time later, the GUIs are normally closed, but the OnRemove callback will not have been fired!

So, in my case, I had some variables deleted upon closing a GUI, but these appeared TRUE in debug tests on a reload where such GUIs had been closed “automatically” by the game on the reload. i.e. The OnRemove did not fire and left variables in the wrong state for the reloaded game.

Solution: Have the module load delete all such reliant variables upon the PC loading their game

2 Likes