Outdoor combat encounters

There are a number of ways to add groups of monsters to an outdoors section. Click on the Outdoors menu and you'll see three options. "Outdoor Wandering Monsters" lets you create groups of monsters that will continually spawn and roam the section. Use the "Place spawn point" button to choose where these monsters appear from. "Outdoor Special Encounters" lets you create encounters that are triggered by the section's script. The simplest is "Outdoor Preset Encounters", which is what we'll be using. Click on Outdoors > Outdoor Preset Encounters:


We're looking at the settings for encounter number 0 (if you want to make more than one encounter, use the arrows on the bottom left). We want the player to fight a mix of goblins, so click the Choose buttons to pick "Goblin (L1)" as Hostile 1 and "Goblin Fighter (L4)" as Hostile 2. Then pick 4 and 2 so the player has to fight four regular goblins and two fighters.


We want the goblins to stay guarding the bridge, so set "Move type" to 1 and "Random Move Chance" to 0. Set "Start location" to be the (X,Y) coordinates of the bridge. We also want the player to fight these goblins, not avoid them with Nature Lore, so make sure "Party can't evade" is turned on. Finally, we want to display a message when the player starts fighting the goblins, and a message when the goblins are defeated, so put in state numbers for "Script State When Met" and "Script State When Beaten". Of course, we'll have to write the corresponding states in o00cavern.txt:

beginstate 11;
    "Half a dozen goblins move to block your way. Behind them, you see a lone goblin running away.",
    "It's carrying several precariously stacked crates. But to get to it, you'll have to go through its friends."

beginstate 12;
  message_dialog("You search through the goblin carcasses. No necklace. You'll have to keep looking.", "");

Much more can be done with outdoor encounters; read page 29 of the documentation if you want to learn more. Now it's time to do something very important: incremental testing.