• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll 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.

[Map] Setting up a Warp

  • 2
    Posts
    4
    Years
    • Seen Jun 30, 2021
    Hey everyone! I want to start off by saying I appreciate the community it has helped a lot in working on my first project. Question time. Hopefully, I haven't missed it yet but I am trying to retool the upper rooms in the poke centers to be kinda like hotel rooms like in the anime.
    I have edited the actual map itself but I am running into the issue that I cannot get the warps to look the same. I assume this has something to do with online features since that was the og programming of the warps.
    Ideally, I want the warps to lead to the map 0.1 from the center which they are programmed to do by default but then when you leave 0.1 to return to the same map bank you left from. Right now it keeps returning to the same center no matter where you enter. The original warp coordinates are bank 127 warp 127 map 127

    Is this possible or do I have to make a new map for every center?

    I am using advance map.
     
    Last edited:
    Anon's solution could work, or else you could use a script tile with warp commands inside it instead of an actual warp tile on the upper floor. The script tile would check the value of a variable and run the warp command with the appropriate destination based on that variable. The variable itself would be set whenever you enter the bottom floor of a pokecenter. Let me know if you want that explained in more detail
     
    That would be interesting. Right now I am using XSE but I can't get it to save changes so I had put it off until I had finished map building. How would that work?
     
    That would be interesting. Right now I am using XSE but I can't get it to save changes so I had put it off until I had finished map building. How would that work?

    Well I would say it's a slightly more advanced script set up for a beginner, so you should probably hold off on stuff like this until you get the basics of scripting down, including how to get xse to "save". (Try to learn what compiling and decompiling to and from offsets really does!) Until you get that, the trial and error of scripts like these would become very messy.

    That being said, this is the script I was talking about:
    We're using variable 4070 (it can be any variable you want) as a way to track what pokecenter the player last visited.
    This would go in the script tile on the top floor:
    Code:
    #org @checker
    compare 0x4070 0x0 '(Checks that variable 4070 is 0. I just used a random variable here, make sure you look up safe variables to use in your game!) 
    if 0x1 goto @0             '(If yes, we go to the @0 part of the script)
    compare 0x4070 0x1 '(Else checks that variable 4070 is 1)
    if 0x1 goto @1             '(If yes, we go to the @1 part of the script)
    compare 0x4070 0x2 '(Else checks that variable 4070 is 2)
    if 0x1 goto @2             '(Repeat for as many times as you need)
    [etc]
    end
    
    #org @0
    warp 0x0 0x1 0x3 '(A simple warp command - takes the payer to map 0.1, warp number 3. In your case, you would change this to the desired pokecenter floor. 
                                 '(Let's pretend this is the Viridian pokecenter)
    end
    
    #org @1
    warp 0x1 0x1 0x3 '(Another warp command - this time warping to a completely different map (1.1) or in other words, a different pokecenter. 
                                 '(Let's call this the Pewter center)
    end
    
    #org @2
    warp 0x2 0x1 0x3 '(Keep writing warp commands for as many destinations as are needed in your game)
    end

    Simplified the explanations, but hopefully you understand the gist of running a different warp command based on a variable value check. But how do we make sure the variable is at the right value we need every time?
    Code:
    #org @set0
    setvar 0x4070 0x0
    end
    That is a setvar script. Simply put, it sets the variable we're using (4070) to 0, permanently, until we change it again. You need to run a script like that every time a player enters a pokecenter. The best way to do that would be in a level script, which you should look up. If we enter a pokecenter in Viridian, we set the variable to 0. Therefore, the warp command we run in the top floor's script will lead us to the Viridian destination. However, if the player leaves and then enters a Pewter pokecenter, we should immediately run a different setvar script there that sets 0x4070 to 0x1. Now that the value is 1, the top floor script will lead to the Pewter destination.

    Hopefully that was clear enough to understand, but if it wasn't, I'd be more than happy to try and explain better. Either way, this is usually the type of setup I go for when I need to control warp destinations like you do :)
    Happy hacking

    As Anon said, you could also use a setwarpplace command, which would be more efficient and arguably easier, but the method I outlined is also a great way to learn to utilize variables :)
     
    Last edited:
    Back
    Top