I'm stumped. Initially I was going to save the old initialize() function into a variable and rewrite it so it calls the old function and then defines _isFollowing. However the variable is forgotten about the time the map loads. I decide to override the function completely and so far I have this:
I have no other plugins that messes with the Game_Followers wrapper object. The only time a new Game_Followers object is made is when the Game_Player calls its own initialize() function. I have no idea what else could cause a new Game_Followers object to be made and not be initialized with my own function
Until then, I'm hacking my isFollowing() function to set the variable if it's undefined
EDIT: I found the problem. When the game loads, it loads a version of the Game_Followers object that does not have my new variable, thus "forgetting" it. My problem should be solved with each subsequent save file
Code:
Game_Followers.prototype.initialize = function() {
this._visible = $dataSystem.optFollowers;
this._gathering = false;
this._isFollowing = true;
this._data = [];
for (var i = 1; i < $gameParty.maxBattleMembers(); i++) {
this._data.push(new Game_Follower(i));
}
};
I have no other plugins that messes with the Game_Followers wrapper object. The only time a new Game_Followers object is made is when the Game_Player calls its own initialize() function. I have no idea what else could cause a new Game_Followers object to be made and not be initialized with my own function
Until then, I'm hacking my isFollowing() function to set the variable if it's undefined
EDIT: I found the problem. When the game loads, it loads a version of the Game_Followers object that does not have my new variable, thus "forgetting" it. My problem should be solved with each subsequent save file