• 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!
  • 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] Checking if player is inside or outside for fly (Firered)

  • 1
    Posts
    2
    Years
    • Seen May 3, 2023
    I'm trying to create an item that replaces fly in the overworld. Using callasm 0x80C4EF9 in XSE, I can bring up the fly map and it works correctly except for one thing - the player is allowed to fly while inside.
    I can't find any info on this. I've googled every combination of words I could think of.
    I see in advance map that each map has a type in the header such as inside, underground, city etc. So if there's a way to check that in a script it should be pretty easy I would think.

    Thanks for any help, I've figure out 99% of what I need to do for my hack mostly because of this website.
     
    I'm trying to create an item that replaces fly in the overworld. Using callasm 0x80C4EF9 in XSE, I can bring up the fly map and it works correctly except for one thing - the player is allowed to fly while inside.
    I can't find any info on this. I've googled every combination of words I could think of.
    I see in advance map that each map has a type in the header such as inside, underground, city etc. So if there's a way to check that in a script it should be pretty easy I would think.

    Thanks for any help, I've figure out 99% of what I need to do for my hack mostly because of this website.

    SetUpFieldMove_Fly is the function the game uses to determine if you can fly. You could call it from your ASM or C code.
    The scripting engine itself doesn't have a convenient way to check whether you can fly, other than reading gMapHeader with one of the farbyte commands.
     
    Back
    Top