• 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.
  • There is an important update regarding account security and 2FA. Please 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.
  • Imgur has blocked certain regions from viewing any images uploaded to their site. If you use Imgur, please consider replacing any image links/embeds you may have on PokéCommunity so everyone can see your images. Click here to learn more.

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