- Joined
- Apr 19, 2012
- Messages
- 38
- Reaction score
- 6
- Primarily Uses
So I developed a rune system for my game where each rune is an instance of the object Game_Rune. I store all runes in an array inside Game_Party, like this:
When I save my game, this is how my Game_Rune object looks like. By this point, everything works fine, I can call any methods from my Game_Rune object and it all runs perfectly.
However, after loading my saved game, this is how my Game_Rune object looks like. From this point on, nothing works. I can't call any of the Game_Rune methods anymore, because I get a "not a method" exception... It looks like the object loaded isn't a Game_Rune, but something else, like a generic object.
Is there any way to fix this problem? I have no idea what's happening
JavaScript:
ZNT.Game_Party_initialize = Game_Party.prototype.initialize
Game_Party.prototype.initialize = function() {
ZNT.Game_Party_initialize.call(this);
this._runes = []
}
Game_Party.prototype.addRune = function(runeId) {
if (this.hasRune(runeId))
return 0;
this._runes.push( new Game_Rune(runeId) );
}
When I save my game, this is how my Game_Rune object looks like. By this point, everything works fine, I can call any methods from my Game_Rune object and it all runs perfectly.
JavaScript:
Game_Rune {_runeId: 1, level: 1, _skills: Array(1), experience: 0}
However, after loading my saved game, this is how my Game_Rune object looks like. From this point on, nothing works. I can't call any of the Game_Rune methods anymore, because I get a "not a method" exception... It looks like the object loaded isn't a Game_Rune, but something else, like a generic object.
JavaScript:
{_runeId: 1, level: 1, _skills: Array(1), experience: 0, @: "Game_Rune"}
Is there any way to fix this problem? I have no idea what's happening