RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX]Check for Player in Area[SOLVED]

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 75
What the...?
I want to cause some things to happen if a player steps foot in an area.
This is the part of the script I've placed to check it, by calling the $game_player.in_area? method:

Code: [Select]
  def check_landmark_finding
    for area in $data_areas.values
      lmk = LANDMARKS.keys
      for i in lmk
        if $game_player.in_area?(i.id2name)
          unless $game_iwm.landmarks_found.include?(i)
            RPG::ME.new(LANDMARKS[i][5], 80, 100).play
            @found_window = Window_Found.new(LANDMARKS[i][1])
            @Graphics.wait = FOUND_DURATION
            @found_window.dispose
            $game_iwm.landmarks_found.push(i)
          end
        end
      end
    end
  end

This is the LANDMARK constant hash from which the 'lmk' local variable pulls its information:

Code: [Select]
  LANDMARKS = {
 
  1 => [77, "Smalltown", 117, 154, 90, "Gameover"],
  2 => [105, "LittleBay Lighthouse", 141, 154, 91, "Mystery", ],
  3 => [65, "CosbyCave", 165, 178, 92, "Item"],
 
  }

The 'landmarks_found' is a public variable in a custom global class.  When a location is found, the id (or key) from the constant hash is supposed to be 'pushed' into the array.  Therefor, I the 'unless' line is used to say, only do this once; if the landmark has already been found, don't do these things.

Anyway, I can't get the script to run properly.  I enter the area and nothing occurs. 

If you need more insight as to the specifics of the custom class or would like a full copy of the script as it stands right now, I'd be happy to oblige.  Thanks for any help you can give me.
« Last Edit: September 08, 2012, 04:23:49 PM by IXFURU »