Help - Search - Members - Calendar
Full Version: Pushing the A button
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
ozer
I want to make an event where you have to push the A button at a certain time, if you do it will activate a switch if you don't something else happens... Anyway I've done that but, I want it so you can do it without holding the A button. For example all you would have to do for it to activate the switch is hold the A button before the event even starts and when the event is activated there would be no challenge to it, what I want is when an explanation marks pops up you have to push the button then, without cheating and just holding it. Is there anyway to do that?
maximusmaxy
In your conditional branch, instead of using when button A is being pressed, use the script condition and copy paste this code in there:
CODE
Input.trigger?(Input::A)

That will make it so that it only receives the input when the button is triggered the first time, and not held down.
ozer
QUOTE (maximusmaxy @ Nov 14 2011, 05:55 PM) *
In your conditional branch, instead of using when button A is being pressed, use the script condition and copy paste this code in there:
CODE
Input.trigger?(Input::A)

That will make it so that it only receives the input when the button is triggered the first time, and not held down.

Thanks mate, it worked perfectly.
yamina-chan
I know that this isn't my thread, but is there a similar way to do this with the arrow keys? I've been trying to figgure that out for a while now.
maximusmaxy
Yeah it's basically the same syntax, just change the A for the arrow directions like so:
CODE
Input.trigger?(Input::DOWN)
Input.trigger?(Input::LEFT)
Input.trigger?(Input::RIGHT)
Input.trigger?(Input::UP)
yamina-chan
Ah, you have to write it all big.
*drop*
Makes sense now that I read it and now I know what I've been doing wrong XD'
Thanks.
maximusmaxy
There's a part in the help file which may be useful to anyone reading this, it's the constants used by the input module. Basically it's just which keys you are allowed to use for inputs.

QUOTE
DOWN LEFT RIGHT UP
Numbers corresponding to the directions down, left, right, and up.

A B C X Y Z L R
Numbers corresponding to the various controller buttons.

SHIFT CTRL ALT
Numbers directly corresponding to the keyboard's SHIFT, CTRL, and ALT keys.

F5 F6 F7 F8 F9
Numbers corresponding to the keyboard's function keys. The other function keys are reserved by the system and cannot be obtained.


I'd also like to note that the letters aren't the keys on the keyboard, just the keyboard letters you have assigned to them (You can press f1 while playing to check them out).

If you want to use any key on the keyboard you will probably need to use a keyboard module script, and there is plenty of those around.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.