Ready to Rumble: A Plugin for Controller Vibration

Ready to Rumble version 2.6

Created by ZeroBreak with consultation from OS87 and Waterguy. Credit ZeroBreak in any released games. Free to use under the terms of the MIT license.

About the plugin
A lot of games these days offer a rumble mode that activates in response to certain game events (an explosion set off during a major plot twist, getting knocked out during a fight, or simply taking a hard fall to the ground) and this plugin has been designed to bring that experience to RPG Maker.

Release history:
v1.0: Initial RTM
v1.1: Unanticipated bugfix
v1.2: Added control switch assignment to change rumble mode status
v1.3: Small change to accommodate the possibility of a crash when a gamepad is disconnected. Also set the maximum supported values to eliminate possibility of the effect not working if set too high or too low.
v1.4: Replaces control switch with option menu function, and directs the effect to the most recenty-used gamepad. A very special thanks to YoraeRasante for this update.
v1.5: Added verification to detect the availability of a supported gamepad. As of this update, the functions will not be available if gamepad detection fails.
v1.6: Changed to a commercial, non-redistribution license.
v2.0: Added code and instructions for the Universal Windows interface, as well as for mobile device rumble. Additionally, the commercial license now uses a "pay your way" model; you can download without charge from any of my authorized storefronts, or pay as you believe the plugin is worth.
v2.1: Changed the plugin status to an MZ plugin due to compatibility verification. Also changed the mobile device rumble detection method due to unexpected issues with the prior method. You can still use the plugin with MV through special procedures.
v2.2: Changed the order of the verifications so that the status of the rumble setting is more accurately detected and removed the WinUI2 (formerly Universal Windows) setup instructions due to the required switch from the existing MSHTML-based derivatives to the open Chromium framework in the WebView2 interface.
v2.3: Added configuration code for the persistence of preference.
v2.4: Licensing changed to conform to the MIT License, and commercial licensing requirements are removed in conjunction with this change.
v2.5: Added code to ignore rumble calls if input is from a mouse or keyboard.
v2.6: Removed mobile device rumble due to security policy incompatibilities in the latest available versions of the WebKit and Chromium engines.

Using the plugin
To activate the rumble feature in a given event or scene, use the following script call:

Code:
Rumble(strong,weak,time)

Strong is the maximum velocity of the effect's magnitude.
Weak is the exact opposite: the weak end of the effect.
Time is defined in milliseconds, so 1000::1 and 5000 is 5 seconds. (Get it?)
Note that neither weak nor strong can go over 1.0, and that magnitude values of 0.1 are completely ignored (and for obvious reasons). Also, the values for weak and strong can be reversed and still work properly.

For example:
Code:
Rumble(1,1,1000)
Rumble(0.4,0.2,500)
Rumble(0.3,0.6,5000)

Q&A

What reasoning does the NW.JS update provide as part of the install process?​

If you're on 64-bit, you can take advantage of improved access to your system resources beyond the 3GB combined access limit, making for improved game performance. Also, it is required on MV in order to guarantee the complete availability of the gamepad servicing libraries for NW.JS that allow for the plugin to work properly.

Is RPG Maker MZ supported?​

Yes. RPG Maker MZ has been tested and is fully compatible. Note that because MZ is newer than MV, you will not need to patch MZ to use the plugin.

What should I say if my customers are complaining of rumble malfunctioning?​

Provided the gamepad has a rumble feature there shouldn't be an issue. But in rare cases, making a change to the rumble option while the gamepad is connected may desync the rumble feature. If this occurs, simply unplug and reconnect your gamepad to cycle access to the rumble interface.
Download Now
Get it on itch.io
Hi there. Curious if there's a way to get this to work in battle's across the board generally (taking damage etc) as opposed to manually setting it in events etc.
Hi there. Curious if there's a way to get this to work in battle's across the board generally (taking damage etc) as opposed to manually setting it in events etc.
Aside from the obvious, of EVALing the script call into your action sequences (if you use them), you could modify the core scripts to call the plugin script call automatically.

As a dirty example, you could modify the action result isCritical() function to call the script in a monkeypatch if it returns true, so whenever something critically hits, it also causes the rumble effect.
Hi there!
I really like the PlugIn, it's just awesome!

But is there a way, to turn it off?
When I turn it off in the options, it's still activated in the game.
(The GamePad still rumbles.)
So that option seems useless to me.


I'm using the PlugIn-Version 2.1.
RPG Maker MV 1.6.2 (Steam)
NWJS v0.49.2
PixiJS 4.8.9
using Windows 10 64bit
GamePad: Logitech Rumblepad 2 Gamepad

I'm using a X-Box Controller Emulator for rumble to work,
because my GamePad is very old and the Rumble wouldn't work at all.

I'm using the Yanfly CoreOption, but I already tried it, without other PlugIns - same problem.


Screenshot:
Screenshot.jpg
Thanks. I'll look into it.

Also, I have not added this to all my pages yet but I wanted to confirm that I have banned this plugin and all of my future projects in China, Russia and Belarus. (You can probably guess why.)

EDIT: I forgot to ask, but I think it would be easier to analyze this from within a demo project.
Thanks. I'll look into it.

Also, I have not added this to all my pages yet but I wanted to confirm that I have banned this plugin and all of my future projects in China, Russia and Belarus. (You can probably guess why.)

EDIT: I forgot to ask, but I think it would be easier to analyze this from within a demo project.
Thanks for the feedback!
I will privately send you a link to my project file.
Version 2.2 is up. This contains the detection fixes from the support request by @Splatterguy and removes the WinUI2 (formerly Universal Windows) instructions due to redundancy from the WebView2 transition.
Emergency patch 2.3 has been released. I found a serious flaw in the plugin that was not saving persistence of the user's rumble setting after exiting the game, so I added configuration manager aliasing to fix this oversight. Sorry about that!
[POST REDACTED]
[POST REDACTED]
[POST REDACTED]
A quick note regarding the legal status of the plugin. Owing to the fact that I am ceasing business operations, I do not feel that it is appropriate to continue to charge for the plugin going forward. Therefore, I am remitting the plugin to the RPG Maker community as a final show of the support that I have provided for the past three years. You can still remit payment as a show of support, however it will be treated as a donation to the cause and not as a commercial licensing fee. The plugin itself will be free to use for any reason subject to the terms of the MIT license. Thank you all for your understanding in this matter.
Hi there!

I have a question: how feasible would it be to have an option to automatically stop the vibration when the input method is the mouse or the keyboard? I can see arguments both for keeping the vibration as is or automatically turning it off when the last input isn't from the controller, which is why it would be better implemented as an option, but it's been a while since this was in active development, and it might not be worth your time.

Well, the plugin is great as it is anyway, so thank you for your efforts, and for sharing it freely with everyone!
Try a plugin that checks if a controller is plugged in, and than put a conditional branch every time you activate the rumble.

Try a plugin that checks if a controller is plugged in, and than put a conditional branch every time you activate the rumble.

Thanks for the help! The script there didn't originally detect mouse inputs, but it was easy to edit to fit my needs, and everything seems to work as intended. 🙂
Thanks for the help! The script there didn't originally detect mouse inputs, but it was easy to edit to fit my needs, and everything seems to work as intended. 🙂
Hey, I didn't originally think of this either. Although I have somewhat moved on from RPG Maker for now due to changing requirements (which is what took me so long before I read this), I will DM you soon regarding inclusion as a part of the official plugin.

(Also, I do in fact have authorship on this plugin. I simply changed identities on the forum, however this is not yet reflected in the plugin materials. I will be updating this shortly, in addition to adding to my other plugin as a part of this change.)

EDIT: It's been updated to match the username change, although the plugin itself will remain as-is pending your consideration of my offer.

EDIT 2: I also appreciate your comments, and likewise that you found it to be useful.
Version 2.5 is now available, which incorporates the disregard for rumble that @mdqp brought up as a concern when using a mouse or keyboard for input. (The authorship information has been updated as well in order to reflect the change in my username, although I will not retroactively enforce the crediting updates for projects that have already been released.)
Thanks ZeroBreak and collaborators very much for this plugin. I'm using it for accessibility as well as immersion in my project.

One question though: How would I set the rumble feature to be "on" by default in Options at first run?

(Tried figuring it out myself and failed. Thanks in advance for any assistance. I'm using RMMV, btw.)
Thanks ZeroBreak and collaborators very much for this plugin. I'm using it for accessibility as well as immersion in my project.

One question though: How would I set the rumble feature to be "on" by default in Options at first run?

(Tried figuring it out myself and failed. Thanks in advance for any assistance. I'm using RMMV, btw.)
There's currently no default state option, but I can add it in. Also, MV should not make a difference (aside from the NW.JS runtime matter) as everything is handled the same as with MZ.
Heyo @ZeroBreak !

Just checking but were you able to figure out the mobile (Android is what I'm looking for) vibration mode ?

I have been searching for a solution to the mobile (Android) vibration support for the last month or so now and I've learned 1 thing about the `navigator.vibrate()` function that seems to be the greatest hurdle I keep faceplanting into spectacularly .... yup it's starting to royally bug me at this point....

That 1 annoying wall stopping me from creating a working Android vibration plugin for MZ is this "thingy" (well it's a so-called "security" rule designed to give usage limitations to certain Javascript API features....) known as "Sticky Activation" triggered features.... seems the vibrate function has a trigger restriction that requires an input event to allow it to fire off...

I've already tried to bypass the restriction by making a pseudo Sticky Activation trigger event by simulating a user input event but that failed to work....

If you have any other ideas for how to "trick the system" into thinking there was a valid Sticky Activation trigger input event, I'd be glad to give it a try!

~ "Kurochan" from KuroyukiDev Games

Original thread: https://forums.rpgmakerweb.com/threads/ready-to-rumble-a-plugin-for-controller-vibration.135759/