(SOLVED) Help window on Scene_Options

Hi people!
Needing a help with the code here.
I'm trying to put a help window in my menus.
For the time being, I was able to configure all the menus I wanted. Skill, Equip, Status, etc ...
However I am having difficulties with the options menu.

Here's the code I'm doing:

Spoiler: Code
Code:
(function(){
    
    var optionsHelp = ['abc', 'asd', 'blabla'];

var eliSceneOptions_create = Scene_Options.prototype.create;
    Scene_Options.prototype.create = function() {
        eliSceneOptions_create.call(this);
        this.createHelpWindow();
    };

    Scene_Options.prototype.update = function() {
        Scene_MenuBase.prototype.update.call(this);
        this._helpWindow.setText(optionsHelp[this._commandWindow._index]);
    }

    Scene_Menu.prototype.createHelpWindow = function() {
        this._helpWindow = new Window_Help();
        this.addWindow(this._helpWindow);
        this._helpWindow.y = 0;
        this._helpWindow.x = 0;
        this._helpWindow.width = 730;
        this._helpWindow.height = 96;
        
    };
})();

On all other menus, this method
"this._helpWindow.setText (optionsHelp [this._commandWindow._index])" worked.
But in this case, whenever I try to open the options menu the error appears:

"TypeError
Can not read property "_index" of undefined "

When I remove this index, I can get into the options menu and see the help window. But nothing appears in it.
Thanks in advance!
This means that your options menu doesnt have the _commandWindow property/object. Is this menu from a plugin? If yes, we need to know which plugin so that we can determine what is the correct property to call. Practically, we just need to know the name of the command window that it's using because from the error its clear that it is not _commandWindow.
Hi!
I dont know if i understand you, but this is not from a plugin. This code i built myself and the project that i testing it only have the plugins that i made for put another help windows on the other menus.
But i also disable them to test that.
If you made it (the Options menu) then it should be easy enough to find what name you gave to your command window.

The error you had means that the object trying to call ._index doesnt exist, that object is ._commandWindow. Which means that there is no object/property of your options menu with the name ._commandWindow

Oh wait, MV has its built in Options Menu right? Are we talking about that? On that case, you need to open the base JS files that controls that menu to find the appropriate name to use. Im at work and cannot check it for you, sorry.
I was trying to track down in the rpg_windows and rpg_scene. But i not found it in the same way that i found for window_equipSlot, equipcommand etc.
How can i manage to when the option is highlited, the help window show something?
In the others scenes(item,skill,equi etc) this command works, but not for this :/
As I said above, you simply need to know what name was given to the command window of the options menu because that's what the error is about.

You should be able to get it if you trace it from the "Start" function of the Options scene. So start from rpg_scene then do a CTRL+F for option or options. Then once you find the code for the options scene, find the start function of it which should be just around the top and it should be listing/calling the function where it creates its command window and from there you should be able to learn what name was given to that window.

Else, lets wait for somebody else to find it for you as I dont have MV here at work.
Yes, looks like the relevant property is called _optionsWindow rather than _commandWindow; this may work:
Code:
this._helpWindow.setText(optionsHelp[this._optionsWindow._index]);
Yes, looks like the relevant property is called _optionsWindow rather than _commandWindow; this may work:
Code:
this._helpWindow.setText(optionsHelp[this._optionsWindow._index]);
Yeah!! Thats it! I ve searched a lot looking for any "command options" to see the difference, but it right in face!
Thanks a lot Caethyril!!!!😀👍

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.

Original thread: https://forums.rpgmakerweb.com/threads/solved-help-window-on-scene_options.105769/