You can add the script I added, which separates movement from event checks.
But it's not tested thoroughly and I expect some things to not work as expected.
You can add the script I added, which separates movement from event checks.
Thanks but I'm getting a "stack level too deep" error now.
class Scene_Map
def update(*args, &block)
jet3745_update
check_event_trigger
check_mouse_movement if $game_system.mouse_movement
check_mouse_icon_change
end
# moved here
def check_event_trigger
$game_temp.mouse_character ||= $game_player
if Mouse.click?(1)
dont_move = false
x, y = *Mouse.true_grid
($game_map.events_xy(x, y) + $game_map.vehicles).each {|event|
if event.is_a?(Game_Vehicle)
if (event.x - mouse_char.x).abs + (event.y - mouse_char.y).abs == 1
if [event.x, event.y] == Mouse.true_grid
mouse_char.get_on_vehicle_mouse(event)
dont_move = true
end
end
elsif !!!mouse_char.vehicle
if event.mouse_activated?
event.start
dont_move = true
elsif (event.x - mouse_char.x).abs + (event.y - mouse_char.y).abs == 1
if event.is_a?(Game_Vehicle)
mouse_char.get_on_vehicle_mouse(event)
dont_move = true
else
if !event.mouse_empty? && [0, 1, 2].include?(event.trigger)
mouse_char.turn_toward_character(event)
event.start
dont_move = true
end
end
else
{UP: [0, -1], DOWN: [0, 1], LEFT: [-1, 0], RIGHT: [1, 0]}.each {|d, a|
if event.check_for_comment(/MOUSE[ ]*MOVE[ ]*#{d.to_s}/i)
x += a[0]; y += a[1]
end
}
end
end
}
mouse_char.mouse_path(x, y) unless dont_move
end
end
def check_mouse_movement
$game_temp.mouse_character ||= $game_player
if Mouse.click?(1)
# separated into its own method
x, y = *Mouse.true_grid
mouse_char.mouse_path(x, y)
end
end
end
Yay, it's working now. Thanks for the fix!
While trying to get "Yanfly's Engine Ace - Ace Core Engine v1.09" and "Jet's Mouse System" to work together, a thought came to me. I noticed the default tiles on a screen is 17x13. When using Engine Ace - Ace Core Engine to change the resolution to 20x15 tiles per screen(tps)/640x480px, the 'target box' is 50% out of phase. But if the resolution is changed to 19x15(tps)/608x480px the mouse script works normally. So for what ever reason, odd numbers are needed for the resolution for both scrips to work together.
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * X Coordinate of Screen Center
#--------------------------------------------------------------------------
def center_x
(Graphics.width / 32 - 1) / 2 #was 2.0
end
#--------------------------------------------------------------------------
# * Y Coordinate of Screen Center
#--------------------------------------------------------------------------
def center_y
(Graphics.height / 32 - 1) / 2 #was 2.0
end
end
I have updated the topic with a new version.
This should be fixed, I have updated the topic with a link to the new script.
Original thread: https://forums.rpgmakerweb.com/threads/mouse-system.3065/