Idk, I searched the function "name", it doesn't exist for Game_Event which actually the error makes sense. Why not do this.
Code:
if Input.dir4 > 0
jump_events = $game_map.events.values.select { |event|
event.instance_variable_get("@event").name =~ /<jump>/
}
x1 = $game_player.x
y1 = $game_player.y
direction = Input.dir4
x_mod = direction == 4 ? -2 : direction == 6 ? 2 : 0
y_mod = direction == 8 ? -2 : direction == 2 ? 2 : 0
x2 = $game_player.x + x_mod
y2 = $game_player.y + y_mod
event_under_player = $game_map.events_xy(x1, y1).any? {|event|
jump_events.include?(event) }
event_in_direction = $game_map.events_xy(x2, y2).any? {|event|
jump_events.include?(event) }
if event_under_player && event_in_direction
$game_player.jump(x_mod, y_mod)
end
end
EDIT:
Now I tried to make this out of boredom by pure eventing. And this is actually easier than you probably guys thought.
Here is my test case
Here is the important aspect you need to know
Result?
Edit2:
Uh, this post made into page 2. I hope people who read this would bother to read the second page.