• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

any version Putting Trainers on bridges 2022-03-13

This resource does not pertain to any specific version of Pokémon Essentials.
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:
  • 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.
You can also use this for Trainers near a bridge, so that they don't challenge you if you are on the bridge, but I prefer to just use a conditional branch in that case (using the same code as the Global Script Switch above, but with == 0 instead of != 0) instead of making a page.

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
  • PAGE ONE.PNG
    PAGE ONE.PNG
    34.3 KB · Views: 292
  • PAGE TWO.PNG
    PAGE TWO.PNG
    30.8 KB · Views: 305
  • PAGE THREE.PNG
    PAGE THREE.PNG
    25.3 KB · Views: 265
  • PAGE FOUR.PNG
    PAGE FOUR.PNG
    24.5 KB · Views: 294
Author
Astralneko
Views
1,744
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Astralneko

Latest updates

  1. Forgot a step lmao

    Added in that you need to refresh the map's events since I embarrassingly forgot that events...
Back
Top