• 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?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • 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...
  • 125
    Posts
    11
    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