Script for changing button functions

I just tried doing this, been busy n all. But it did not work so I am doing something wrong. lol.

I replaced $gameTemp.reserveCommonEvent(id here); the "id here" with my common event number. But does it need the 000 to go with it? (As seen in the database)

Correct. You'll have to install it in the plugin manager, obviously.

Do you mean the script file in folder js called "rpg_managers"?

And I tried in Rpg Maker, under Tools and the plugin manager I added a row with the new js file I created as on.

So I tried a few things before coming back here. 😅

Really appreciate all the help!
I just tried doing this, been busy n all. But it did not work so I am doing something wrong. lol.

I replaced $gameTemp.reserveCommonEvent(id here); the "id here" with my common event number. But does it need the 000 to go with it? (As seen in the database)



Do you mean the script file in folder js called "rpg_managers"?

And I tried in Rpg Maker, under Tools and the plugin manager I added a row with the new js file I created as on.

So I tried a few things before coming back here. 😅

Really appreciate all the help!
You do not include leading zeroes in IDs, so no 000.

I mean you save it as a .js to the js/plugins folder, then go to the plugin manager in the editor and add it as a new plugin.
Okay, I have attached some screenshots.
With the plugin manager I cannot type in anything else or do anything in the boxes. (For the new one, called ShiftKey)

Does it matter what the Common Event trigger is?
I even tried a new save file.

And this is the only plugin beside the default community one?
Bumping this post. Anyone know what I am doing wrong?
Try putting in a console.log before the common event call just to make sure shift is actually activating something.
Try putting in a console.log before the common event call just to make sure shift is actually activating something.

(function() {
const _Scene_Map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function() {
_Scene_Map_update.call(this);
if (Input.isTriggered("shift") {console.log
$gameTemp.reserveCommonEvent(0001);
}
}
})();

So like this? This is what I would put in my notepad?

Just so I am understanding clear...(Basically what I am expecting)

0. I have a Common event in the database with None as the Trigger.
1. I make a notepad, save as .js at the end.
2. I paste the code I was given.
3.I place the newly .js file inside the plugins folder.
4.In Rpg Maker, I use the Plugin Manager and select my new plugin file as ON.
5. In game, the Shift key should now do what's inside the Common event.

Am I understanding correctly?
Should I just try on a new game project file?
With the plugin manager I cannot type in anything else or do anything in the boxes.
Why are you trying to type anything there? What are you trying to do?
Does it matter what the Common Event trigger is?
No. If you're using it elsewhere in your game, you can make it have whatever trigger you want to use.

(function() {
const _Scene_Map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function() {
_Scene_Map_update.call(this);
if (Input.isTriggered("shift") {console.log
$gameTemp.reserveCommonEvent(0001);
}
}
})();

So like this? This is what I would put in my notepad?
Delete the word "console.log," that is not what Trihan meant.

That isn't working because you're not following his instructions from post 42 - you do not include leading zeros. It should read $gameTemp.reserveCommonEvent(1); presuming you're trying to call event 1 (I believe on another page you referenced event 22, so make sure you're typing the correct thing).
Guys, i figured this one out, it was a silly mistake of not adding an extra ) on the check.
Screenshot_49.png
Why are you trying to type anything there? What are you trying to do?
See if I could type in it? xD 😅

Guys, i figured this one out, it was a silly mistake of not adding an extra ) on the check.
It works now! Wow. This is so cool! Thank you everyone. 😍
Doh, can't believe I missed that missing bracket.
Doh, can't believe I missed that missing bracket.
I thought for sure it was me! xD
I have another related question. Is there a way to turn off this plugin in game? That way I can switch it on or off when I want the X button to be used or not?
(Thanks for reading)

Edit: I figured out something. Nevermind. Still curious to know if this is possible or not. The ability to turn off/on scripts via conditional branches.

Original thread: https://forums.rpgmakerweb.com/threads/script-for-changing-button-functions.144620/