How do I run a plotscript before a battle?

From OHRRPGCE-Wiki
Jump to navigationJump to search

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.

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.

See Also[edit]