đź’Ž PREMIUM: Rstick mouse - HD Photos!
- View all by TamschiTamschi
- Follow TamschiFollowFollowing TamschiFollowing
- Add To CollectionCollection
- Comments
- Devlog
R-Stick Mouse MV + MZ
A downloadable RPG Maker Plugin
This plugin is available for free because it was commissioned by Phanicom. Thank you!
This plugin simulates mouse input (movement and left mouse button) using input from the right control-stick and a configurable button on gamepads.
By default, the player can adjust the speed of the virtual cursor and R-stick deadzone in the Options menu, in addition to the defaults set in this plugin's Parameters.
Drag-and-drop-style interactions are fully supported!
Before deploying for Linux on Windows, you must update MV's NW.js runtime.
Hints
If the controller pressing the "mouse button" is disconnected, the "click" effectively continues until changed. It can be released by reconnecting a controller without the button held into the same player slot, clicking the button on another controller, or simply by clicking the mouse.
This matches RPG Maker's default controller input behaviour.
Load Order
This plugin must be loaded after the following plugins, if present:
- Alpha_ABSZ
- DK_Mouse_System
- EliMZ_Book
- Mimosa_MouseCursor / Mimosa_MouseCursorPlus
- MRP_CameraMouseMove
- YEP_BattleEngineCore
This plugin must be loaded before the following plugins, if present:
- TS_Live_Menu_and_Pause
There appears to be a partial incompatibility between Mimosa_MouseCursor and DK_Mouse_System that can make the native mouse cursor appear erroneously. If this happens, please disable either of these two plugins or look for a compatibility patch.
Plugin Commands
PointAt (MV) / Point at (MZ)
Enables and moves the virtual cursor to the specified coordinates, potentially activating hover controls at the destination.
The PointAt command expects two integers for the x- and y-coordinate in canvas space, respectively, as offsets from the top-left canvas corner.
(Normally, these are game pixels.)
Save Contents
This plugin creates an additional top-level key TSC_RStick_Mouse in the configuration save file.
Compatibility Notes
This plugin should generally be loaded after any other plugins that receive mouse input. Additionally, as it hides/shows the native mouse cursor and a virtual cursor and there is no standard interface for this in RPG Maker, other cursor plugins likely won't be compatible unless specifically supported here.
(Check "Load Order" to see if a specific cursor plugin is compatible. If it's not listed there, or if there's another compatibility issue, you can message me and I'll see if it's an easy fix.)
This plugin was tested in RPG Maker MV 1.6.3 and RPG Maker MZ 1.8.0, uses only the public RPG Maker API as far as possible, and does not use any platform-specific APIs.
This plugin should be compatible with any deployment target available for RPG Maker MV and MZ, including web and most custom ones.
This plugin is compatible with VisuMZ_0_CoreEngine and VisuMZ_1_BattleCore.
License
This plugin is available under the MIT License. Please see the plugin file for details.
| Status | Released |
| Category | Assets |
| Author | Tamschi |
| Made with | RPG Maker |
| Tags | Controller, cursor, gamepad, input, mouse, No AI, rmmz, RPG Maker, RPG Maker MZ |
| Code license | MIT License |
| Average session | A few seconds |
| Languages | English |
| Inputs | Gamepad (any) |
| Accessibility | Configurable controls, One button |
| Links | Imprint / Impressum, Support |
Download
Click download now to get access to the following files:
Development log
- Ver. 1.1.3: MV-compatibility, Fixes and RevisionsMay 20, 2024
- Ver. 1.0.2: Don't stop or hide in menusMay 17, 2024
- Ver. 1.0.1: VisuMZ-compatibilityMay 17, 2024
- Ver. 1.0.0May 16, 2024
Comments
Log in with itch.io to leave a comment.
love it. the mouse movement works but some other plugin I have must be causing incompatibility with the left mouse click feature. I tried it in a new project and it works fine, but in my project with many other plugins the left mouse click doesn't work. It's difficult to narrow down the incompatibility source, any ideas? thanks a lot
Try to deactivate just half of the other plugins.
If that “fixes” it then re-enable just half of those, otherwise disable just the other half. Continue narrowing it down until you’ve found an incompatibility, then see if it works with just that disabled. (Otherwise there are probably multiple incompatible plugins.)
You could also attach a screenshot of the plugin list you’re using and I can make some guesses. If you know a bit of JavaScript, you can also do a global search for
TouchInputin your project to see which other plugins manipulate it.Is there a way or tips to make this mouse cursor controllable with keyboard arrows when a switch is turned on?
Thanks in advance!
I don’t have specific support for that right now, but you can edit
new_pollGamepadsto add this feature:Directly above
dx = dx * speed;, add the following:This is untested, but I’m confident it’ll work.
(Flipping a sign here or there may be necessary.)
Note that this will use the main directional input to move the cursor, which means the L-stick and D-pad should also work. If you’d like the input to be distinct, I recommend (dynamically, if there’s a collision) binding a custom intent in
Input.keyMapperand checking for that in the snippet above instead.After modifying your edit a bit. It achieves what I want. Your original edit has the error of null value (somehow). I'll just share my edit.
if (Input.isPressed('left') && $gameSwitches.value(n)) dx -= 1; if (Input.isPressed('right') && $gameSwitches.value(n)) dx += 1; if (Input.isPressed('up') && $gameSwitches.value(n)) dy -= 1; if (Input.isPressed('down')&& $gameSwitches.value(n)) dy += 1;
Not exactly a pretty code, but it works. Thanks for your help.
Oh, most likely it gets called before the game state is initialised. I updated it with a more reliable fix for that.
You may also want to check that the current scene isn’t a menu, if the player can open one while the Switch is ON.
Edit: Typos.
Yea I noticed that. Thanks for your help!
Sorry for another question. I hope you don't mind it.
Can you show me the function that show the cursor? I tried to find it and use the said function when a switch is on.
Thanks in advance.
You can activate it at any time with a(n e.g. “Script” Command) call to
TSC_RStick_Mouse.startVirtualInput(). It’s fine to call this every frame.Similarly,
TSC_RStick_Mouse.endVirtualInput()will hide the virtual cursor on the next sprite update, and it’s fine to call that every frame too.Thanks for your reply, appreciate it!
So update, me and a friend ended up fixing the code. Problem is the code does not make picture common events selectable. We are further investigating and will update the plugin. I will keep you updated!
Hm… for what it’s worth, this shouldn’t need specific support for anything other than cursor-change plugins.
TouchInputlike the engine does, or hooks functions other than the ones below, it should work regardless of load order.TouchInput._onMouseDownand/orTouchInput._onMouseUp, then load this plugin after the other one.Though, some plugins do indeed use custom mouse event handlers, which means they won’t see the ones this plugin here generates.
Since the VisuStella team updated their plugin (https://itch.io/post/12238393), please try again with the updated version to see if it’s compatible.
So I tried your plugin with the updated picture common events, still same issue. Tried my friend's code fix, works fine. So maybe you need to see the code to see what changes were made. Picture common events no longer crashes, but it seems not to work with your plugin in the sense of using picture common event menus. Feel free to reach out for more info or a contact so I can show you the code.
Best,
Ragnarok Aesthetic
Sure, though it seems you don’t have published contact details I can use. (Your website has expired.)
You can find my up-to-date contact information here: https://itch.io/blog/480852/tamschis-support-contact-information-inquiries
Note that I won’t look at the edited code without explicit permission to implement the fix on my end, just for legal safety.
Edit: I think the easiest option would be to send the edited plugin via email.
Won't let me send via gmail, such a headache but I did send a request on discord if you want me to send it there for you.
Just as public follow-up, there were no functional edits in the modified version.
There were global functions added to revert/restore the overall input mapping, but this is already available via the API by manipulating
Input.gamepadMapper[TSC_RStick_Mouse.parameters.leftClickButton](withTSC_RStick_Mouse.INTENT_MOUSE_LEFTas value that enables the mapping). You can also disable the initial mapping in the plugin settings.I generally recommend using the API rather than editing plugins in order to make updating them easier.
Unfortunately I get the following error message when I press the right mouse button or the menu key:
"Unexpected token u in JSON at position 0"
I use RPG Maker MZ.
What I noticed is that the parameters say: "Virtual Cursor" and then "RStick_Cursor" - but I don't have this image file. But I think that has nothing to do with the error...
What do I wrong?
Ah, I forgot to include it in the latest version. There seems to be a delay with build processing in itch.io, so here’s the correct file (which you should save as img/pictures/RStick_Cursor.png):
That doesn’t explain the error you’re seeing, though. Do you have a stack trace? Maybe there’s an incompatibility with another plugin.
Thanks for the quick answer and the .png! I have now found out that the “VisuStella Picture Common Events” plugin is responsible (as can be seen in the details in the screenshot). At least when I run it with your plugin. I've added the error message from the DevTool for you:
"FOSSIL.js:7898 FOSSIL is now running as main.
VM143:12 Static PreFixes are here
VM870:803 finalFixes Here
DevTools failed to load SourceMap: Could not load content for chrome-extension://njgcanhfjdabfmnlmpmdedalocpafnhl/js/libs/pixi.js.map: System error: net::ERR_FILE_NOT_FOUND
rmmz_managers.js:2036 SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse (<anonymous>)
at Function.JsonEx.parse (rmmz_core.js:6445)
at Function.JsonEx.makeDeepCopy (rmmz_core.js:6455)
at Game_System.<computed> [as createPictureCommonEventData] (VisuMZ_4_PictureCmnEvts.js:1368)
at Game_System.<computed>.<computed> [as pictureCommonEventData] (VisuMZ_4_PictureCmnEvts.js:1368)
at Game_System.<computed> [as pictureCommonEvent] (VisuMZ_4_PictureCmnEvts.js:1368)
at Sprite_Cursor.Sprite_Picture.<computed>.<computed> [as isClickEnabled] (VisuMZ_4_PictureCmnEvts.js:1368)
at Sprite_Cursor.Sprite_Clickable.processTouch (rmmz_sprites.js:29)
at Sprite_Cursor.Sprite_Clickable.update (rmmz_sprites.js:25)
at Sprite_Cursor.Sprite_Picture.update (rmmz_sprites.js:2906)
SceneManager.catchNormalError @ rmmz_managers.js:2036
SceneManager.<computed> @ VisuMZ_0_CoreEngine.js:9423
SceneManager.update @ rmmz_managers.js:1945
Graphics._onTick @ rmmz_core.js:811
TickerListener.emit @ pixi.js:9093
Ticker.update @ pixi.js:9548
Ticker._tick @ pixi.js:9298
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301"
Can you please take a look at it, maybe you can find something out?
Thanks. I know roughly why this happens:
Sprite_Cursoris aSprite_Pictureso that Dynamic Pictures can be used to make it dynamic. It seems that VisuStella Picture Common Events assumesSprite_Pictureappears only under specific circumstances and/or never has apictureIdof0. (I chose that ID specifically to avoid interference with other plugins, since for example in this case any other would risk turning the cursor into a button.)Normally this would be easy to figure out and patch, but there are two reasons I don’t provide further support in this case:
The plugin is not publicly available. I can’t efficiently debug something I don’t have access to.
Their Terms of Use also explicitly forbid you from sharing it with me, as it has to be repurchased for each developer who works with it separately.
(It’s fine to (privately) share my plugins within your team freely. I only care about how many entities publish games with them.)
Second, as you can tell by the
<computed>in the stack trace, VisuMZ plugins are obfuscated. That makes it, mildly put, difficult and/or cumbersome for other plugin creators to ensure compatibility.(I guess I care too much about providing a good product to do that. The obfuscation also hurts performance of the finished game.)
You’ll have to ask Team VisuStella about it. For what it’s worth, fixing it (assuming it’s the only incompatibility) shouldn’t take them more than ten minutes or so and would improve compatibility of their plugin in general, not just with R-Stick Mouse.
Hey Tamschi,
thank you for your detailed answer and that you took the time to explain the problem more precisely. I really appreciate that!
I have now contacted the VisuStella team and hope that they can do something to solve the problem.
Thanks again for your effort!
Best regards!
For what it’s worth, the build with the PNG included is also live now, since about an hour ago. It says “0.1.3” as version because I mistakenly left the “0” in place from another command yesterday.
I was able to push it with the correct version number just now, so that should update eventually. Edit: Quicker than expected.
I called this one “1.1.3+cursor-image” to distinguish it, but I’ll most likely use plain version numbers for future versions again.
Hi Jeff,
Me and a friend found a fix for this we are editing the code, it is almost complete to select vizu pic common events, hang tight I will send to the creator when we perfect it so others can use.
Amazing, I've been looking for R stick compatibility for MV forever thank you