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,692
Reaction score
15,295
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,692
Reaction score
15,295
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 Posts

Latest Profile Posts

Introducing the premium bagel
I have a micro economics midterm tomorrow. I'm not worried.
Should be a...small exam :kaojoy:
While was working on one of the monsters that will appear in my horor game I may have made harold a Lovecraftian monster. (I used his head to keep things aligned.)
Finally got my website fixed and the security sorted so it's been a productive day. Can I go to sleep now? I mean... I don't need to work right?
It's always a good idea to refresh yourself on what your plugins do. I'm working on a map with opening walls, and I was about to tear my hair out over how much image editing and hand-constructing of autotiles I'd have to do, when I looked again and saw @Shaz 's Tile Changer could copy areas from another map.

Forum statistics

Threads
115,924
Messages
1,094,084
Members
151,182
Latest member
ricansuave
Top