• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

Check if trainer is inside or outside

Aljen

The Lost Boy...
  • 123
    Posts
    12
    Years
    I want to activate different switches depend on the player is inside or outside ~^^~. Can someone help me? Thanks
     
    Thank you meji, i will give it a look
     
    i still cant find it T^T
     
    i still cant find it T^T

    I don't know if you need to check this in an event or you want to make a script, but here's what I'm using to check if the player is outside.

    Code:
    def isOutside? # Only refresh when it's indoor
      isoutdoor=pbGetMetadata($game_map.map_id,MetadataOutdoor)
      if $game_map && (!isoutdoor or isoutdoor==false)
          return false
      end
      return true
    end

    So, if you want to check if the player is indoor in an event just create a conditional branch and check isOutside?
     
    Thanks Klein, but I'm still a little confuse..
    You mean this?
    Code:
    Conditional Branch: Script: isOutside=true
     
    I don't know if you need to check this in an event or you want to make a script, but here's what I'm using to check if the player is outside.

    Code:
    def isOutside? # Only refresh when it's indoor
      isoutdoor=pbGetMetadata($game_map.map_id,MetadataOutdoor)
      if $game_map && (!isoutdoor or isoutdoor==false)
          return false
      end
      return true
    end

    So, if you want to check if the player is indoor in an event just create a conditional branch and check isOutside?
    Works perfectly, my master.
     
    Thanks Klein, but I'm still a little confuse..
    You mean this?
    Code:
    Conditional Branch: Script: isOutside=true

    Just "isOutside?":

    [PokeCommunity.com] Check if trainer is inside or outside


    If you want to check if it's inside just add "!" before: "!isOutside?"
     
    Ahhh, now it work. Thank you Klein ~^^~. Thanks guys
     
    Thanks Klein, but I'm still a little confuse..
    You mean this?
    Code:
    Conditional Branch: Script: isOutside=true

    Your thought process here is correct, but = is used for setting, == is for testing ("This equals that" vs "Does this equal that?").

    Since this method returns a boolean (true/false), the "==true" is redudant because "true==true" is true, and "false==true" is false.
     
    I see, thank you ~^^~
     
    Back
    Top