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,310
Reaction score
11,490
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,149
Reaction score
9,094
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,149
Reaction score
9,094
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 Profile Posts

OMG Y'all. I found an alternate Google Drive I 100% forgot I had. All my crusty old game files from 2014 (when I signed up) are in there. When I like...maybe actually make a prototype thread it's gonna be so much fun taking everyone down my memory lane.
We are at the finish line!!! Thank you COMMUNITY!!!
GameCompletion.jpg
Well, my cat died. Just had a feeling something was off, and went to check.
Someone abandoned her a while ago when she was pregnant, and she wandered into my yard.
Took her to the vet, and did all the usual stuff, making sure she had all the shots and no one was looking for her.
She had the kittens. I kept 1, and found a home for the rest. (Continued because of the limit)
Most disappointing adult event: buying a house that no one comes to on Halloween.

Most redeeming adult event: having a kid to take out trick-or-treating again.
Why is it always "people meant to be in your life, will be"? Why don't those people realize it works in reverse? If you were meant to be in THEIR LIVES, you would be?

Forum statistics

Threads
134,902
Messages
1,251,738
Members
177,719
Latest member
nestharon
Top