Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,921
First Language
English
I know it's already been said before but could you tweak the MOUSE CLICK tag so it works even if ALLOW MOUSE MOVEMENT is set to false? Thanks. :)
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.
 
Last edited by a moderator:

Internetakias

RPG Maker VX Ace Noob :P
Member
Joined
Aug 26, 2012
Messages
67
Reaction score
8
First Language
Greek
Primarily Uses
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.
Thanks but I'm getting a "stack level too deep" error now.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,921
First Language
English
Try this one. It doesn't assume you are replacing methods directly



Code:
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
 
Last edited by a moderator:

Internetakias

RPG Maker VX Ace Noob :P
Member
Joined
Aug 26, 2012
Messages
67
Reaction score
8
First Language
Greek
Primarily Uses
This one works but it also overrides the ALLOW_MOUSE_MOVEMENT = false setting, and thus allowing the character to move with the mouse.
 
Last edited by a moderator:

mbscout

Warper
Member
Joined
Mar 23, 2012
Messages
2
Reaction score
0
First Language
English
Primarily Uses
EDIT EDIT: A-HA! I can confirm that the issue whereby the 'target box' is 50% out of phase with your position is caused by a conflict with "Yanfly's Engine Ace - Ace Core Engine v1.09", and likely due to the increase in screen resolution when the screen is panning. I removed this script and everything works fine, shy of the issues with my doors, as above. I'm still hoping and wishing for some resolution to each, if that's anywhere close to possible.
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.

Edit:

I found were the problem was. The code was using a double for centering the screen on the player.

Just add this code to fix the compatibly problem with "Yanfly's Engine Ace - Ace Core Engine v1.09"



Code:
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
 
Last edited by a moderator:

Jet

Flying in a sky near you
Veteran
Joined
Mar 19, 2012
Messages
172
Reaction score
107
First Language
English
Primarily Uses
I have updated the mouse. These are the following changes:

  • Fixed the bug that made it so when the player couldn't move with the mouse, he could not start events with MOUSE CLICK in it.
  • Fixed the bug that special event mouse cursors did not changed based on the event page.
  • Added additional documentation on script-based mouse commands that can be used in events.
  • Added option to have the script check the 4 adjacent tiles around an impassable tile the player has clicked on for another path.
  • Some syntactical changes to speed up some sections.
 

Jet

Flying in a sky near you
Veteran
Joined
Mar 19, 2012
Messages
172
Reaction score
107
First Language
English
Primarily Uses
Another spectacular update my fellows:

  • Added diagonal movement
  • Sped up the pathfinding by a good bit
  • Fixed bug where the player would move if you clicked on him
  • Fixed the invalid byte sequence bug that would occur with certain characters in the game title

Hope you guys enjoy this.
 
Joined
Mar 14, 2012
Messages
12
Reaction score
1
First Language
English
Primarily Uses
Hey Jet. I wanna say I absolutely love the script. It's awesome. I'm having one bit of trouble though with the help text. When mousing over different items, weapons, skills, etc. in the various menus the help text in the help window doesn't update to show the description text for whatever I've moused over. So like I'll use the mouse to hover the cursor over different items in the inventory or skill menu and it'll only show the help text for the first item that the cursor was on before moving the mouse. So I end up having to use the arrow keys to move the cursor to different items to update the help window text. But just moving the cursor with the mouse doesn't update the help window. I hope that makes sense.

Also I'm having a bit of a compatibility issue with Yanfly's battle script with the enemy selection. His battle script doesn't use the menu box to select which enemy to attack but rather you select the enemy by using the arrow keys and it highlights which enemy is selected and has a text window at the top with the selected enemy's name. Well, the mouse script isn't able to change which enemy is selected. If there's any way you could fix these issues I'd be very grateful. Anyway, thanks for the great script.
 
Last edited by a moderator:

Cedric

Villager
Member
Joined
Oct 16, 2012
Messages
24
Reaction score
0
First Language
English
Primarily Uses
Hey, I sure like your script, but I feel like it needs one more feature to be perfect. It would be awesome if you made it possible to type "MOUSE CLICK <4> <common event 1>" in the Map Note box, and then clicking on a bare tile in region 4 would activate common event 1. What do you think?
 
Last edited by a moderator:

baka

Villager
Member
Joined
Jan 22, 2013
Messages
22
Reaction score
1
First Language
English
Primarily Uses
Thankyou so much Jet !

This has helped me a lot !
 

Guy

Villager
Member
Joined
May 27, 2012
Messages
16
Reaction score
1
First Language
English
Primarily Uses
Is there a way to allow a mouse over information on states?
If so... where do I begin.
 

GFatigue

Villager
Member
Joined
Apr 28, 2012
Messages
12
Reaction score
0
First Language
English
Primarily Uses
I am having two issues with the mouse if anyone would be willing to help me:

1. This is something that started happening in his updated script, I have an older version and it didn't use to do this. If you're trying to move with the keyboard, you have to let go of each directional key before you can press another, or else your character comes to a complete stop. (Example: Hold the up arrow, and if you want to make a left turn, you HAVE to release the up arrow before you press the left arrow or else you won't move at all).

2. If you try to change your party members in the formation window, and you have more than 4 members, you can't use the keyboard. The window and the cursor bugs up, and you HAVE to use the mouse. This is NOT isolated to just the Formation window.

This happens ANYTIME you have to scroll DOWN a window that you can't currently see (like if you have 20 items in a shop and you have to scroll down to see the full list of items, it bugs up there too) or if you're selecting an item in battle, or you have too many items to equip.

ANYTIME you have to scroll down to select additional items/skills/etc that are not currently being displayed on the window, the cursor bugs up when using the keyboard, and forces you to use the mouse.

If anyone can help me with these issues, that'd be amazing. Thanks all.
 

Jet

Flying in a sky near you
Veteran
Joined
Mar 19, 2012
Messages
172
Reaction score
107
First Language
English
Primarily Uses
I am having two issues with the mouse if anyone would be willing to help me:

1. This is something that started happening in his updated script, I have an older version and it didn't use to do this. If you're trying to move with the keyboard, you have to let go of each directional key before you can press another, or else your character comes to a complete stop. (Example: Hold the up arrow, and if you want to make a left turn, you HAVE to release the up arrow before you press the left arrow or else you won't move at all).

2. If you try to change your party members in the formation window, and you have more than 4 members, you can't use the keyboard. The window and the cursor bugs up, and you HAVE to use the mouse. This is NOT isolated to just the Formation window.

This happens ANYTIME you have to scroll DOWN a window that you can't currently see (like if you have 20 items in a shop and you have to scroll down to see the full list of items, it bugs up there too) or if you're selecting an item in battle, or you have too many items to equip.

ANYTIME you have to scroll down to select additional items/skills/etc that are not currently being displayed on the window, the cursor bugs up when using the keyboard, and forces you to use the mouse.

If anyone can help me with these issues, that'd be amazing. Thanks all.
I have updated the topic with a new version.

  • Fixed the stated #1 and #2 in quoted post
  • Fixed additional window issues with scrolling windows
 

GFatigue

Villager
Member
Joined
Apr 28, 2012
Messages
12
Reaction score
0
First Language
English
Primarily Uses
Would anyone know how to fix the issue with the mouse now updating the skill descriptions and item descriptions when scrolling through?

You have to use the arrow keys for the description box to update.

Anyone willing to help me fix that? I'd greatly appreciate it.
 

Jet

Flying in a sky near you
Veteran
Joined
Mar 19, 2012
Messages
172
Reaction score
107
First Language
English
Primarily Uses
Would anyone know how to fix the issue with the mouse now updating the skill descriptions and item descriptions when scrolling through?

You have to use the arrow keys for the description box to update.

Anyone willing to help me fix that? I'd greatly appreciate it.
This should be fixed, I have updated the topic with a link to the new script.
 

zeraf

Veteran
Veteran
Joined
Feb 22, 2013
Messages
209
Reaction score
26
First Language
English
Primarily Uses
When I tried it with Victor's animated battle script, I was unable to change targets. Also had some trouble selecting things in a shop that had no scripts involved in it. So mainly the stuff that involves horizontal movement in the choices.
 
Last edited by a moderator:

Jet

Flying in a sky near you
Veteran
Joined
Mar 19, 2012
Messages
172
Reaction score
107
First Language
English
Primarily Uses
So, I guess there was a bug with the mouse script that screwed everything up if you changed the resolution of the window.


Both pathfinding and the developer block would report the wrong position and all kinds of nonsense.


Point is, that's fixed. Also screenshots are back in the topic, I guess those broke too.


New link in the original post.


Edit: Also fixed apparent issue of mouse taking priority over keyboard in the save/load menu. Another new link has been posted.
 
Last edited by a moderator:

Theicelolli

Warper
Member
Joined
Oct 26, 2013
Messages
3
Reaction score
0
First Language
German
Primarily Uses
Dear Jet

First off your Script is amazing!

But i do not quite understand how to change the Cursor Image.I would like to have a different Cursor because the actual Cursor does not match the theme of my Game.
 

Latest Posts

Latest Profile Posts

I died aged 27 to cancer. Then I was reborn in a South-American state. I retained all memories and skill and had a goal from my previous life I needed to finish, but now I was just a 1-year-old girl capable of only smiling at others.

Dreams like this one make me glad I'm able to wake up from them at will.
Found a critical bug the other day with the time system that would have caused none of the NPCs to spawn. Since I use dev mode to test time-based stuff, I didn't catch this for way too long!
Last missing piece, a plugin to let weapons and armor be used as multiple equip types
What if the Actor Battlers disappeared when your selecting enemies...
ndyhHXV.gif
So, last chance to get RPG Maker Fes games?

Forum statistics

Threads
129,963
Messages
1,206,569
Members
171,183
Latest member
FinalGti
Top