• 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 Conquest 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.

[Pokeemerald] Adding a secret door that is only revealed at a certain point in the story

  • 3
    Posts
    1
    Years
    • Seen Apr 15, 2025
    Hey gang! I'm looking to make a secret door appear on Devon's First Floor, after a certain flag or variable is set.

    Based on looking at similar existing events in the various script.inc files, "SetMetatile" seemed to be the way this is done. I gave it a crack below:

    Spoiler: Script attempt


    This doesn't produce any errors when compiling - but it doesn't seem to update the metatiles on the map after the flag is set.

    Would appreciate any help at all! Thank you.

    Apologies if an explanation for this already exists. I've searched through the wiki, simple mods thread, and Team Aquas Hideout channel but can't seem to find anything. I might be searching for the wrong terms though.
     
    Hey gang! I'm looking to make a secret door appear on Devon's First Floor, after a certain flag or variable is set.

    Based on looking at similar existing events in the various script.inc files, "SetMetatile" seemed to be the way this is done. I gave it a crack below:

    Spoiler: Script attempt


    This doesn't produce any errors when compiling - but it doesn't seem to update the metatiles on the map after the flag is set.

    Would appreciate any help at all! Thank you.

    Apologies if an explanation for this already exists. I've searched through the wiki, simple mods thread, and Team Aquas Hideout channel but can't seem to find anything. I might be searching for the wrong terms though.
    I tried your script and got this:
    [PokeCommunity.com] [Pokeemerald] Adding a secret door that is only revealed at a certain point in the story
    which leads me to believe that you either didn't set the flag, or set it in the same map without reentering the map to run the map script.

    Also, you don't need to use the DrawWholeMapView special when you use setmetatile in an ON_LOAD map script.
     
    I tried your script and got this:
    View attachment 173179
    which leads me to believe that you either didn't set the flag, or set it in the same map without reentering the map to run the map script.

    Also, you don't need to use the DrawWholeMapView special when you use setmetatile in an ON_LOAD map script.
    Thank you for taking the time to test it out and reply!

    I've set the flag a few different ways, entered and re-entered the building, started a new save file and made clean... Still no secret door lol.

    Kind of bewildered that it's worked for you and not for me using the exact same code hahaha
     
    Thank you for taking the time to test it out and reply!

    I've set the flag a few different ways, entered and re-entered the building, started a new save file and made clean... Still no secret door lol.

    Kind of bewildered that it's worked for you and not for me using the exact same code hahaha
    The problem could also be that the script isn't actually running in the map. Is the script really meant for the map I took a screenshot of? Because that map runs map scripts labeled as RustboroCity_DevonCorp_1F_MapScripts, not DevonFirstLevel_MapScripts.

    It could also be that your script file is not even compiled because it's in the wrong place or you don't have poryscript installed. You can check for such problems by adding an obvious error into the script and ensuring that you get a compiler error.
     
    The problem could also be that the script isn't actually running in the map. Is the script really meant for the map I took a screenshot of? Because that map runs map scripts labeled as RustboroCity_DevonCorp_1F_MapScripts, not DevonFirstLevel_MapScripts.

    It could also be that your script file is not even compiled because it's in the wrong place or you don't have poryscript installed. You can check for such problems by adding an obvious error into the script and ensuring that you get a compiler error.
    I think you were right in saying that the MapScript wasn't actually running in the map - thank you! I added some msgboxes to the Mapscript to check when it was running, and they never showed.

    Properly adding it to the existing list of Mapscripts seemed to stop the entire 1st floor of Devon from loading in at all - so I'm building my own map to add secret door Mapscripts to instead.

    I'm sure there's a way to make it all work but it's above my pay grade lol
     
    I think you were right in saying that the MapScript wasn't actually running in the map - thank you! I added some msgboxes to the Mapscript to check when it was running, and they never showed.

    Properly adding it to the existing list of Mapscripts seemed to stop the entire 1st floor of Devon from loading in at all - so I'm building my own map to add secret door Mapscripts to instead.

    I'm sure there's a way to make it all work but it's above my pay grade lol
    The msgbox command (and many others) don't work in ON_LOAD map scripts and cause the game to freeze, so they're not that useful for debugging map scripts. That's also probably why the map didn't load for you when you properly added the script to the map.
     
    Back
    Top