Small help with adding Mr.TS Perks to Yanfly main menu manager.

Hello, like the title says, I'm trying to add in Mr. Trivel's perks system,
https://forums.rpgmakerweb.com/index.php?threads/perks.51822/
into my main menu via Yanfly MM manager http://yanfly.moe/2015/10/17/yep-14-main-menu-manager/

The option shows without Yanfly's manager as usual, but when I have the manager ON it disappears.
So I tried adding it in myself, this is how the entry for it looks like for this.
New Canvas.jpg


It works that it shows on the menu now, and you can select actors like you do with equipment. But the moment I actually comfirm an actor selection, I keep getting a Reference error saying that Scene_Perks is not defined.
New Canvas.jpg

New Canvas.jpg


Which confuses me because Scene_Perks is correct, since when using another plugin to add backgrounds and I used Scene_Perk, it references and adds the background to that scene as intended.

I played around with the plugin placement and switched off other plugins, it didn't fix it.
Also replaced Scene_Perks with other Scenes and it works for those, so I must be missing something obvious here! I hope someone can point out what. Thank you for taking your time to read. 8')
Can you post a screenshot of the actual error from the console along with as much stacktrace data as it displays, please?
@Trihan
Oh yes of course! Edited my post with it.
And you're getting this error regardless of whether the perks plugin comes before or after the menu manager?
Yes, regardless if the Perks plugin comes before or after the Menu Manager I get the same error.
Though if I put Perks on the top, while the error message is the same, the console is slightly different, can't see anything related to the the Perks plugin.

New Canvas.jpg
What happens if you just type SceneManager.push(Scene_Perks) into the console?
Okay done, I get this new segment.
98b3fdfdec8c43ef29669f7908ae4ee6.png
Does that still happen if you turn the menu manager plugin off?
When the menu manager is off it works like its intended to.
But now after fiddling it around a little more, I noticed that it's also maybe related with the Formation checkbox option in the Database.
I tried taking out the params in the Manager plugin. Put the Perks plugin under the Manager, and checked on the Formation option and it shows and works, but when I check off the option (no Formation option) the Perks option disappears with it.
Could this be part of the problem?
That IS interesting...
X'D It is... this is all very strange.
I'm trying to think what else I can get you to try without having the project in front of me to poke at.
It's fine, if you think of anything else do tell me~! Thank you for looking at this ^^
Would I be able to replicate this by simply adding the plugins to a new project, or have you done further setup on your end?
This is actually happening even on a new project with these two specific plugin, so it's definitely these two conflicting in some way which I'm not sure about.
Okay, give me 10 minutes.

So I've made an interesting discovery: scenes created by a plugin are only accessible from the plugin that created them; there are some plugins that get around this by assigning the scene function to a variable that can be referenced externally.

To expand on this, basically most if not all plugins are contained inside an anonymous function; this allows you to use pretty much any identifiers you want without worrying about polluting namespaces, but it also restricts the scope of anything you create inside the anonymous function to that function. If you want to be able to reference any of the plugin code externally, you either have to NOT put your plugin code inside an anonymous function (in which case you DO have to worry about polluting namespaces) or you can assign the code to a variable that's declared outside the anonymous function. For example, if you were to add a line to the bottom of MrT's plugin along the lines of "DRGPERKS = Scene_Perks;" then in the parameters for Yanfly's menu manager you'd put SceneManager.push(DRGPERKS)
Oh wow, I see. That does make sense, yeah I can see how that would cut down too many same namespaces competing against each other. It's really good to identify the problem here for future references!
I added that line and it works perfectly now~ Thank you so much for figuring this out, I really appreciate it! >u<
Any time, it's what I come here for. 🙂 Well, that and the money I make writing plugins and scripts, but mostly for the helping people. Yeah...
XDDDD oh gosh, I get ya on that lol! >uo7
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/small-help-with-adding-mr-ts-perks-to-yanfly-main-menu-manager.75673/