A simple way to disable the button for a while?

Yilou

Regular
Regular
Joined
Apr 3, 2020
Messages
100
Reaction score
14
First Language
Russian
Primarily Uses
RMMV
Good day!

When the text appears on the screen, it does not appear at once, but if you press the space bar once more, it will be displayed in its entirety at once. I would like to make it so that the player for a time can not do this. Other than somehow disable the space bar, nothing else comes to mind. Is there an easy way to do this?
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,324
Reaction score
11,496
First Language
German
Primarily Uses
RMMV
there should be a text code for "do not react to player input" in the show text textcodes, but i never tested if that blocks speedup as well as action button
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,227
Reaction score
9,189
First Language
English
Primarily Uses
RMMV
If you're using Yanfly's Message Core, there are plugin commands to disable/enable fast forwarding. You may want to do it that way as the plugin offers a lot of functionality that could be useful in your game.

If you don't want to do that, you can copy the below code into a text editor, save as a *.js file, include it as a plugin:
Code:
Scene_Map.prototype.isFastForward = function() {
    return ($gameMap.isEventRunning() && !SceneManager.isSceneChanging() &&
            (Input.isLongPressed('ok') || TouchInput.isLongPressed()) && !$gameSwitches.value(X));
};
where X is the ID of a game switch (no leading zeros).

You'll then be able to control fast forwarding during your game by turning that switch on or off.

there should be a text code for "do not react to player input" in the show text textcodes
I only see do not wait for player input, which would close the window automatically but not ignore fast forward. Unless I misunderstand you.
 

Yilou

Regular
Regular
Joined
Apr 3, 2020
Messages
100
Reaction score
14
First Language
Russian
Primarily Uses
RMMV

ATT_Turan,​

Andar

Sorry, I think I misspoke. I do not mean that the text when the player holds the "space bar" (and the text flies faster). For example, there is a very long text, but it does not appear immediately, the longer the text the longer it will be printed on the screen and if you turn off the fast forward and the player quickly pressed the space bar twice, it will still instantly appear completely. It is this effect I want to remove for a while.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,227
Reaction score
9,189
First Language
English
Primarily Uses
RMMV
We understood what you wanted, I was just looking in the wrong place.

Interestingly, Yanfly's Message Core does not correctly disable this, as I would expect. I might make a patch for that.

Regardless, instead of what I gave you above, use this:
Code:
Window_Message.prototype.updateShowFast = function() {
    if (this.isTriggered() && !$gameSwitches.value(X)) {
        this._showFast = true;
    }
};
again, replacing X with the ID of a switch. When that switch is on, the player can't skip text. It works for me in my test project.
 

Yilou

Regular
Regular
Joined
Apr 3, 2020
Messages
100
Reaction score
14
First Language
Russian
Primarily Uses
RMMV

ATT_Turan

It works just the way I wanted it to! Thank you so much! : )
 

Latest Threads

Latest Posts

Latest Profile Posts

I’m so lucky! Simone got referred to a feline cardiologist and had I not called this morning the moment there was a cancellation the next opening would have been SEVEN months from now! The other heart hospital would have been on the other side of Michigan. Who knew that animal specialty appointments were also terrible to get!?
Scalemail project is one step closer to completion. Ordered scales from a local metalworking company, ordered some split rings... now all I need is to wait. :>
And pray that the split rings will be flexible enough to handle that.
A spooky banner and a spooky pfp for a spooky season.
Spooky-Season.png
Broke: Actually making the stuff you need to make before the game can progress.
Woke: Wasting time instead by making a sidequest where you can recruit an imaginary friend to the party.
1696264391516.png
Day 1 I don't know where to start... I enjoy designing icons and brainstorming the abilities my video game will have

Forum statistics

Threads
134,993
Messages
1,252,690
Members
177,900
Latest member
LinkIncGames
Top