I don't want my game to rely on mouse control so I want to remove that, and also the main menu & the rest of the game should be controlled using keyboard keys. Is there a plugin that can do that?
MZ how to make a game keyboard only
RPG Maker MZ Supportthe most simple way I think for MZ is to use this way (so far I can check)
I wrapped it inside a function, you can turn it false, and remove
that option inside the options menu, so noone could enable it.
there are work arounds, but you make additions to force it to false
if it ever comes true as well.
Code:
@target MZ
@help Remove Mouse Control
(()=>{
ConfigManager.touchUI = false;
})();
I wrapped it inside a function, you can turn it false, and remove
that option inside the options menu, so noone could enable it.
there are work arounds, but you make additions to force it to false
if it ever comes true as well.
If you are planning to release your game commercially, be prepared for a wave of criticism and negative reviews due to the lack of mouse support. Just saying...
there are games that mouse can be in the way, but for menu's only,
it would be wise to use that.
so the destination sprite to move is the best way, keep menu navigation.
I need to check how to do that, for MV it was easy, for MZ, its slightly
different, but that would be the best way though.
it would be wise to use that.
so the destination sprite to move is the best way, keep menu navigation.
I need to check how to do that, for MV it was easy, for MZ, its slightly
different, but that would be the best way though.
I would avoid changing the default way of doing this and instead do a plug-in that does the modification. That way its easy to turn on and off. I agree with you though on mouse being a pain. My biggest frustration is the mouse clicking
I would consider something like this:
This:
(@ShadowDragon's suggestion would only change the default value of the in-game option to
JavaScript:
/*:
* @target MZ
* @plugindesc Disable all standard touch/mouse input.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/posts/1524993/
* @help Free to use and/or modify for any project, no credit required.
*/
// Patch - prevent top-level touch input state changes.
;void (alias => {
TouchInput._createNewState = function() {
return Object.freeze(alias.apply(this, arguments));
};
})(TouchInput._createNewState);
// Patch - remove in-game Touch UI option.
;void (alias => {
Scene_Options.prototype.maxCommands = function() {
return alias.apply(this, arguments) - 1;
};
})(Scene_Options.prototype.maxCommands);
void (alias => {
Window_Options.prototype.addCommand = function(name, symbol) {
if (symbol !== "touchUI")
alias.apply(this, arguments);
};
})(Window_Options.prototype.addCommand);
// Patch - Touch UI option is always false.
;void (alias => {
ConfigManager.applyData = function(config) {
alias.apply(this, arguments);
this.touchUI = false; // Ignore value from file, always false.
};
})(ConfigManager.applyData);
- Forbids any change in touch state, e.g. pressed, released, cancelled. So whenever the touch input is checked, it will look like it does on game boot, i.e. no input.
- Removes the Touch UI option in-game.
- Ensures the Touch UI option is always set to
false(OFF).
(@ShadowDragon's suggestion would only change the default value of the in-game option to
false: a less-thorough version of my point 3.)I took the quickest way which could work, but your way is far cleaner, as it
take everything, so it would be harder to change, and much safer as well,
as I would go for this version, cleanest patch.
I see that its a script call (I'm new to the engine so I had to google it what this is) but I don't know how to import this code in my project, does anyone know how?
No, it's a plugin: an extra script file that you select in the Plugin Manager, which loads after the core scripts. Plugins modify the game engine in certain ways, like disabling touch input.
To convert plaintext to a plugin:
To convert plaintext to a plugin:
- Copy + paste the code into a text editor (e.g. Notepad).
- File > Save As:
- File Type: All Files
- Filename: whatever.js
(This works because .js files are plaintext.)
- Import that file as a plugin:
- Place the file in your project's
js/pluginssubfolder. - In RPG Maker, open the Plugin Manager via the Tools menu (or by pressing F10).
- Double-click an empty row to add a new plugin.
- Select the plugin and click OK.
- Place the file in your project's
- Save your project to apply Plugin Manager changes.
- Test!
thx this helped with importing the plugin and it works!
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-game-keyboard-only.179315/