So. I want to know if there is a way for the player to type let's say "ICE" and all of a sudden a cube of ice that was in their way melts so they can continue. How would one do that?
Starting Events with Keyboard Commands?
RPG Maker MV Supportdepends on what exactly you want to do.
There are ways to check for keyboard, but usually for single keays.
The easiest way however is the other way around: the cube would have to be an event anyway, and you could simply have it activated by action button and then check on how to remove it in different ways.
If you trigger a common event to affect map events, then you'll need to know how to use control variable and get location info commands to identify the blocking event and have it react to you.
There are ways to check for keyboard, but usually for single keays.
The easiest way however is the other way around: the cube would have to be an event anyway, and you could simply have it activated by action button and then check on how to remove it in different ways.
If you trigger a common event to affect map events, then you'll need to know how to use control variable and get location info commands to identify the blocking event and have it react to you.
I think by default you can only check the pre-defined keys are pressed. You'd have to add the letters i, c and e to the keymapper first.
JS keycode list here
Once you've added all three letters to the keymapper then you could check that they were pressed using an event. I would suggest event set to parallel with separate pages to check for each key press. To check for key presses you'll be using:
With all this in mind here's how I would set up your event:
Keep in mind that these check are evaluating incredibly frequently and will contribute to lag, I wouldn't advise having several of them on a single map. It's also worth keeping in mind that several keys already do things within MV and unless you want players not to be able to use these keys for game functions (most have alternatives) you won't be able to use this method for certain words. Below is the keymapper as found in the rpg_core.js showing the default keyboard set up.
Code:
Input.keyMapper[code] = 'name'
//so for the 'i' key this is
Input.keyMapper[73] = 'i'
JS keycode list here
Once you've added all three letters to the keymapper then you could check that they were pressed using an event. I would suggest event set to parallel with separate pages to check for each key press. To check for key presses you'll be using:
Code:
Input.isTriggered('name')
With all this in mind here's how I would set up your event:
Keep in mind that these check are evaluating incredibly frequently and will contribute to lag, I wouldn't advise having several of them on a single map. It's also worth keeping in mind that several keys already do things within MV and unless you want players not to be able to use these keys for game functions (most have alternatives) you won't be able to use this method for certain words. Below is the keymapper as found in the rpg_core.js showing the default keyboard set up.
Code:
Input.keyMapper = {
9: 'tab', // tab
13: 'ok', // enter
16: 'shift', // shift
17: 'control', // control
18: 'control', // alt
27: 'escape', // escape
32: 'ok', // space
33: 'pageup', // pageup
34: 'pagedown', // pagedown
37: 'left', // left arrow
38: 'up', // up arrow
39: 'right', // right arrow
40: 'down', // down arrow
45: 'escape', // insert
81: 'pageup', // Q
87: 'pagedown', // W
88: 'escape', // X
90: 'ok', // Z
96: 'escape', // numpad 0
98: 'down', // numpad 2
100: 'left', // numpad 4
102: 'right', // numpad 6
104: 'up', // numpad 8
120: 'debug' // F9
};
Original thread: https://forums.rpgmakerweb.com/threads/starting-events-with-keyboard-commands.105808/