How to use conditional "if cancel button pressed down" if cancel opens the menu?

I have a puzzle in which you can push, pull, or rotate objects by interacting with them, interacting while holding shift, or interacting while holding cancel (since the cancel button is the only other option that isn't used for another action or walking). But I don't see how the "if cancel button pressed" can be used for anything at all because it opens the menu the second you press it. Is there something I'm missing?
If there were some way to disable opening the menu with the key (something I want to do anyway) would it be usable?
Hey sweetie! You can indeed disable menu access in the event commands!😍 Just check the last page of the event commands, under "System Settings" 😍
Hey sweetie! You can indeed disable menu access in the event commands!😍 Just check the last page of the event commands, under "System Settings" 😍
I can't believe I missed that! Half of the time I post a question here it ends up being a super simple answer I totally should've been able to figure out myself haha
Thanks!

Edit: Something is going wrong with the rotation, and I can't figure out what. I started with a simple line that would rotate the event by 90 degrees to the right when clicked on while the player is holding cancel, but that didn't do anything, so I set up a bunch of if/else statements based on what direction the event is already facing, like this:
1742586968551.png

1742586989871.png


But it still will only turn to the actor's right instead of its own (i.e. if the player is facing up, but the event is facing left, it will appear to turn down and left in a few frames, ending where it started instead of turning up).

I'm sure I'm just misunderstanding the Set Movement Route command or something, my apologies, I'm still very new and this is one of my first projects 😅
I can't believe I missed that! Half of the time I post a question here it ends up being a super simple answer I totally should've been able to figure out myself haha
Thanks!

Edit: Something is going wrong with the rotation, and I can't figure out what. I started with a simple line that would rotate the event by 90 degrees to the right when clicked on while the player is holding cancel, but that didn't do anything, so I set up a bunch of if/else statements based on what direction the event is already facing, like this:
View attachment 335184
View attachment 335185

But it still will only turn to the actor's right instead of its own (i.e. if the player is facing up, but the event is facing left, it will appear to turn down and left in a few frames, ending where it started instead of turning up).

I'm sure I'm just misunderstanding the Set Movement Route command or something, my apologies, I'm still very new and this is one of my first projects 😅
the thing is left/right/up/down are all fixed directions, what you are looking for are degrees on the second column of movement route options (rotating right 90 degrees)
I can't provide screenshot since my rpgm version isn't eng but I hope it helped!
the thing is left/right/up/down are all fixed directions, what you are looking for are degrees on the second column of movement route options (rotating right 90 degrees)
I'm only using if statements because I originally had the block as basically "when clicked while holding cancel button, turn 90 degrees right" but it would just turn to the left once, and then stay there if I kept clicking. If I moved to a different side of the event and tried again, it would turn to the player's left again, but wouldn't move from that spot just like before. So basically, it's the same problem I have now, even though I've made it so it should turn to each cardinal direction instead of a relative one.
instead of "pressed down" which I use for a tutorial too,
this can bring issues.

so if you want to check if shift is being pressed, use the scriptcall
inside a conditional branch instead (not the default being pressed!)
Input.isTriggered("shift") other ones are "up", "down", "left", "right".

this way, if you trigger it, it wont trigger directly as well, as in some ways,
specially in parallel, it open/close very fast (even with some wait, it happens).

with trigger, it doesn't happen, and is more refined than being pressed.

isPressed (which is default) is better when you have "isLongPressed" or
"isPressed" if you work with variable going up, down in value or change
indexing.

so by isTriggered, you can set a global switch on/off this way to do what you want.
I'm only using if statements because I originally had the block as basically "when clicked while holding cancel button, turn 90 degrees right" but it would just turn to the left once, and then stay there if I kept clicking. If I moved to a different side of the event and tried again, it would turn to the player's left again, but wouldn't move from that spot just like before. So basically, it's the same problem I have now, even though I've made it so it should turn to each cardinal direction instead of a relative one.

Well, the problem is that the event turns to look at the player when you interact with it. So if you interact with it from the left, it was turning to look at you, then doing the turn 90 degrees. But if you interacted again, it would turn to look at you, then do the same 90 degree turn, so no changed. Normally you tick the "Direction Fix" under options to stop an event from turning to look at you, but then it won't be able to turn around at all; so what you need to do is tick the "Direction Fix" option, and change your move route to

Direction Fix OFF
Turn 90 degrees
Direction Fix ON
Oh, I didn't know that it turns when you interact with it. It works perfectly now, thank you so much!
instead of "pressed down" which I use for a tutorial too,
this can bring issues.
I don't fully understand what the problem with the default conditional is, but since it's not causing any problems for me right now, I'll leave it as it is. Thanks anyhow!
default with [shift] is being pressed, if you hold it, it can turns fast.
if you use Input.isTriggered("ok") than it wont turn right away, so
you must release the button and press it again.

so Input.isTriggered is prefered if it doesn't work the way you want 🙂
so you can test and play around with it 🙂
You use MV? I see a few easy solutions:

  1. Temporarily turn off the main menu
  2. Bind a different key to the main menu
  3. bind a different key to the other function
If you don't want the menu to be available during your puzzle, choose 1. Otherwise choose 2 or 3.

I use YEP_ButtonCommonEvents by Yanfly, which triggers a common event when a button is pressed. You can use this to overwrite the cancel button, or to assign a new button for the action.

(Edit: YEP_KeyboardConfig. also by yanfly, in addition to the button common events would be even better. It even has a function to separate the cancel button from the menu button.)

However... If you want to use this for controller, then note that for controllers with 4 action buttons, all 4 action buttons do something:

1742593596896.png
= Action
1742593615351.png
= Cancel (but not menu)
1742593630967.png
= Dash
1742593656418.png
= Menu (but not cancel)

That is 1 more button than used on a keyboard (On which you have Dash, OK and cancel/menu)

I use playstation buttons for example, but it works like that for any controller.

So, if you develop this to be played with controller, then you can use cancel without it opening the menu by default.
View attachment 335193 = Action
View attachment 335194 = Cancel (but not menu)
View attachment 335195 = Dash
View attachment 335196 = Menu (but not cancel)

That is 1 more button than used on a keyboard
Alice_Gristle helped me out with the menu problem on keyboard (I just missed the "disable menu" option in the event haha) and it's working great now, but it's good to know that controllers have more buttons available! I assumed the default keys would map to the buttons and I'd have the same amount to work with. I play games on console exclusively so the default RPG Maker keys are kinda confusing to me already, so I'll keep controllers in mind for stuff like this. Thanks!
I play games on console exclusively so the default RPG Maker keys are kinda confusing to me already, so I'll keep controllers in mind for stuff like this. Thanks!
No worries. I like playing with a controller too. Way easier (except for 1st person shooters), more comfortable and you don't need to sit at a desk.

Oh great, someone parted in de bus... it's unrelated, but I just can't ignore this.

Anyhow, RPG maker MV supports both controller and keyboard/mouse by default. (At least the steam version does) So you don't have to choose. Your game is playable with controller and keyboard. But his might change when you change the controls.

Oh thank goodness... someone got in wearing a little too much perfume. I'm normally not a fan, but today it is very welcome. Or maybe they sprayed it because they smelled it too.

Sorry about that. Glad to see you problem was solved I would have known if I did read the replies... 😛 Good luck with your project.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-use-conditional-if-cancel-button-pressed-down-if-cancel-opens-the-menu.176445/