Feature complete! After discovering by visual cross-exam that I had a no-rumble gamepad I took up Prime Day and ordered a separate controller for use in specifically testing this new addition to my project.
First off, a quick disclaimer: as I have previously stated there's
no guarantee that the launcher shipped with MV will have this capacity so you'll want to
patch in a more recent build of nwjs (latest available version preferred, and don't forget to back up the default launcher in case you run into a problem.) Do this for both MV and your exported game (MV should be patched with the developer's build for obvious reasons), and do so with a 64-bit package to really future-proof your work (and besides, MV ships with a x86-class launcher anyway which is both technically and logistically substandard for modern game development).
Once you've patched and tested the SDK environment, put this code in any event in your project where you intend to have rumble processing via a script eval:
Code:
var gamepads = navigator.getGamepads();
if (gamepads.length > 0) {
var gamepad = gamepads[0];
if (gamepad.vibrationActuator) {
gamepad.vibrationActuator.playEffect("dual-rumble", {
duration: 1000,
strongMagnitude: 1.0,
weakMagnitude: 1.0 }
);
}
}
Hope this helps any of you who are interested in doing this! And before I forget to mention this,
don't increase the numeric values above the given example (unless you're changing duration by however much time in milliseconds) because otherwise it won't work. Seriously, 1.0 is the maximum load that rumble systems can handle (and yes, I tested it myself - the function will go
completely unnoticed if you try going above these values on anything other than your intended duration). You
can go with lower values than I have listed, however - so if you have something for which you don't need full intensity you can adjust by fractions and still be within limits.
EDIT: Turns out that 0.1 on either of the magnitude values doesn't work either. (Guessing it's for obvious reasons.)
EDIT 2: Forgot to mention that weak and strong don't have to follow a reasonable logic pattern, so you can totally do 0.2 strong and 0.4 weak if that's what you want.
EDIT 3: All I have left to ask is for someone to put this in a plugin so that it's easier to deal with on a per-case basis.
EDIT 4: Screw finding someone to do the plugin itself: my contact for the project basically did the work for me! After going over what I was provided with I went into my plugin database and converted it accordingly using the provided code function. I'll be moving this to plugin releases to accommodate this development so until I get the new discussion page up for that I'm outta here. Thanks to everyone for their input on making this happen!
EDIT 5: And the plugin has now been submitted for review. Thanks again to everyone for your input.