- Joined
- Mar 2, 2012
- Messages
- 46,029
- Reaction score
- 16,837
- First Language
- English
- Primarily Uses
- RMMV
Super Simple Mouse System
Shaz
VersionsShaz
Current version: 1.10
Code:
1.0 6 Sept 2013 - Initial Release
1.02 7 Sept 2013 - Fixed game crash when loading a save file made prior to adding script
- Fixed player stuck on impassable tile error when clicking while dismounting the air ship vehicle
1.03 8 Sept 2013 - Fixed player moving to diagonal tile instead of adjacent tile when event is on a counter
1.04 10 Sept 2013 - Fixed vehicle pathfinding on world map
- Fixed event triggering when no path is found
1.05 14 Sept 2013 - Tweaked accessing of tilemap_offset
1.06 3 Nov 2013 - Disabled mouse control while player is waiting for an NPC move route (or for any non-parallel process event to finish)
- Fixed events not triggering after player reaches them
1.07 6 Nov 2013 - Slowed down mouse scrolling, and don't loop save files
1.08 24 Nov 2013 - Catered for YEA Core script where screen size can be larger than map size, and map is centered
- Fixed early event activation bug introduced in 1.06
- Replaced calculation of item boundaries in Windows_Selectable
- Added ability to enable/disable mouse
1.09 21 Dec 2013 - Fixed mouse re-enabled when a common event is called from an autorun or player triggered event
1.10 6 Apr 2014 - Added interaction for sprites higher than 32 pixels tall (now you can click on the top of the sprite)
- Activate an event without walking up to it (add a comment with <autoactivate> to the top of the event page)
- Cancel mouse path when guiding the player with arrow keys
- Menus ignore the position of the mouse when using the arrow keys
- Fix issue where player won't walk to the other side of a counter opposite shopkeepers
This is a complete overhaul and Ace conversion of the script originally written for XP by Near Fantastica and SephirothSpawn, heavily modified by Amaranth and used in all of the Aveyond games.
Features
- Custom mouse icons and text popups over events
- Pathfinding for player AND events
- Mouse control in menus and other windows
- Easy configuration options
Screenshots
Mouse Icons and Event Descriptions:

Even though it would take fewer steps to approach the shopkeeper on the left from below, the -2 0 in the comment tells the pathfinding script to move the player to the tile on the other side of the counter.
The shopkeeper on the right will be approached via the path that takes the fewest steps (from below) since there is no position override in the comment on that event.
The event's description (shown as text beside the icon) can be as many words as you like.

When you click on the top chest, the player will not open the chest while standing beside it, because of the cliff edge.
HOWEVER, if you used the keyboard instead of the mouse, pathfinding is overridden, and you WOULD be able to open the chest while standing on the tile to the right.
When you click on the Imp, the player will also walk up the steps to fight it.
HOWEVER, if the imp were set to Approach Player and Event Touch, it WOULD attack the player if the imp is on the hill and the player is below the hill on an adjacent tile.
Pathfinding and mouse processing do NOT override what the player can do via the keyboard, or what events are already programmed to do by the default scripts.
The mouse system is a series of 8 scripts (kept separate for ease of maintenance). Open the .rar file below, open each .rb file in a plain text editor, and copy and paste the scripts each into new slots in Materials. Most of the methods are aliased, so this can go below other custom scripts. ALL scripts should be used together.
Mouse Icons
- Add, change and remove icons through the ICON hash, just below the comments in the Mouse 1 - Sprite script.
- The hash key is the name (one word, alpha characters only, lower case), and the number value is the icon index in your System IconSet.
- DEFAULT_ICON must have the name of one of the keys in the hash. This is what your mouse cursor will look like when it's not over an event that sets a custom cursor.
Code:
ICON = {'arrow' => 386, 'talk' => 4, 'look' => 3, 'fight' => 116, 'touch' => 491, 'exit' => 121}DEFAULT_ICON = 'arrow'
Event Icons and Descriptions
Add comments to your event pages in the following format to control mouse and pathfinding behaviour:
Code:
<mouse icon x y name>
- icon is the name of the icon to show when the mouse is moved over the event. This must exist in the ICON hash.
- x y is an optional addition, to force the pathfinding to move the player to an offset from the current event.
- name is an optional description that will be shown beside the mouse icon. It may be one or more words.
- <mouse fight> will show the 'fight' icon when the mouse is over the event
- <mouse look 0 1> will show the 'look' icon when the mouse is over the event, and will make the player walk to the tile below the event before the event is triggered (good for signs, mailboxes, etc, where you want the player to stand below the event and face up)
- <mouse talk 0 2 Shopkeeper> will show the name Shopkeeper and a 'talk' icon when the mouse is over the event, and when clicked, will move the player to the tile two below the event (good for shopkeepers where there is a counter between the event and the player)
- <mouse talk Nasty Girl> will show the text Nasty Girl along with a 'talk' icon when the mouse is over the event
- To make the player, or an event, walk to a particular tile, without having to check where they currently are and adding lots of directional moves, simply add a Move Route command, choose Script, and enter find_path(x, y).
- The script will ATTEMPT to find a path to that tile (or an adjacent tile if the original one is impassable).
- If a path is not found, no movement will occur.
- If a path is found, the player or event will start following the path. But if, after starting to follow the path, an obstacle moves in its way and blocks the path, the player or event will only walk as far as the obstacle.
- Adding Wait to the move route WILL NOT make the event wait until the path has been followed. Only until the path has been determined. If you want to pause processing until the player or event has reached the destination, you will need to do that separately (keeping in mind that the player/event may not actually reach the destination).
- Any Set Move Route on the player or event while they are following a path will cause them to stop following the path and obey the new move route, even if there are no actual movement commands.
The mouse is enabled by default. If you want to change this, use a Call Script command that passes a true (enabled) or false (disabled) value to the mouse:
Code:
$mouse.enabled = false
Script
Get it here
Patches & Compatibility
Engr. Adiktuzmiko wrote a script that lets you save the enabled/disabled state.
You can find it here.
lordosthyvel has also made a patch for this script that allows diagonal movement.
You can find it here.
Magno has made a patch that fixes a problem in widescreen resolution when using Tsukihime's Unlimited Resolution script.
You can find it here.
Known Bugs
This does not work on maps that have horizontal or vertical looping (in Map Properties).
F12 causes the game to crash. I do not intend to address this, as F12 is not the standard or recommended way of starting a new game.
Script crashes if game title has non-Latin characters
FAQ
Q: Is this compatible with other scripts?
A: It is compatible with RTP scripts. It SHOULD be compatible with most other scripts, with the exception of those that do their own things with player/event collision (like pixel movement scripts) and possibly custom windows that don't behave like Window_Selectable. I don't know if the mouse scripts will work with those or not, but I do NOT plan to make mods to this script to make it compatible with any non-RTP scripts.
Credit and Thanks
- Shaz, Near Fantastica, SephirothSpawn, Amaranth Games
- lordosthyvel, for his diagonal movement patch
Author's Notes
- Okay for use in free and commercial games. Credit must be given.
- Do NOT repost this script on other sites. Please provide a link here instead. I will NOT be going to other sites to give support for this script.
- Post any issues in this thread. I will attempt to fix any bugs with this script, when used with the RTP scripts. I will not attempt to fix bugs that are caused by using the mouse script with other custom scripts.
- I do not recommend you use the find_path method on many events at a time (especially if they are likely to cross paths), or to make them walk long distances.
Last edited: