Legendary Pokémon Encounters - haven1433/HexManiacAdvance GitHub Wiki

Legendary Encounter Overview

An overworld legendary encounter event needs to keep track of two bits of data:

  • Has the Pokémon been battled?
  • Has the Pokémon been captured?

The idea is that if the Pokémon has not been battled, it should be visible; and if it has been battled, it should be hidden. But you want some way to make the Pokémon appear again, so you need a second script that checks to make the Pokémon show again. If it hasn't been caught, make the Pokémon visible; otherwise, do nothing.

image

In this example, if the Pokémon Flag is not set, then Articuno is visible. If the Capture Flag is not set, then another script can make Articuno visible again.

The Legendary Event Template

When you use the legendary event template, HexManiacAdvance will automatically choose 2 flags for the Pokémon Flag and Capture Flag. It will automatically hide the Pokémon after a battle, and will set the Capture Flag if the Pokémon was caught. But once the Pokémon has been battled once, it'll never show up again... unless you add a way for it to be shown again.

  • You may want to show the Pokémon after talking to a specific NPC.
  • You may want to show the Pokémon after leaving the map (using a Map Header Transition Script).
  • You may want to show the Pokémon after healing at a Pokémon Center.

It's up to you. But once you have the script that you want to edit, you just need to make the following changes:

  1. Add if.flag.clear.call [Capture Flag] <show> near the top of the script, where [Capture Flag] is your Pokémon's Capture Flag.
  2. Add
show:
  clearflag [Flag]
  return

to the bottom of the script, where [Flag] is your Pokémon's Flag.

Here's what that looks like in the Articuno example:

image

Common Problems

  • Each map is only allowed to have one Transition Script. If you add a new transition script to a map that already has one, nothing in the new script will run. You have to edit the existing script.
  • You should put your if.flag.clear.call command near the top of the script, before other if, end, and return commands. Otherwise it may not run every time the script runs.
⚠️ **GitHub.com Fallback** ⚠️