MZ (Solved) TypeError: Cannot set property 'frameVisible' of undefined

I've been trying to figure this out since yesterday but I'm totally stumped on this one.

I'm trying to use Lyra's NameInput Upgrades & Party Pronoun Management plugin, unsuccessfully. The error (title) occurs whenever a plugin command is issued for player input; changing an actor's name, nickname or pronouns, but also the command for changing variables.

Spoiler: Console Screenshot
Capture.png


This is the line in the plugin that the error is referencing. Not sure if it helps to post it or not, but I'm posting it anyway.

Capture1.PNG


And this is what my event looks like. The error occurs on the plugin command(s).

Capture5.PNG

Things I have tried:
  • Exploring the demo game linked with the plugin to see how it all works in-game.
    • Result: It's pretty straightforward, and I've replicated the events in my game.
  • Rearranging this plugin to different locations higher and lower in the plugin list.
    • Result: I still get the same error.
  • Using only the same plugins as included in the demo game.
    • Result: I still get the error.
  • Disabling all other plugins. Every single one. (Except for this plugin, of course)
    • Result: I still get the error.
  • Starting a new, fresh game and only having this single plugin installed.
    • Result: It works fine in this one. So it must be something wrong with my game.
Spoiler: Other Plugins
Not sure if helpful, but I'm posting the list of my other plugins anyway.
Capture2.PNG

Capture4.PNG

I'm not savvy with Javascript, so I'm not really sure where to go from here to narrow down the problem. Any help would be very much appreciated! Thank you for your time.
I don't know if it makes a difference, but did you do this?

CAUTION: If you already use a plugin that adds keyboard support to the default Change Name scene (such as VisuMZ_0_CoreEngine) then set "Add Keyboard Support" to false in the plugin settings to disable the basic keyboard support of this plugin, or else keyboard support won't work!
Yep! That was actually one of the first things I did.
I think you need to start backwards from the error message, and the key is the "of undefined".

this always means that the engine is trying to access a dataobject that does not exist.
this can usually happen due to the following possibilities:

- plugin references to the missing data object (usually because one of its properties is configured wrong

- there is an entry in the database that had been deleted but is still referenced somewhere in the game

- you did not start a new game but loaded an older and now incompatible savefile

- one of your notetags or plugin commands is actually wrong
Hi there!
Well, I will give it a long shot here.

There is no reference to _buttonAssistWindow on the default RPG maker codes.
And there are only 3 references for it on the Lyra plugin, and they are not creating it. It is being treated as if it has already been created and added to the scene.
So, there must be another plugin that adds this _buttonAssistWindow, and maybe you can find it on the sample project created by Lyra.

Because of the name of the property "buttonAssistWindow", I presume it may be something related to the TOUCH UI options, that enable the visual buttons on the screen, so the user can click on them.

On the scene map, you have a Menu Button in the up-right corner of the screen.
If you disable the TOUCH UI options, on the options menu, the menu button will not appear.

So, try triggering the error again, but before, enable the TOUCH UI on the options menu, and set it to true.
I believe the button is only created if this option is set to true.
But if this option is set to false, it will not be created.
And the problem is that the Lyra plugin is referencing it, without taking into consideration the TOUCH UI option.

So maybe that is the problem. If not, another plugin has a flag for creating this button, and the Lyra plugin is not taking into consideration this flag.

An easy way to fix that, without taking into consideration this flag, is just to replace the Scene_Name.prototype.start (line 1092)with this one:
JavaScript:
Scene_Name.prototype.start = function() {
    Scene_MenuBase.prototype.start.call(this);
    this._editWindow.refresh();
    let trans = this._showWindowBacks ? 255 : 0;

    if (this._buttonAssistWindow) {
        this._buttonAssistWindow.frameVisible = this._showFrames;
        this._buttonAssistWindow._openness = this._showHelp ? 255 : 0;
        this._buttonAssistWindow.opacity = trans;
    }

    this._inputWindow.opacity = trans;
    this._editWindow.opacity = trans;
    
};

I just add a check if the button exist if (this._buttonAssistWindow) {.
@Andar I thought the same thing, that 'undefined' meant there was a problem with something in the database (I've been scouring the forums for similar issues, and I've seen that very thing mentioned here and there!), but after checking my database for errors, I couldn't find any. And the name 'frameVisible' seemed... peculiar. Thank you for your suggestions! None of them were the issue though, unfortunately.

@Eliaquim Oh my gosh you're a legend. I checked my settings in game, and the Touch UI was already enabled, so I ruled that out. But that modification you wrote actually fixed it, so thank you very much! I highly appreciate it! Your explanation does make a lot of sense too. I'm still slowly learning Javascript on the side, so hopefully I'll get better in the future at figuring out this sort of stuff!

It does make a lot of sense that there might be another plugin that creates the flag, but... in the demo game there is a second plugin for giving enemies names and pronouns (I don't need that, though), and in the new project file I created with just this plugin alone, it worked by itself. So, I'm not sure, maybe something got jumbled up somewhere with the other plugins I have, that didn't get reverted when I turned them off. Either way, your solution fixed it, so I'm very grateful! Thank you, again. 😍
@Andar I thought the same thing, that 'undefined' meant there was a problem with something in the database (I've been scouring the forums for similar issues, and I've seen that very thing mentioned here and there!), but after checking my database for errors, I couldn't find any. And the name 'frameVisible' seemed... peculiar. Thank you for your suggestions! None of them were the issue though, unfortunately.

@Eliaquim Oh my gosh you're a legend. I checked my settings in game, and the Touch UI was already enabled, so I ruled that out. But that modification you wrote actually fixed it, so thank you very much! I highly appreciate it! Your explanation does make a lot of sense too. I'm still slowly learning Javascript on the side, so hopefully I'll get better in the future at figuring out this sort of stuff!

It does make a lot of sense that there might be another plugin that creates the flag, but... in the demo game there is a second plugin for giving enemies names and pronouns (I don't need that, though), and in the new project file I created with just this plugin alone, it worked by itself. So, I'm not sure, maybe something got jumbled up somewhere with the other plugins I have, that didn't get reverted when I turned them off. Either way, your solution fixed it, so I'm very grateful! Thank you, again. 😍
Glad I can help! ^^
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/solved-typeerror-cannot-set-property-framevisible-of-undefined.151062/