RMMV Script to assign a button to a common event

Sakurra

I want a brownie.
Veteran
Joined
Sep 1, 2015
Messages
678
Reaction score
590
First Language
English
Primarily Uses
RMMV
Is there a way to assign roles to other key buttons that aren't being used for the game? If so, how? I think it would be neat if I could assign a button not being used to call a Common Event.

Thanks for reading!
 

autodidact

Veteran
Veteran
Joined
Nov 13, 2020
Messages
58
Reaction score
38
First Language
English
Primarily Uses
RMMV
Hi,
I've been delving into RPG MV code and learning what it all does.
So, there may be some side effect I don't yet know about, but you can easily write your own script for this, although Yanflys is no doubt a million times better.
Just put the below in a file under the JS > Plugins folder and give it a ".js" extension.

Note, this is for keyboard, not gamepad buttons.
JavaScript:
(function($){
 
  //Use this site "https://keycode.info/" to find the keycode for the button you want.
  Input.keyMapper[55] = "7";
 
  var Alias_Scene_Map_updateMain = Scene_Map.prototype.updateMain;

  Scene_Map.prototype.updateMain = function() {
    Alias_Scene_Map_updateMain.call(this);
     if (Input.isTriggered('7')) { // where "7" has to appear exactly as it does when you write Input.keyMapper[55] = "7"
      $gameTemp.reserveCommonEvent(1); //where "1" is the Common Event ID
     }
  }
})()

If you don't want a plugin. Just try putting your desired key declaration "Input.keyMapper[55] = '7';" into a event script call and set a switch to true, and then have a common event running in parallel, which runs a check for the conditional script "Input.isTriggered('7')" while the switch is on, and then have the common event call a different common event that does what the button press is supposed to accomplish.

Hm, sounds complicated. Maybe someone else has something easier?
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,354
Reaction score
15,171
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.

 

siguren

Veteran
Veteran
Joined
May 21, 2017
Messages
46
Reaction score
56
First Language
Japanese
Primarily Uses
RMMV
Mano_InputConfig has the ability to call common events from any button.
This plugin is free and versatile, with very few conflicts.
The above thread and plugin distribution URL is for MZ, but this plugin is designed to work with MV as well.
 

Latest Threads

Latest Profile Posts

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.
finally got footage of my main character running around the main hub world. I've fixed a few things tho even since this video unsurprisingly lol.
 …I think I might need to switch from standard ATK/DEF up/down buffs to parameter altering states. I just had an actor whose usual attack against an enemy does ~25 do a buffed attack against a debuffed enemy for ~600…
just saw that titan quest is free on steam until the 23rd

Forum statistics

Threads
115,228
Messages
1,088,246
Members
149,822
Latest member
ddkovi
Top