MV Yanfly_PartySystem can't use function in dev console

can not use a function from dev console.png

Code:
Window_PartyDetail.prototype.setActor = function(actor) {
    if (this._actor === actor) return;
    this._actor = actor;
    this.refresh();
};

I try to use the function with a different actor by typing "Window_PartyDetail.prototype.setActor(220)" In the dev console, But it returns the error "bitmap" is undefined.
Typing "Window_PartyDetail.prototype.refresh()" returns the same error.
Shouldn't I be able to just use a global function like this?

Any ideas are appreciated! 🙂
would this be a case of plugins being out of order?
would this be a case of plugins being out of order?
What do u mean? The Plugin works.
yeah, it works, except that it throw some errors.

by "out of order" i meant not being in the correct order in the plugin list (sorry, english is not my 1st language).

check the correct plugin order in the yanfly plugin list (yanfly.moe) and see if yours match.
yeah, it works, except that it throw some errors.

by "out of order" i meant not being in the correct order in the plugin list (sorry, english is not my 1st language).

check the correct plugin order in the yanfly plugin list (yanfly.moe) and see if yours match.
As i said: The Plugin works. The way I try to use a Plugins-function with the dev console does not work.
As i said: The Plugin works.
in case of yanfly plugins, that does not matter.
it is a known fact that yanfly plugins can cause strange effect if installed in the wrong order, because yanfly changed too much and took several shortcuts while changing things.
if you have the wrong order of plugins they can seem to work perfectly, until you come to a strange effect and errors after weeks of playtesting.

additionally there are some other possibilities, so please provide a screenshot of your plugin manager so that we can see which plugins you installed and which order they have.
Yanfly_PartySystem was at the end of the Plugin list. I know changed it to below Yanfy_JobPoints as it is listed like this in the "Yanfly all Plugins list". It didn't change anything. I also moved the Yanfy_partySystem below the Yanfly_Core Plugin which didn't change anything either. I am quite sure, that the error has to do something with the "Window_Base." before the "Window_PartyDetail." In the error code, because this is how the Plugin itself uses the "setActor" Function:

Code:
Window_PartySelect.prototype.setDetailWindowItem = function(actor) {           
    if (this._detailWindow) this._detailWindow.setActor(actor);                
};

And that is confusingly different from how I want to use the function.
And tbh I just don't understand what is going on here. "Window_PartySelect._detailWindow" uses a method from another object? I am so confused.

Here is the Plugin-List:
plugin list 1.png
plugin list 2.png
plugin list 3.png
plugin list 4.png
plugin list 5.png
plugin list 6.png
your yanfly order is a mess. I stopped counting the wrong cases halfway through.

please go to yanfly's website and check his main plugin list. THAT is the order, top to bottom, that his plugins must have.
You can add other people's plugins between them, but yanfly's plugins have to be in that order, so please change it.

and remember that after such a change, all older savefiles are incompatible and you need to start a new game for your future playtests.

I don't know if that will solve your original error or if you'll have to continue searching for other causes, but the order has to be changed to prevent a lot of other errors.
Shouldn't I be able to just use a global function like this?
Yes, but actually no.
As an example observe the difference between the following:
Code:
$gameParty.gainGold(10);
Game_Party.prototype.gainGold(10);
Only the first one of these will actually increase the gold of the party because it references the correct global object and tells it to execute the function.
I honestly can't tell you what exactly happens in the second case in technical terms. I presume a new object of that class gets created to call that function on and it gets immediately discarded afterwards.

So to actually let the window that gets displayed currently execute a function in the console you will need to get a reference to that specific window object. I recommend starting with SceneManager._scene and see if it has any properties for that window.
I opened a new game with only yep_core and yep_partysystem to see if the Plugin order is the reason of the error.

the problem is not the plugin order.png


It returns the exact same error as in my main game.
I recommend starting with SceneManager._scene and see if it has any properties for that window.
I got it! And you were right! 😂
SceneManager._scene._detailWindow.method() works!
Replace method with whatever method should be applied.
Tyvm for the help, again, eomereolsson!

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/yanfly_partysystem-cant-use-function-in-dev-console.150707/