Opening/closing disabled menu with the same key

Discussion in 'RPG Maker MV' started by Quanee, Mar 17, 2019.

  1. Quanee

    Quanee Veteran Veteran

    Messages:
    63
    Likes Received:
    7
    First Language:
    Polish
    Primarily Uses:
    RMMV
    Hi,

    I've been look around for a solution to my issue, yet I can't find any.

    I'm trying to make only one, simple item menu for my character, which can be open and closed with the same exact key. So far I've got this:

    1. I've created a parallel event
    2. Changed menu access to disabled (I don't want player to have access to anything but that one menu)
    3. Created a common event with conditional branch like so:

    if Input.isTriggered('Space');
    then SceneManager.push(Scene_Item);

    Which pops the menu in question, and that's great, but now I'd like to close it with the same key (spacebar in this case). I've already tried playing around with SceneManager.push/goto(Scene_Map); but nothing will work. Any help would be greatly appreciated, thank you.
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,336
    Likes Received:
    11,138
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Window_Selectable.prototype.isCancelTriggered is the function that handles closing the window.

    Maybe change that to use Input.isTriggered('Space'); instead, or it might be safer to add a Window_ItemList version that looks for the space key, keeping in mind that changing the default will also affect the title screen, battle windows, choice boxes, basically any window that allows a selection of something that's not part of the menu system.
     
    #2
    Eliaquim likes this.
  3. Eliaquim

    Eliaquim Raze: The Rakuen Zero's Guardian! Veteran

    Messages:
    615
    Likes Received:
    188
    Location:
    Brazil - Rio de Janeiro
    First Language:
    Portuguese - Br
    Primarily Uses:
    RMMV
    I try to do something similar. If you dont mind using plugin you can use yanfly keyboard config.
     
    #3
  4. Quanee

    Quanee Veteran Veteran

    Messages:
    63
    Likes Received:
    7
    First Language:
    Polish
    Primarily Uses:
    RMMV
    @Shaz I'm honestly clueless on how to get that working. I've tried tweaking a bit, but now space doesn't even work and window comes up whenever I close it.

    @Eliaquim Yanfly's plugin only allows me to bind keys in-game (as a player). I need them to be already set in motion before the game even starts.
     
    #4
    Eliaquim likes this.
  5. Shaz

    Shaz Veteran Veteran

    Messages:
    37,336
    Likes Received:
    11,138
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Show what you've done. Scripts.
     
    #5
  6. Quanee

    Quanee Veteran Veteran

    Messages:
    63
    Likes Received:
    7
    First Language:
    Polish
    Primarily Uses:
    RMMV
    @Shaz Sorry, just before going to bed I've pretty much cleared all of it as it was useless, can't even remember what it was exactly. My scripting knowledge is limited to copy-paste code lines and hoping it works >.>
     
    #6
  7. Eliaquim

    Eliaquim Raze: The Rakuen Zero's Guardian! Veteran

    Messages:
    615
    Likes Received:
    188
    Location:
    Brazil - Rio de Janeiro
    First Language:
    Portuguese - Br
    Primarily Uses:
    RMMV
    You can do that.
    Open the game with the plugin YEP_KeyboardConfig.js turned on.
    Put it in a event script call SceneManager.push(Scene_KeyConfig);
    You will open the Keyboard config scene.
    Then you will see something like this:
    [​IMG]

    Choose the configuration you want pressing with mouse or OK button then will see that:
    [​IMG]

    As you can see there are a way to you to assign to a KEY only the CANCEL button.

    Now, for this happen:
    Exit this scene, save the game and close the game test.
    Go to the directory of your project inside the "save" folder and you will see a file named "config.rpgsave".
    It contains the configuration you have made.
    You can delete all save files except this one. Start a new game and you will see that your setup will have remained.
    If you do a deployment, you just have to copy this file and put it in the save folder and distribute the game already with that file.
    The only thing you have to worry about is that the player does not change this setting within the game.
     
    #7

Share This Page