Simple Tweak To Existing Plugin (YEP_X ChangeBattleEquip)

Okay, I THINK this should be an easy one.

This Yanfly plugin adds the option for a character to change their equipment in battle. Cool. It even lets you set a cooldown time on how long you have to wait before you change equipment again. Even better. But, changing your equipment doesn't use your turn. So, for instance, Tseng can switch from his SMG to his katana and then act immediately with his katana. I simply want switching weapons to use a turn.

Relevant plugins:
Yanfly Battle Engine Core
Yanfly Equip Core
Yanfly BattleSys ATB

Edit: Oh, I suppose I should say: yes I know I could probably event a workaround for this, but I feel like it will be smoother and sleeker if it's executed by plugin.
Is there anyway to attach the weapon switch to a skill? that would eat up a turn
Try using a notetag in a skill and see what happens. Here's an example
Note_command.png
That's one of the workarounds I'd been considering. It wouldn't be ideal even if I could do it, but I don't think that it's possible. The plugin itself says pretty clearly that it only has

Code:
Actor, Class, Weapons, Armors, and State Notetags:

and the only note tags it takes are

Code:
  <Change Battle Equip Cooldown: +x>

<Change Battle Equip Cooldown: -x>

Increases or decreases the number of turns an actor has to wait in battle

before the actor can change equips again by x amount.

<Disable Change Battle Equip>

This will disable the ability to change equipment mid-battle for the

related actor.

I would get around this by putting <Disable Change Battle Equip> onto a state and have the equip change "skill" give the user that state with a duration of one turn, but the problem is there is no "equip change" skill so I can't even use this workaround. Equip is just a command, it seems to bypass the skills section of the database entirely... :/
Is there anyway to apply a state as soon as the weapon is equiped? If you can do that, you could "Stun" the charecter
I had the same problem plus CTB turn order disappeared so I switched to this one.
https://forums.rpgmakerweb.com/index.php?threads/equip-battle-command.49324/
But the fix on second page didn't work for me so after hours over many days of 0 scripting knowledge I managed to edit it into this, which will turn on switch 35 on changing equips and when leaving menu if switch 35 is on it will force skill 23 which does nothing, all of it is near the bottom of the file, no real problems from what I've seen except the skill used doesn't seem to do anything even if you set it to do something and I don't know how to not end turn if you switch back to the original item.

I also made a compatibility with HIME_ActorBattleCommands but it wouldn't let me upload the file so paste this over the existing compatibility script in the right place and it should work.

var Imported = Imported || {} ;
var TH = TH || {};
Imported.BattleCommandEquip = 1;
TH.BattleCommandEquip = TH.BattleCommandEquip || {};

(function ($) {



/* Create command */
TH.ActorBattleCommands.makeCommand_equip = function(symbol, ext) {
return new Data_BattlerCommand("Equip", symbol, ext);
};

/* Add the command to the list */
Window_ActorCommand.prototype.addBattleCommand_equip = function(cmd) {
var enabled = cmd.isEnabled();
this.addCommand(cmd.name(), cmd.symbol(), enabled, cmd.ext());
};

/* Add bindings for command window */
var TH_SceneBattle_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
Scene_Battle.prototype.createActorCommandWindow = function() {
TH_SceneBattle_createActorCommandWindow.call(this);
this._actorCommandWindow.setHandler('equip', this.commandEquipment.bind(this));
};
})(TH.BattleCommandEquip);
I feel like such an idiot... Didn't notice you used Yanfly BattleSys ATB which made this much much easier as it eliminates some of the problem that otherwise would show up. I used a few hours getting into how YEP_BattleEngineCore works and make a custom type of action that changes the actors equipment.
However with the ATB system this does not matter and it is ridiculously simple.. just adding a single line of code actually 🤣

Just add this after YEP_X ChangeBattleEquip and you should be good to go 🙂
glaphen: you sir are the MAN. I am in fact using Hime actor battle commands so the compatibility fix is awesome. Many thanks to you!

However, I think that I will try Magnus0808' fix first just because it seems...simpler. Magnus0808 thank you so much too! Sorry if I made you waste time delving through unnecessary code. Anyway, I'm very grateful to you both.
Sunday...Monday...Tuesday...Wednesday...now technically Thursday. Okay, safe to post after my own post w/o getting in trouble for double posting, I think.

Magnus0808, finally tried your plugin and it worked like a charm, thank you so much! If you use the equip menu but don't actually change up your equipment, it still uses up your turn but that is such a minor issue I don't remotely care. I can just inform the player in the same tutorial segment where I tell them that in this game you can change your equipment in battle unlike in most games, but can't guard/defend in battle unlike in most games.

Thank you again (and thank you for the effort Glaphen it really is the thought that counts sometimes). Magnus you're now my second favorite 808 after Cyber City Oedo 808 (seriously badass really good underrated and relatively little-known dark cyberpunk anime OAV from the 80s)!

Edit: I went and looked at your script in notepad. I'm not a coder, never have been (oh, I've tried occasionally, I just have no aptitude for it and lacking patience, give up quickly), but I felt like maybe I was getting somewhere at learning something about Ruby with all the years I've put in on VX Ace. Now that the current gen RPG Maker is Javascript, man, back to square zero, that JS code was completely Greek to me, seriously doubt I'll ever get even the very rudimentary limited handle on it that I've gotten on RGSS3. And even if by some miracle I did, who knows what language they'll use for the next version of RPG Maker!
I am happy you like the plugin. I was aware of the thing about if you use the equip menu but don't actually change up your equipment it still uses your turn. However, I let that be as YEP_X ChangeBattleEquip also locked the equip command even if you didn't make any change.
I know you said you don't remotely care but as a service I made it so it wont use the turn or lock the command if you did not make any changes.

If you ever have any questions to how the plugin actually works just shoot me a message and I'll do my best to help you understand.
Cool! Thanks once again! (I might also pester you to play the game this is for at some point.)

Original thread: https://forums.rpgmakerweb.com/threads/simple-tweak-to-existing-plugin-yep_x-changebattleequip.113932/