RPG Maker Forums

I'm working on porting my Dynamic Features (Traits) and Effects scripts to MV.

In Ace I could just do this:

class RPG::BaseItem def features if <features were changed> return <changed features> else return @features end endendbecause $dataXYZ inherited from RPG::BaseItem.Now, in MV, there are no RPG::BaseItem classes - $dataXYZ is just an array of Objects.

So I think I can still do something similar, by creating a getter for effects and traits under Object, that will check a condition and return the modified traits/effects list, or the original one. But I'm not sure how to set a getter for Object, or how to make it refer to the real trait/effect without going into a recursive loop.

Any help appreciated.

The alternative is to override the functions that refer to .effects and .traits and I don't want to do that as I would have to overwrite them rather than alias them, and they're probably used by some of the battle plugins, which would result in incompatibility issues.

Edit: I tried the following just to see if I could get it to work, and a script call of console.log($dataActors[1].name) always prints out Harold. It doesn't even go into the getter.

Code:
(function() {  Object.defineProperty(Object, "name", {    get: function name() {      if ($gameSwitches.value(10)) {        return "overridden name";      } else {        return this.name;      }    }  });})();

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,357
Members
137,803
Latest member
andrewcole
Top