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?
Custom Battle Buttons
RPG Maker MZ SupportI also said
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));
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.
Thus,
Code:
this._skillWindow.setStypeId(this._actorCommandWindow.currentExt());
Code:
this._skillWindow.setStypeId(1);
and then you replace the
this as previously instructed.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
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
It's this
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.
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
You were never told that.
okay well if you instruct me to replace
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
this with SceneManager._scene, thanconst 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?
So is there anything that can, or is it just not possible?
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/