looking for a plugin what is calling a common Event by pressing a defined key

bfkr3d.jpg

Iam working on a learning game for japanese Kanji. In my Kanji-Menue-Map the player can see how good he is at every single kanji he learned yet. So it would be really nice if the player would be able to teleport to this map by pressing for example the button "K" (because it sounds like Kanji
cat.png
) on the keyboard. And if the player is finished looking at this map it would be nice if it would teleport him back to the position/map from where he was coming from by pressing "K" again. (But if this is to complicated i could do a ExitMenue Button aswell in the Menue map where he gets Teleport back.)

A plugin what is calling a common Event by pressing a defined key would be really helpfull  : )

(I have seen a script for RPG-Maker XP what exactly doing this. It would be really nice if there would be a plugin what is doing the same for RPGMaker MV)
You do not need a plugin for this, unless you specifically want to use a key that is not handled by the default system (and K probably isn't).


If you're happy to use another key, you just need to set up a parallel process common event that checks to see if a key is pressed, checks the id of the current map - if it's not this special map, save the current map id and player's x and y location into variables, then transfer them to this map. If it IS this special map, transfer them back to the map and coordinates that were previously saved in those variables.
Thanks for your fast reply and help : )

But I dont know how I check if a key is pressed by parallel process common event.  Is this done by a script?

(Iam creating games since RPG-Maker95 but i still fail at understanding Scripts :3 )

I would be crazy happy if you could tell me what exactly i have to do : )    (Especially what to insert in the common event and how can I check here if a key is pressed)
But I dont know how I check if a key is pressed by parallel process common event.  Is this done by a script?
No, it is done by conditional branch.
If you check the options for that event command, you'll see one "if button ... is pressed.
http://pastebin.com/4YULnvUh

Here's a plugin I made in a few minutes. Download (or paste the code, put it in a text file and call it KeyPressK.js (make sure it's not a .txt)).

Let me know if somethings wrong.
thanks for your help : )    you are the first person in my life who wrote a plugin for me 😀

But maybe iam still to silly to get it working..

I did activate your Plugin. (EIN = German~ means ON)

And my CommonEvent is 0004.  (So if its called there must come a text called: Hello you called CommonEvent0004)

I did replace the 0 with 4 (for my CommonEvent0004)  but if i press K nothing happens.

I still did try to insert 0004 for the reason if it needs all the zeros but nothing happens.

I tryed all Keys on my Keyboard but nothing happens.

Please tell me what Iam doing wrong 🙂

nfmgl5.jpg
and call it KeyPressK.js
not key_press_k
wow.  its working 🙂   You are my hero !!!!  Thanks so much  😀

If i mention you in the credits of my game do you want to be named as XGDragon or other name?

~by the way, since this is working so fine i could do more menue maps and helpfull stuff for the player by your nice plugin : )

what parts i have to exchange in the javascript-file to replace the K Button with any other Button? is this possible?

9lkemx.png
XGDragon, but its not at all necessary for 3 minutes of work. Or these additional 3. Add more cases and parameters for more keys to map to common events.

http://pastebin.com/nMvyJMr9

Go here for the table that maps numbers to keyboard keys, http://www.asciitable.com/index/asciifull.gif (this is not RPG Maker specific, but how computers work)
Well !
How about it's opposite?
I mean, I want to check 'press K' if calling the commont event then trigger K ?
Please help me too :/
Necro-post notice: sefahezer
It's 4 years since the last post! And as it is a different question from that of the OP, it's also hijacking a thread.

Please start a new thread with full details of your query.

Moderator note: Closing this.

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-a-plugin-what-is-calling-a-common-event-by-pressing-a-defined-key.54711/