Many of us probably know about Kanto Route 24 and its Nugget Bridge. In FRLG, there is water under the Nugget Bridge, so the player can surf underneath the bridge. This would be a standard bridge tile (terrain tag 15 in Essentials). However, in Essentials v19, events will only be on top of a bridge if the player is. This can be mitigated by setting Always On Top to true, but then the event will appear above the player, which is likely undesirable. This guide will help you get around this issue and set up an event that is always on top of a bridge, but not on top of the player.
What you need:
At least one open Global Switch.
How-to:
That's it. Not really that code intensive, but it's a bit tricky, so I felt like sharing it might be a good idea.
What you need:
At least one open Global Switch.
How-to:
- Set an open Global Switch to the following name:
s:$PokemonGlobal.bridge != 0
This switch will now mirror the player's bridge status, being on only if the player should go over bridges. For the rest of the guide this will be referred to as switch 69, as that is the switch used in the screenshots. - In your event, make four pages: the first page has no conditions, the second page's condition is "if switch 69 (or whichever switch your bridge switch is) is true", the third page is "if self switch A is true", and the fourth page has both conditions. If your event isn't a Trainer, you can remove pages three and four. However, if any other conditions need to change your NPC's behavior, you'll also need a duplicate page with the additional condition of switch 69 being true.
- On any pages without the switch 69 condition, check Always On Top and Through in the bottom left corner of the event screen, and preferably do not have them run any code (the screenshots show the defeated text because it is impossible for a player to interact with this event - alternatively you can use this to call out that you aren't on the bridge if the player tries to interact with the Trainer). On all other pages, do not check either condition.
- Pages 2 and 4 should mirror pages 1 and 2 of a standard Trainer event. In other words, page 2 runs the battle, and page 4 contains whatever the NPC does after being defeated. (In my game, they repeat their overworld loss text or say new text if they do not have any overworld loss text, but as you probably know, this isn't required.
- In the events that run pbBridgeOn and pbBridgeOff, also run the code
$game_map.need_refresh = true
. This will make it so all events on the bridge will update their page number. You only need to do this on maps where there are events on bridges, but you must do it on ALL pbBridgeOn AND pbBridgeOff events on the entire map.
That's it. Not really that code intensive, but it's a bit tricky, so I felt like sharing it might be a good idea.
- Credits
- No need to credit