Custom Battle Buttons

Could you show your common event page where you pasted those scripts and the event page where you used a plugin command to assign the common event to a button?
Could you show your common event page where you pasted those scripts and the event page where you used a plugin command to assign the common event to a button?
absolutely!

common event, battle event
Screenshot 2024-11-26 091820.png
Screenshot 2024-11-26 091845.png
I also said

1732641590676.png
Isn't that only for the "special" or "magic" menu though? i tried

SceneManager._scene._skillWindow.setStypeId(SceneManager._scene._(1));

and

SceneManager._scene._skillWindow.setStypeId(SceneManager._scene._actorCommandWindow.currentExt(1));
Isn't that only for the "special" or "magic" menu though?
Yes? If you're not trying to run the code for a skill, then you shouldn't be using the code from commandSkill().

The code for commandAttack(), commandGuard(), etc. is completely different.

That doesn't match my instructions.

1732642496780.png


Thus,
Code:
this._skillWindow.setStypeId(this._actorCommandWindow.currentExt());
becomes
Code:
this._skillWindow.setStypeId(1);

and then you replace the this as previously instructed.
Yes? If you're not trying to run the code for a skill, then you shouldn't be using the code from commandSkill().

The code for commandAttack(), commandGuard(), etc. is completely different.


That doesn't match my instructions.

View attachment 323861

Thus,
Code:
this._skillWindow.setStypeId(this._actorCommandWindow.currentExt());
becomes
Code:
SceneManager._scene._skillWindow.setStypeId(1);
okay, right now I'm just working on the attack button though, so what is the script for that?
okay, right now I'm just working on the attack button though, so what is the script for that?
You pasted it yourself on the last page
You pasted it yourself on the last page
SceneManager._scene._skillWindow.setActor(BattleManager.actor());

SceneManager._scene._skillWindow.setStypeId(SceneManager._scene._actorCommandWindow.currentExt());

SceneManager._scene._skillWindow.refresh();

SceneManager._scene._skillWindow.show();

SceneManager._scene._skillWindow.activate();

SceneManager._scene._statusWindow.hide();

SceneManager._scene._actorCommandWindow.hide();


this? it doesn't work
Okay, if i'm looking at the scipt right, there's the one for attacking

Scene_Battle.prototype.commandAttack = function() {
const action = BattleManager.inputtingAction();
action.setAttack();
this.onSelectAction();
It's this
1732643285205.png

that does not work
Remove the first line. That's declaring a function which holds multiple scripts. You only need the scripts inside it, which are the next three lines. You also need to replace the "this" since you don't have the function declaration as a reference for "this" anymore.
that does not work
Because you're ignoring the answer to the question you asked only 45 minutes ago.

The lines between the braces
Thus, the code from the file

Code:
Scene_Battle.prototype.commandAttack = function() {
    const action = BattleManager.inputtingAction();
    action.setAttack();
    this.onSelectAction();
};

becomes
Code:
    const action = BattleManager.inputtingAction();
    action.setAttack();
    this.onSelectAction();

And then you replace the this as previously instructed.

I do not understand what's going on with this thread, so...um, good luck.
Because you're ignoring the answer to the question you asked only 45 minutes ago.


Thus, the code from the file

Code:
Scene_Battle.prototype.commandAttack = function() {
    const action = BattleManager.inputtingAction();
    action.setAttack();
    this.onSelectAction();
};

becomes
Code:
    const action = BattleManager.inputtingAction();
    action.setAttack();
    this.onSelectAction();

And then you replace the this as previously instructed.

I do not understand what's going on with this thread, so...um, good luck.
okay well i don't understand how i'm expected to take things from previous attempts if I'm told that i need to try something completely different but um alright
okay well i don't understand how i'm expected to take things from previous attempts if I'm told that i need to try something completely different but um alright
You were never told that.
okay well if you instruct me to replace this with SceneManager._scene, than

const action = BattleManager.inputtingAction();
action.setAttack();
this.onSelectAction();

would become


const action = BattleManager.inputtingAction();

action.setAttack();

SceneManager._scene.onSelectAction();

but that does not work, so im sorry if i missed anything but i guess i just don't understand
If that doesn't work, then you're not able to use that code to activate the attack action from a common event.
...okay?

So is there anything that can, or is it just not possible?
If that doesn't work, then you're not able to use that code to activate the attack action from a common event.
Well that is assuming the issue is with that code and not with the button setup.
Well that is assuming the issue is with that code and not with the button setup.
True.
Well that is assuming the issue is with that code and not with the button setup.
does this look right?

Original thread: https://forums.rpgmakerweb.com/threads/custom-battle-buttons.173462/