It's already common knowledge that object variables (wether global or local) keep their values (wether assigned as initial value or from scripted processes) until a new value gets assigned, but are never 'emptied' to null or 'reset' to their initial value (s. Some tips for programming charScripts/itemScripts and Object Scripting Optimizations, thanks to the Tinkerer for the confirmation). Especially the need to optimize scripts, not least to improve saving and loading times (s. Ameranth's thread above), provokes further questions of how/when exactly the engine saves variables and if there are differences between global and local objects (there are!), so finally: if removing or changing object variables in scripts for existing games is possible. Spoiler:
not to a satisfying extend.


I did some testing with characters to get a better understanding (should be transferable to items). Here are the results:

Global characters

Both local and global variables of global characters are saved in the save file regardless of the level they're located in and the level the player is in when he saves the game, and regardless of if their script was initialized on level load after adding the variables (or ever before) .
Whenever I added a variable with an initial value to the 'Base' character script and added a reaction that has this value of this variable as condition, saved and exited the game, changed the initial value of the variable and checked for this value in the reaction: when I loaded the save every global character in every level of the game remembered the original value and refused to perform the action, although the scripts of most characters were never initialized. So: Once you save the game, all variables of global characters are set in stone and can't be changed in or removed from the script any more.

Local characters

Variables of local characters are saved differently:

Local and global variables are saved in the save file when the script was initialized on level load; there's no difference between local vars in VARS and global vars in INIT in terms of when they are saved. It doesn't seem to matter if the game is saved in a different level or in the same level they're located in, as long as the script was initialized before.
Variable values of local characters can be changed by script call ('Set' within the same script or 'SetVar' for variables in other scripts) as long as the player is in the same level; the values will be saved, regardless of the level the player is in when he saves the game.
Note: Local characters can't be addressed and are completely unresponsive if the player isn't in the same level. Their scripts also don't react to events in the EVENTS section (OnCharacterStatus, OnGlobalEventSet, OnCharacterEvent ...). Only scripts of global characters do!


Now, what happens if we remove a variable from the script?

Both local and global variables can't be used when removed; if a specific value is checked as a condition it will always be true, regardless of the required value. Though they're still remembered by the game (once they were saved in the save file), even if the game is saved without them later and loaded from this save. When I reintroduced these variables in the script it didn't take the new value I gave them but took the original value the game remembered. This seems to apply both to local and global characters.

What if we remove the whole reaction, along with all VARS, and save the game?

The local variables are still remembered. When I reintroduced the reaction the original values of these variables were still remembered.
Only reaction priorities, which are similarly remembered as variables (so changing them in the script doesn't apply to save games, they must be changed with a call), can be changed by removing the reaction, saving and adding the reaction with new priority.

Conclusion

All in all, I see no way to remove variables from the game once saved in the save file. The only case where variables can be changed or deleted in the script is when variables belong to local characters and weren't loaded yet on level load.

It would be great if these observations could be confirmed by those with more insight!


My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan