MV Common Event Command in Battle

Hi, I'm looking for a script that would let you use a common event as one of the actor's battle commands. The common event itself is just a standard choice box that alters the current active's state. This command would be placed before all of the others (attack, item, etc.) and would occur immediately after use without expending a turn. I managed to brute force it with Yanfly's instant turn and Hime's actor commands plugins, but the result feels too janky.

Here's what it looks like now:

CommonEventInBattle2.png


I don't like how everything moves back as if the character has already acted. I want it to look something like this photo-edited version:

CommonEventInBattle.png


The Stance command would be linked to the common event, and show the choice box right above it. If there's an easier way to get something looking like this with minor script edits, please let me know. I would also be open to a separate window that doesn't affect the layout of any others, as long as it can be accessed directly from actor command. It should at least be compatible with Yanfly's Core and Battle Engine. Thanks!
Why not make Stance a Skill Type and Balanced/Aggressive/Defensive be Skills within it? Then you'll use all the default, included windows for selection, and the only plugin you'd need would be Instant Cast.
Why not make Stance a Skill Type and Balanced/Aggressive/Defensive be Skills within it? Then you'll use all the default, included windows for selection, and the only plugin you'd need would be Instant Cast.
I thought of doing that, but it seems to cause the same issues. The functionality is there, I just don't like how the actor sprite and windows move back and forth as if they used a skill. It should be a bit more seamless.
Well...you've gotta choose something 😛 Or code/commission it to be your exact, custom specifications.

I'm not familiar with anything that runs a common event directly from the actor command window. It would screw with the battle manager progression and how turns are tracked and such.

You could list the three stances as skills directly there, without selecting a Stance skill type first. Then you don't worry about how big the skill selection window is.

You could get rid of the status window wiggling and be content with the rest of it - either the way it is or using the skills solution.

Someone else might have another suggestion.
Well...you've gotta choose something 😛 Or code/commission it to be your exact, custom specifications.

I'm not familiar with anything that runs a common event directly from the actor command window. It would screw with the battle manager progression and how turns are tracked and such.

You could list the three stances as skills directly there, without selecting a Stance skill type first. Then you don't worry about how big the skill selection window is.

You could get rid of the status window wiggling and be content with the rest of it - either the way it is or using the skills solution.

Someone else might have another suggestion.
Hm okay I'll try to see what I can do. Thanks anyway!
Hi, I'm attempting to code a new mechanic into my game that requires adding a new actor command. This command will allow the player to choose from 1 of 3 "stances," each with their unique benefits (represented as states). Changing stance does not count as an action, and can be used multiple times per-turn so you can choose attack, skill, etc. directly after. Here is how I'd like it to look like:
CommonEventInBattle.png

So far, I only edited rpg_windows and rpg_scenes to include the command without any actual functionality. The latter is what I need help with, specifically with the little popup window and the three options. Here's my code so far:

Spoiler: rpg_windows
Window_ActorCommand.prototype.makeCommandList = function() {
if (this._actor) {
this.addStanceCommand();
this.addAttackCommand();
this.addSkillCommands();
this.addGuardCommand();
this.addItemCommand();
}
};

Window_ActorCommand.prototype.addStanceCommand = function() {
this.addCommand("Stance", 'stance', this._actor.canAttack());
};

Spoiler: rpg_scenes
Scene_Battle.prototype.createActorCommandWindow = function() {
this._actorCommandWindow = new Window_ActorCommand();
this._actorCommandWindow.setHandler('stance', this.commandStance.bind(this));
this._actorCommandWindow.setHandler('attack', this.commandAttack.bind(this));
this._actorCommandWindow.setHandler('skill', this.commandSkill.bind(this));
this._actorCommandWindow.setHandler('guard', this.commandGuard.bind(this));
this._actorCommandWindow.setHandler('item', this.commandItem.bind(this));
this._actorCommandWindow.setHandler('cancel', this.selectPreviousCommand.bind(this));
this.addWindow(this._actorCommandWindow);
};

...

Scene_Battle.prototype.commandStance = function() {

};

My main issue is creating the actual "stance" window and making sure it functions properly. Jumping around in the base code makes it difficult to keep track of what does what, so if there is anything I could use as a template, it would be much appreciated. Thanks!
I wouldn't change the core directly, you can overwrite them, but it's better
if you aliast it to make new commands.

new commands like "canAttack" can also be different, and tell what it should
do and maybe what skill to use (check how guard, attack is done) and use
those function as I did it for someone else before.

if you follow the skills, you can make it make to work,
I wouldn't change the core directly, you can overwrite them, but it's better
if you aliast it to make new commands.

new commands like "canAttack" can also be different, and tell what it should
do and maybe what skill to use (check how guard, attack is done) and use
those function as I did it for someone else before.

if you follow the skills, you can make it make to work,
Ok that makes sense, but how do I connect my new window to the command itself? Presumably I'll have something called Window_BattleStance (the small window above command in my image), and have it open when you choose the Stance command. I also need the three options to work properly (i.e. give the actor the chosen stance state and remove their current one).
Why jump directly to trying to code your own windows and selection screens instead of any of your options in your existing thread?

That seems like choosing the hardest possible path instead of just doing something that works. Is your game nearly-finished such that the specific aesthetics of this matter that much?

Especially when - no offense, just judging from your questions - you don't appear to be particularly proficient in JavaScript, and you're just trying to figure out what to copy and paste to make it do what you want.

I've merged the preceding 4 posts into this thread.

Original thread: https://forums.rpgmakerweb.com/threads/common-event-command-in-battle.166801/