RPG Maker Forums

I am setting up a new manager based on the DataManager pattern.


The following works for DataManager:


DataManager.loadDatabase = function() {
...
this.loadDataFile(name, prefix + src);
...
};

DataManager.loadDataFile = function(name, src) {
...
}




but my manager gives me an Undefined is not a function error:


XRefManager.loadReferences = function() {
$dataActors.forEach(function(actor) { this.buildActorXRefs(actor); });
...
};

XRefManager.buildActorXRefs = function(actor) {
if (!actor) return;

};


The buildActorXRefs is what it's objecting to on the forEach line.


$dataActors exists and is populated at this point.


The first actor is null, but I moved the check for null actor into the forEach block and it made no difference.


My XRefManager is at the highest level, same as DataManager (not enclosed in my plugin function() {} body).


I'm hoping this will be obvious to someone else - it's sure not to me.


Edit: never mind.  Figured out I needed a .bind(this) on the function.  All working now.  Until the next issue.

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

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.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top