How do I run a plotscript before a battle?
To run a script before each battle, you need to write an Instead of battle script. You must set it in the General Map Data menu for each map, or you can set a global default Instead of Battle script in the Edit General Game Settings/Special Plotscripts
Here is an example script you can customize for your game:
plotscript, special battle handler, formation=0, formset=0, begin # stuff that happens before the battle goes here # now trigger the battle fight formation(formation) end
When a script is set as an Instead of Battle script, the first two arguments are automatically filled with the battle formation number, and the formation set that the random battle was chosen from.