The RPGReact battle system is a collection of React components that work together to render battles using data from RPG Maker MZ's battle engine. This guide explains the architecture, component relationships, and how to customize the battle UI.
Architecture Overview
The battle system uses a single-direction data flow from RMMZ to React:
// User selects "Attack"
props.pageData.commands.battleCommand('attack');
// User selects target
props.pageData.commands.selectTarget(enemyIndex);
// User confirms action
props.pageData.commands.confirmAction();
1. Battle Start
↓
2. Turn Start → Input Phase
- BattleInput shows for active actor
- Player selects command
- Player selects target (if needed)
↓
3. Action Execution Phase
- Actions execute in speed order
- BattleLog updates with results
- HP/MP/TP bars animate
↓
4. Turn End
- Check for victory/defeat/escape
- If battle continues, go to step 2
↓
5. Battle End
- BattleResults shows (if victory)
- OR GameOver screen (if defeat)
1. Battle Start
- All ATB gauges begin filling
↓
2. Continuous Loop
- ATB gauges fill based on agility
- When gauge full → Input Phase for that actor
- Time continues (Active) or pauses (Wait)
- Player selects command/target
- Action executes immediately after input
- BattleLog updates
↓
3. Battle End (same as turn-based)