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.