Notice: fwrite(): Write of 483 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 1714 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - [VX]Check for Player in Area[SOLVED]

The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: IXFURU on September 03, 2012, 05:48:37 PM

Title: [VX]Check for Player in Area[SOLVED]
Post by: IXFURU on September 03, 2012, 05:48:37 PM
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:

  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:

  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.