• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] Any hint on how to change the game's popup message on new routes, ONLY the first time you step on that route?

  • 10
    Posts
    3
    Years
    • Seen Jun 16, 2024
    The game saves which locations have we discovered and which ones we haven't, since you can see them in the map. Where can I find this data? And how could I use it to add some text to the popup with the route name only the first time you enter in the route? For example, the first time you enter un route 1, I want the game to show the popup saying 'Route 101 *New location discovered*', and from that point, it should always say 'Route 101'.
    Any hint on how to achieve this? I was thinking that this could be a good way to tell the player when can they capture a pokemon in a nuzlocke for example, just in case they forgot which routes have they already visited.
     
    The game saves which locations have we discovered and which ones we haven't, since you can see them in the map.
    The game sets flags as soon as you enter each town/city you can fly to by using a map script. That's how it tracks which flight points the Player should be able to use.
    https://github.com/pret/pokeemerald/blob/master/include/constants/flags.h#L1364-L1380
    https://github.com/pret/pokeemerald/blob/master/data/maps/LittlerootTown/scripts.inc#L42-L43
    https://github.com/pret/pokeemerald/blob/master/data/maps/OldaleTown/scripts.inc#L9-L11
    https://github.com/pret/pokeemerald/blob/master/src/region_map.c#L1178-L1223
    https://github.com/pret/pokeemerald/blob/master/src/region_map.c#L1956-L1970

    You could define new flags in include/constants/flags.h (note that this is a savefile breaking change) for each map and set them in the same manner.
    By default, there's 120 bytes in the SaveBlock1 where the flags are also stored, which is enough space to add 960 flags to use as you please, not to mention there a handful of unused flags you can also use.
    And how could I use it to add some text to the popup with the route name only the first time you enter in the route? For example, the first time you enter un route 1, I want the game to show the popup saying 'Route 101 *New location discovered*', and from that point, it should always say 'Route 101'.
    Any hint on how to achieve this? I was thinking that this could be a good way to tell the player when can they capture a pokemon in a nuzlocke for example, just in case they forgot which routes have they already visited.
    Well, for that, you'll probably need to do some code changes involving the src/map_name_popup.c file.
    Unfortunately, I can't give you hints on that myself, but I imagine you have to create a window inside ShowMapNamePopUpWindow and fill it with content in the same manner the map name popup itself is made.
     
    Last edited:
    Back
    Top