You get into the Battle editor by putting -enable_editor into your command line in your shortcut (same place as the -show_err). The Battle Editor then appears in the options menu. There should be documents on the .com website to help out if you don't already have them.
Your best resource for this is the Prologue campaign, in the first battle there are several points where you're required to move a unit from one point to another and then the next part of the script is triggered when they reach there. The battle scripting's all contained within the prologue campaign script. As far as I can tell the condition you'll want to use is I_UnitDistanceFromPosition. Make sure you have the docudemon files that tell you what all the conditions etc. mean and their correct syntax.
My advice would be to use I_UnitDistanceFromPosition in a monitor_conditions (you have to anyway) and then when that occurs use the unit_set_morale command for all the enemy units to rout them, which will fulfil the rout all units victory condition.
As I say, I've never done any battle scripting but the tools (monitors, iifs, etc.) are used in the same way even though the commands and set-up are different so have a look at the Intermediate Scripting guide for a conceptual understanding, though remember it's campaign scripting not battle scripting. And then replay the Prologue and go through the campaign script to understand how the code impacts the game. In all our stuff we pretty much have to do look at what CA did to understand how it works.
Bookmarks