Hi. I'm looking to save data into actors using a custom property (which I'm calling "._chardata") in JS. I've looked around and tried this code but it always returns null, and if I directly try to write into the "._chardata" property using a JS event in RPG Make MZ itself it says it "cannot read property "_chardata" of null."
It's confusing cause it seems to be recognizing the property, or it wouldn't even return null, but i can't seem to get it to have the data I want on it for some reason.
JavaScript:
(function () {
Object.defineProperties(Game_Actor.prototype, {
chardata: {
get: function () { return this._chardata || null; },
set: function (value) { this._chardata = value; },
configurable: true
}
It's confusing cause it seems to be recognizing the property, or it wouldn't even return null, but i can't seem to get it to have the data I want on it for some reason.