Hey, everyone. I've been trying to fix my visible encounters system in VX Ace and gotten this code:
class Game_Player # --------------------------------------------------------------------------- # Overwrite check event trigger there # --------------------------------------------------------------------------- def check_event_trigger_there(triggers) x2 = $game_map.round_x_with_direction(@x, @direction) y2 = $game_map.round_y_with_direction(@y, @direction) @ignore_char = true start_map_event(x2, y2, triggers, true) if passable?(x,y,@direction) @ignore_char = false return if $game_map.any_event_starting? return unless $game_map.counter?(x2, y2) x3 = $game_map.round_x_with_direction(x2, @direction) y3 = $game_map.round_y_with_direction(y2, @direction) start_map_event(x3, y3, triggers, true) end alias theo_evtrigger_collide_chars? collide_with_characters? def collide_with_characters?(x ,y) return false if @ignore_char theo_evtrigger_collide_chars?(x,y) end endBasically, what this does is to stop a player from accessing an event through tiles that are impassable, so that if, for example, a treasure chest is at the top of a cliff and the player can walk on a lower area to get to the tile to the left of it, that treasure chest cannot be opened.
On the other hand, when an event triggered by Event Touch tries to approach the player, it ignores this check and can activate regardless. Since I'm using a visible encounters system and make heavy use of multi-layered paths on my maps, it's a major problem when enemies can attack players from other levels of the area. Keep in mind that none of the events involved have Through enabled--where they are allowed to walk is limited as normal. I found this bug in my game and recreated it in a completely new project using the same script as above.