- Joined
- Nov 1, 2015
- Messages
- 9
- Reaction score
- 0
- First Language
- English
Hi all,
What I want to do
I want to fully automate a battle and am having trouble skipping the player inputting part of the turn cycle.
I basically want to implement my own AI - so I don't want to turn on the auto battle feature. This involves not prompting the player for their decision, but still executing an action.
What I've done
I am defining a plugin method that is called within a troop's battle script, per turn:
$gameParty.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameParty.members()[index]);
$gameTroop.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameTroop.members()[index]);
(they are from the call list: https://docs.google.com/spreadsheets/d/1-Oa0cRGpjC8L5JO8vdMwOaYMKO75dtfKDOetnvh7OHs/edit#gid=0 )
The above isn't the actual script, but the used one is executing those commands when the BattleManager._phase === "turn".
What happens
Only the troop's actions are executed, while the party's is not. What results is only the troop automatically choosing the action, but the party always skips it's turn.
I can explain the script in more detail if need be, but I wanted to post in case there's something wrong that is glaringly obvious.
I'm not even sure I can run the forceAction function on the gameParty inside the battle events of the troop for example; but I couldn't find a place to enter scripts for the party during battle, and I couldn't manage to find where in the engine code the player's actions are set.
Any help would be much appreciated!
Thanks.
What I want to do
I want to fully automate a battle and am having trouble skipping the player inputting part of the turn cycle.
I basically want to implement my own AI - so I don't want to turn on the auto battle feature. This involves not prompting the player for their decision, but still executing an action.
What I've done
I am defining a plugin method that is called within a troop's battle script, per turn:
$gameParty.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameParty.members()[index]);
$gameTroop.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameTroop.members()[index]);
(they are from the call list: https://docs.google.com/spreadsheets/d/1-Oa0cRGpjC8L5JO8vdMwOaYMKO75dtfKDOetnvh7OHs/edit#gid=0 )
The above isn't the actual script, but the used one is executing those commands when the BattleManager._phase === "turn".
What happens
Only the troop's actions are executed, while the party's is not. What results is only the troop automatically choosing the action, but the party always skips it's turn.
I can explain the script in more detail if need be, but I wanted to post in case there's something wrong that is glaringly obvious.
I'm not even sure I can run the forceAction function on the gameParty inside the battle events of the troop for example; but I couldn't find a place to enter scripts for the party during battle, and I couldn't manage to find where in the engine code the player's actions are set.
Any help would be much appreciated!
Thanks.
