Status
Not open for further replies.

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
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')
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
Can you post a screenshot of the actual error from the console along with as much stacktrace data as it displays, please?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
And you're getting this error regardless of whether the perks plugin comes before or after the menu manager?
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
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
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
What happens if you just type SceneManager.push(Scene_Perks) into the console?
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
Okay done, I get this new segment.
98b3fdfdec8c43ef29669f7908ae4ee6.png
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
Does that still happen if you turn the menu manager plugin off?
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
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?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
That IS interesting...
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
X'D It is... this is all very strange.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
I'm trying to think what else I can get you to try without having the project in front of me to poke at.
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
It's fine, if you think of anything else do tell me~! Thank you for looking at this ^^
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
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?
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
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)
 
Last edited:

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
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<
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,526
Reaction score
2,631
First Language
English
Primarily Uses
RMMZ
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...
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
365
Reaction score
968
First Language
english
Primarily Uses
RMMV
XDDDD oh gosh, I get ya on that lol! >uo7
 

Ms Littlefish

Dangerously Caffeinated
Global Mod
Joined
Jan 15, 2014
Messages
6,417
Reaction score
8,110
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I wish character bust packs had options for both side-facing and front-facing for the same characters.
Looks like I'm going to have to cancel another game.
For now it is in testing phase: Changing the game icon from Rm2k/2k3 without needing to edit the executable.
Rm2k-DinChangeIcon.png
When there's a will, there's a lifehack. :ninja:

Before i mess with battle UI further, does it look decent enough? :hswt:

Forum statistics

Threads
112,528
Messages
1,068,979
Members
146,216
Latest member
WTCraft2003
Top