Great sleuthing, Abraxas!


Global characters:
On a related note, my development revealed that OnInit() events of global characters were fired multiple times in rapid succession (I noted 3 to >10, depending on PC) when a new playthrough begins. Thereafter, OnInit(), along with variable re-initialization, appeared to occur at least on level load; potentially even after re-encountering an object after having left it beyond a certain radius.


Originally Posted by Abraxas*
Local and global variables [of local characters] are saved in the save file when the script was initialized on level load...

So these variables are saved permanently, yet they appear to always be reinitialized on level load. I've had a few cases during development where this became a problem, because there is no way to maintain a "flag" variable within a local object's script (that will at some point be walked away from).


Originally Posted by Abraxas*
Local characters can't be addressed and are completely unresponsive if the player isn't in the same level.

More specifically, I believe a player needs to be within a short range of local characters (roughly 35 meters?) to have their scripts function.


Originally Posted by Abraxas*
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.

Can definitely confirm this, I dealt with this problem a number of times.


Originally Posted by Abraxas*
reaction priorities, which are similarly remembered as variables

I had no idea... good to know!


Originally Posted by Abraxas*
I see no way to remove variables from the game once saved in the save file.

I'm interested to know if removing the object via a scripted Destroy() (I think it's called Destroy) call will remove the variables from the save. Likewise, does death or being offstage affect this whatsoever? I'm relatively sure that death does not, as I've tested that scripts continue to function from the corpses of deceased characters.



Thanks for the hard work Abraxas, very informative!

Last edited by Ameranth; 19/08/17 03:16 PM.