• 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.

Check if trainer is inside or outside

Aljen

The Lost Boy...
125
Posts
10
Years
  • I want to activate different switches depend on the player is inside or outside ~^^~. Can someone help me? Thanks
     
    52
    Posts
    8
    Years
  • 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?
     
    91
    Posts
    14
    Years
    • Seen Sep 5, 2015
    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.
     
    52
    Posts
    8
    Years
  • Thanks Klein, but I'm still a little confuse..
    You mean this?
    Code:
    Conditional Branch: Script: isOutside=true

    Just "isOutside?":

    pE24nb1.png


    If you want to check if it's inside just add "!" before: "!isOutside?"
     
    1,224
    Posts
    10
    Years
  • 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.
     
    Back
    Top