Hey dear community, yet again. It's Zephyros and I have another question. This time I was wondering how to have a script respond to a button press. So my character walks up to a pedestal and it asks him to hold up a stone. (I have the whole script and everything ready). When the player presses the button (s) I want a script to activate which unlocks a hidden room. Is this possible without having to add another script?
How to make a script where something responds to a button press?
RPG Maker VXAce SupportYou can make the script wait for input... I'm assuming you're doing the walking and holding stone in a script since if it's just evented, you can easily do what you want actually... In that case, we need to see the script itself in order to give a more concrete answer
I would have to see the script... but you can have an event respond to a button press. Once the player is prompted to press the button, use something like:
Message: "Hey, you. You should hold up that stone."
Loop
Conditional Branch: (symbol assigned to 'S') Button is being pressed
Break Loop
End
Wait: 2 frames
Repeat Above
(Do whatever eventing is necessary to open the secret passage)
Message: "Hey, you. You should hold up that stone."
Loop
Conditional Branch: (symbol assigned to 'S') Button is being pressed
Break Loop
End
Wait: 2 frames
Repeat Above
(Do whatever eventing is necessary to open the secret passage)
Tsukihime has a "wait for button press" within an event script.
which does the same thing as the event posted above, just less event lines but needs a script...
Yes, you don't need a script to do this. Conditional Branch lets you check for a button being pressed.
I don't know if this is of any help, but this is how I do it:
After pressing Q, turns the lamp on if its off. And turns the lamp off if its on.
After pressing Q, turns the lamp on if its off. And turns the lamp off if its on.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-script-where-something-responds-to-a-button-press.35449/