MV Need a plugin extension for Yanfly's "Change Battle Equip" that lets it be triggered by a skill

So, as I stated in the title, I'm looking for a plugin extension for Yanfly's "Change Battle Equip" that lets me trigger the equipment screen through a specific skill. As it stands, Yanfly's plugin adds a knew "equip" command to every actors battle menu. Instead of this, I want a specific "Re-Equip" special skill to trigger the equipment screen; not every character has it, it is used automatically, it takes up the character's turn, and it costs TP.

http://www.yanfly.moe/wiki/Change_Battle_Equip_(YEP)
Try giving your skill a common event with the Script command:
Code:
SceneManager._scene.commandChangeBattleEquip()

It looks like the problem for you might be that it automatically sets it back to the input phase. But if calling that function works in your game without causing errors/crashes, we can make a modified version without that one line.
Try giving your skill a common event with the Script command:
Code:
SceneManager._scene.commandChangeBattleEquip()

It looks like the problem for you might be that it automatically sets it back to the input phase. But if calling that function works in your game without causing errors/crashes, we can make a modified version without that one line.
It works initially, by which I mean I can successfully enter the equipment screen, but once I exit the equipment screen I get this error message:

Edit: also I just discovered that it only works if the skill has the <instant cast> notetag. If I remove the tag the skill doesn't do anything.
Huh...I dunno why doing the scene change in a different part of the turn would mess with the sprites.
Huh...I dunno why doing the scene change in a different part of the turn would mess with the sprites.
so, after turnning off my MOG hunter plugins(which I would like to keep using), I no longer get an error message, so it must be a plugin conflict between Yanfly's change battle equip plugin and the MOG plugins. However, I run into a different problem where none of the battlers can take their turn.
I think that's what I mentioned in my first post, where that function tries to set it back to the input phase.

Do the MOG plugins give you trouble when you use the change battle equip as the command normally?
I think that's what I mentioned in my first post, where that function tries to set it back to the input phase.

Do the MOG plugins give you trouble when you use the change battle equip as the command normally?
yes.
Then that would be a separate issue to ask someone to try to help you modify the plugins to be compatible with each other. I don't know what Mog's does that's unique, but Yanfly does offer a battle cursor plugin.

For the time being, open up your Battle Equip plugin in a text editor. Go to line 378 and copy from there through line 391.

Go right beneath it and paste, so you have two copies of the function in a row. Change the name to
Code:
Scene_Battle.prototype.skillChangeBattleEquip

Then, two lines up from the bottom of that pasted section, change the end of the line so it reads:
Code:
BattleManager._phase='turnEnd';

Then change the script command in your common event to skillChangeBattleEquip instead of commandChange etc.

See what happens.
Then that would be a separate issue to ask someone to try to help you modify the plugins to be compatible with each other. I don't know what Mog's does that's unique, but Yanfly does offer a battle cursor plugin.

For the time being, open up your Battle Equip plugin in a text editor. Go to line 378 and copy from there through line 391.

Go right beneath it and paste, so you have two copies of the function in a row. Change the name to
Code:
Scene_Battle.prototype.skillChangeBattleEquip

Then, two lines up from the bottom of that pasted section, change the end of the line so it reads:
Code:
BattleManager._phase='turnEnd';

Then change the script command in your common event to skillChangeBattleEquip instead of commandChange etc.

See what happens.
I tried it, but now the skill does nothing.

Edit: is it important to keep the plugin name the same?
Edit: is it important to keep the plugin name the same?
Yes, you should never rename plugins, but...you completely changed the script call that you had 🙄

What you have in there isn't any kind of valid JavaScript syntax now.

The only thing we edited, and that you should have changed, was the word "command" to "skill"
Yes, you should never rename plugins, but...you completely changed the script call that you had 🙄

What you have in there isn't any kind of valid JavaScript syntax now.

The only thing we edited, and that you should have changed, was the word "command" to "skill"
I've rewritten it and now I'm getting an error message when I try to battle test.
Edit: is it important to keep the plugin name the same?
If the plugin has parameters renaming it will outright break the engine's ability to locate it. If another plugin references that plugin by name it won't be able to find it either. Some plugins you can rename without issue but as a general practice you should leave plugins as is because of the aforementioned issues.
I'm sorry, your screenshots aren't making sense to me. It looks like instead of doing what I told you to do in post 8 to copy code, you deleted the original code and then changed what was left.

Please restore your copy of the plugin from the original download then follow my instructions in post 8 again. You should end up with two functions, commandChangeBattleEquip and skillChangeBattleEquip, which have identical code except the skill has one word changed.
I'm sorry, your screenshots aren't making sense to me. It looks like instead of doing what I told you to do in post 8 to copy code, you deleted the original code and then changed what was left.

Please restore your copy of the plugin from the original download then follow my instructions in post 8 again. You should end up with two functions, commandChangeBattleEquip and skillChangeBattleEquip, which have identical code except the skill has one word changed.
Does this look right?

Edit: what about changing 'input' to 'turnEnd'?
Edit: what about changing 'input' to 'turnEnd'?
Yes, my previous post said inside of the code you pasted (on the bottom, now named skillChangeBattleEquip) to change that one word.

Then you change your script call in the common event and only change the one word there as described.

Let me know how that works.
Yes, my previous post said inside of the code you pasted (on the bottom, now named skillChangeBattleEquip) to change that one word.

Then you change your script call in the common event and only change the one word there as described.

Let me know how that works.
okay, now the skill doesn't do anything.

Edit: I reinstalled the original plugin like you said, copied that one chunk of code, and changed 'command' to 'skill' and 'input' to 'turnEnd'. I did not change the plugin's name this time.
I don't see how it's possible for it to do nothing from those changes. Your script call in the skill is
Code:
SceneManager._scene.skillChangeBattleEquip()
?
I don't see how it's possible for it to do nothing from those changes. Your script call in the skill is
Code:
SceneManager._scene.skillChangeBattleEquip()
?
oh, I just had 'skillChangeBattleEquip' set as a plugin command. I changed it and now it works. although it didn't solve the issue with it crashing once I leave the equipment scene.

Original thread: https://forums.rpgmakerweb.com/threads/need-a-plugin-extension-for-yanflys-change-battle-equip-that-lets-it-be-triggered-by-a-skill.158305/