Quanee

Veteran
Veteran
Joined
Sep 14, 2017
Messages
63
Reaction score
8
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,710
Reaction score
15,303
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.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,223
Reaction score
1,722
First Language
Portuguese - Br
Primarily Uses
RMMZ
I try to do something similar. If you dont mind using plugin you can use yanfly keyboard config.
 

Quanee

Veteran
Veteran
Joined
Sep 14, 2017
Messages
63
Reaction score
8
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,710
Reaction score
15,303
First Language
English
Primarily Uses
RMMV
Show what you've done. Scripts.
 

Quanee

Veteran
Veteran
Joined
Sep 14, 2017
Messages
63
Reaction score
8
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 >.>
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,223
Reaction score
1,722
First Language
Portuguese - Br
Primarily Uses
RMMZ
@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.

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:
XRiDxFI.png

Choose the configuration you want pressing with mouse or OK button then will see that:
tzxXMTn.png

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

Now, for this happen:
I need them to be already set in motion before the game even starts.

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.
 

Latest Threads

Latest Profile Posts

I just don't know why, but it's funny.
5.gif
Ugh. The one time I forget to save every hour or so is also the day my computer crashes. That's life!
Even though I spent 100's of dollars on my game already. I think I might just have to give it away for free. Since I haven't heard back from people if I could use some of their graphics. Even from a global mod here. Maybe I can make a donation thing.
you know, some days you get resentful that game dev is even considered a "fun job" and other days it's like, welp, time to roll up my sleeves and code these molotov cocktails
If you suck at playing trumpets, that is probably why.

Forum statistics

Threads
115,967
Messages
1,094,495
Members
151,239
Latest member
luka1712
Top