Press a button on keyboard with event

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
409
Reaction score
63
First Language
Italian
Primarily Uses
Hi guys. I've a question.


Is it possible to press a button on keyboard with an event? Example: when an event start, it have a call script or something that, with code, press a button for you? for example ESC.


Thank you very much for your help!
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
409
Reaction score
63
First Language
Italian
Primarily Uses
no, just the opposite! the player presses any button, but it is the game itself that sends the command to press the button. Do you understand? ESC in code, that you can insert in a call script and the call script push esc for you. ("esc" for example...)
 

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
I can't even think of a reason you'd need to do that. Let alone how you would even start coding something like that. Sorry but I don't think I'll be much help here, good luck though!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
you're thinking from the wrong way. you should never have an event simulate a key press - instead you should skip the keyboard and go directly to the function you want to trigger.


The only reason someone can even ask this is because they want to trigger something that is usually triggered by the player with a button. But in that case, the button does nothing other than sending a command to a part of a script, event or plugin. Instead of triggering the button for it to send the command, you should send the command directly.


Believe me, messing with the input buffer is not something you want to do, not unless you're extremely good at programming and know exactly what you're doing on the javascript level.
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
409
Reaction score
63
First Language
Italian
Primarily Uses
I can't even think of a reason you'd need to do that. Let alone how you would even start coding something like that. Sorry but I don't think I'll be much help here, good luck though!


If you use Yanfly's plugin, battle start with the command of battle ready activated. And i love this think. BUT if the command battle is activated, the Character is selectet. And when you are performing an action, the character do a step forward AND if he's wounded, the sprite is not shown on their knees, but standing, as if it is in force.


SO... in a scripted battle that the enemy deal a big damage and the character talk, when the turn go to the player, become SELECTED and it remain in a standing position. 


If the system press ESC, the character will not be selected and will remain on his knees.


This is the problem xD WTF!


P.S. In Yanfly Battle Core that thing is here:


Battle Windows


There’s various options to adjust the window settings found in the battle system to make navigating the battle system more intuitive. Such options include starting the turns with the Actor Command Window instead of the Party Command Window (the Fight/Escape Window). The Party Command Window is still accessible but only by pressing cancel on the first actor’s window.
 
Last edited by a moderator:

Allinardo

Dungeon Crawler
Veteran
Joined
Jan 2, 2013
Messages
60
Reaction score
23
First Language
English
Primarily Uses
I'd look into finding a script call to prevent that rather than having something press a button for you. Maybe dig into the plugin's code and find out what does what. Yanfly scripts always have a ton of note tags explaining every little function.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
The Party Command Window is still accessible but only by pressing cancel on the first actor’s window.


Instead of having the event press a key, have it give the cancel command directly.


As said above, someone has to dig around the code to find that command (I suspect it's not the same as the regular calls), but this is a lot less work and less error-prone than trying to manipulate the keyboard input buffer.
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
409
Reaction score
63
First Language
Italian
Primarily Uses
Ok, so i need to ask directly to yanfly what command can i use? Surely he know this command...
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
409
Reaction score
63
First Language
Italian
Primarily Uses
Yanfly answer this:  That's a setting that's bound altogether. You can't simply disable it or change it midway through the game.


So, i can't disable that thing with a plugin call. I need the code of rpg maker :(  Somebody know how can i do this?
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
409
Reaction score
63
First Language
Italian
Primarily Uses
Guys please, i need help, help me with this :(
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top