• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

How to make Gym Puzzle Scripts? (FL/Emerald)

Crocky

SuperScarlet!
97
Posts
15
Years
    • Seen Jul 23, 2020
    Hi! I want to recreate the gym puzzle shown in sword and shield's demo (https://youtu.be/-PI22Jjc8pg?t=161) in GBA form, where interacting with signposts changes waterfalls. What kind of script would I need to use to change the map? Examples would be highly appreciated.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • You'll want to use the setmaptile command which can change the tile at a chosen X-Y coordinate on the map. You can change the tile to antyhing in that's map's two tilesets. You can also determine whether the player is able to pass over the tile by placing either 0x0 (passable) or 0x1 (impassable) at the end of the command. For example, 'setmaptile 0x3 0xA 0x10A 0x1' will change the tile at coordinate 0x3, 0xA to tile number 0x10A which is impassable (0x1). Here's a quick and dirty script that utilizes the setmaptile command in a fashion similar to your video:

    Code:
    #dynamic 0x9C0B20
    
    #org @start
    checkflag 0x11
    if 0x1 goto @RemoveWaterfall
    setmaptile 0xXX 0xYY 0xZZZZ 0x1 // Makes tile impassable
    special 0x91 // Refreshes map
    setflag 0x11
    msgbox @Button 0x6
    end
    
    #org @RemoveWaterfall
    setmaptile 0xXX 0xYY 0xZZZZ 0x0 // Makes tile passable
    special 0x91 // Refreshes map
    clearflag 0x11
    msgbox @Button 0x6
    end
    
    #org @Button
    = You pressed the button!

    The flag used to check whether the waterfall is on or not is temporary, meaning that it will be reset upon leaving the map like Cut trees or Rock Smash boulders so you don't have to do any finagling of flags every time you leave the area.
     

    Crocky

    SuperScarlet!
    97
    Posts
    15
    Years
    • Seen Jul 23, 2020
    Thank you so much, that is exactly what I needed! I'll try that out in a little bit!
     
    Back
    Top