Hi, I'm tearing my hair out over this one.
I'm using a default MV project with no other plugins, and I'm trying to make a script that selects a skill and executes it for the actor, ending their turn and moving to the next actor or enemy. This is what I have so far in my test:
The forceAction selects index [0] from the party, aka the first party member, and forces them to use skill #1 (attack) at enemy -1 (random). The battlemanager then processes it, which causes the side-view battler to step forward and play the attack animation. The updateAction is what actually deals the damage to the enemy, showing the damage numbers and affecting their hp. Then the endAction makes the battler step back into line with their party. After this, I'm at a loss, because the actor command window is still up and waiting for input! And you can use it to make another attack on the same turn...
I've been figuring this all out through trial and error via the dev console and unofficial API. Also in the API is an endTurn command:
But when I use that, it simply switches the boolean isTurnEnd to true! Nothing changes! And updateTurnEnd just changes that bool back to false!
How can I process an entire turn and actually end it, moving to the next battler's turn? It doesn't have to be an instant turn system, I just want to pick an action for that turn for the player and move to the next input via a plugin function.
Thanks so much for any help!
I'm using a default MV project with no other plugins, and I'm trying to make a script that selects a skill and executes it for the actor, ending their turn and moving to the next actor or enemy. This is what I have so far in my test:
JavaScript:
console.log('executing an attack');
$gameParty.members()[0].forceAction(1, -1);
BattleManager.forceAction($gameParty.members()[0]);
BattleManager.processForcedAction();
BattleManager.updateAction();
BattleManager.endAction();
The forceAction selects index [0] from the party, aka the first party member, and forces them to use skill #1 (attack) at enemy -1 (random). The battlemanager then processes it, which causes the side-view battler to step forward and play the attack animation. The updateAction is what actually deals the damage to the enemy, showing the damage numbers and affecting their hp. Then the endAction makes the battler step back into line with their party. After this, I'm at a loss, because the actor command window is still up and waiting for input! And you can use it to make another attack on the same turn...
I've been figuring this all out through trial and error via the dev console and unofficial API. Also in the API is an endTurn command:
But when I use that, it simply switches the boolean isTurnEnd to true! Nothing changes! And updateTurnEnd just changes that bool back to false!
How can I process an entire turn and actually end it, moving to the next battler's turn? It doesn't have to be an instant turn system, I just want to pick an action for that turn for the player and move to the next input via a plugin function.
Thanks so much for any help!