Controller hotplugging

RPG Maker MV games won't recognize a controller unless it is already plugged in when the game starts. Has anyone found a way to work around this? It's not a huge issue but I have had a couple of people report the issue to me so far so if there is a fix that would be stellar.
RPG Maker MV does not support it natively, although you could try and and hook into the _updateGamepadState method in the Input class.

I assume you could write a plugin that actively checks for a gamepad and when it finds one, binds it to the input, using a flag you could make it retroactive, meaning if the gamepad disconnects it would just scan for a new one.
Maybe it is a browser problem?
Because the game already runs getGamepads every frame. I don't think it will make any difference if you execute it manually.
Maybe it is a browser problem?
Because the game already runs getGamepads every frame. I don't think it will make any difference if you execute it manually.
I'm pretty sure RPG Maker MV does not support hotplug
I'm pretty sure RPG Maker MV does not support hotplug
i thought it did I but couldnt remember if it was a plugin feature, so just gave it a quick test in blank MV project. after starting with the controller disconnected, it picked up the controller without needing to restart
i thought it did I but couldnt remember if it was a plugin feature, so just gave it a quick test in blank MV project. after starting with the controller disconnected, it picked up the controller without needing to restart
Maybe it's related to me using an older version of nw.js? I've been afraid to update it because my game is very stable right now and I don't want to screw anything up.
Maybe it's related to me using an older version of nw.js? I've been afraid to update it because my game is very stable right now and I don't want to screw anything up.
What controller are you using, and what environnement are you using (as in, are you running it on desktop (Electron based) or are you running it on a browser (which one))?

This could be related aswell.
By default MV uses NWJS for standalone/desktop deployments, not Electron. Both runtime environments are Chromium-based.

During playtest you can check the NWJS version by opening the dev tools window (F8 or F12), selecting the Console tab, and entering this: process.versions.nw. For me, in MV, this returns 0.29.4 (I've never tried to manually update it).

Ideas:
  1. With which types of gamepad are the players experiencing this problem?
  2. Do they experience similar issues with other HTML/browser games?
RPG Maker MV games won't recognize a controller unless it is already plugged in when the game starts. Has anyone found a way to work around this? It's not a huge issue but I have had a couple of people report the issue to me so far so if there is a fix that would be stellar.
It's a problem with the nw.js version.
It's really that simple.
The solution is to use a newer nw.js, such as using RMMZ to open your project (you should be able to search for specific instructions), and then publish it.
As for the cost, the greenworks solution for RMMV to access steam achievements is currently unavailable.
But the performance will be improved.
My game is running 0.29.0. If I recall correctly, Steam Achievements already won't work with that so if that's the only thing I lose by upgrading it wouldn't be so bad. I've heard that upgrading past a certain point disables 32-bit support too? Not that a whole lot of people are going to be playing on 32-bit machines but it'd be nice to keep the option if it was already there.

I loaded up an RPG Maker MZ project and that one is running with 0.48.4. It still has the same controller issue. I'll try updating that one and see what happens.

This happens on DualShock 4 controllers with and without Steam Input, so Dinput and Xinput both exhibit the same behavior. I was made privy to this issue by someone playing on Steam with an Xbox One controller.

I tested two browser games with hotplugging the control. The first one, Friday Night Funkin, works. The second, Melee Light, does not.

EDIT: I updated MZ to 0.91.0 and it removed Dinput support entirely. However, it did at least solve the hotplugging issue so now I know it is NWJS related. I think I'd rather keep Dinput support than enable hotplugging though.
I'm pretty sure active steam users don't use 32 bit system. Even fewer after steam abandoned windows 7.
You can still download 32 bit nw.js from it's official site though.
I'm using a relatively new version and I have no problem with achievements.
My game is running 0.29.0. If I recall correctly, Steam Achievements already won't work with that so if that's the only thing I lose by upgrading it wouldn't be so bad. I've heard that upgrading past a certain point disables 32-bit support too? Not that a whole lot of people are going to be playing on 32-bit machines but it'd be nice to keep the option if it was already there.

I loaded up an RPG Maker MZ project and that one is running with 0.48.4. It still has the same controller issue. I'll try updating that one and see what happens.

This happens on DualShock 4 controllers with and without Steam Input, so Dinput and Xinput both exhibit the same behavior. I was made privy to this issue by someone playing on Steam with an Xbox One controller.

I tested two browser games with hotplugging the control. The first one, Friday Night Funkin, works. The second, Melee Light, does not.

EDIT: I updated MZ to 0.91.0 and it removed Dinput support entirely. However, it did at least solve the hotplugging issue so now I know it is NWJS related. I think I'd rather keep Dinput support than enable hotplugging though.
In fact, greenworks has been updated for a higher version of nw.js, which solves the M1 MAC related issues.
You can look for a specific version supported by greenworks. As for 32-bit, steam can configure the launch parameters or provide a "test version".
In short, if we get 64-bit/better performance/M1 mac/hot plug, we will lose 32-bit/linux support. Fortunately, the game release allows users to choose which one to launch

Original thread: https://forums.rpgmakerweb.com/threads/controller-hotplugging.171917/