Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,221
Reaction score
707
First Language
Poland
Primarily Uses
RMMV
I'm not that advanved JS coder, but I pretty know some of things, but this bothers me entire day.
I know it will involve messing around with Game_Interpreter wich I have a hard time to understand how it works, but I thought it would be funny if we, RPG Maker users could implement some kind "security" for skipping dialouges and make NPC's like this one:

And I would like to implement such thing as prototype, but all of my todays attempts failed misserably and I'm out of ideas how could I else do such things, because I don't see how to do it with eventing. (That's why I'm posting in JS learning)
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,421
Reaction score
1,682
First Language
Dutch
Primarily Uses
RMMV
I dont saw anything like that before, I though of a way of eventing it,
but how would it be reacted? there is 1 way to event, but trouble some
way.

so a plugin is indeed required if used often, but it's a very good question
indeed how too.

@caethyril might know a way and is a beastin :p but I keep my eyes open
on this one, which is really interesting idea =)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,764
Reaction score
2,114
First Language
EN
Primarily Uses
RMMZ
I'm not sure what you mean by "skip message", maybe the _showFast flag? Its value is true iff the window is currently "triggered", i.e. if OK/Cancel/touch is pressed.

_showFast gets updated in the message window's updateShowFast method (rpg_windows.js), but that can be called multiple times per frame. If you wanted to count the frames skipped by the player, something like this might work (untested):
JavaScript:
(function(alias) {
  Game_Message.prototype.initialize = function() {
    alias.apply(this, arguments);
    this._fastCount = 0;
  };
})(Game_Message.prototype.initialize);

(function(alias) {
  Window_Message.prototype.updateMessage = function() {
    var res = alias.apply(this, arguments);
    if (res && this._showFast) $gameMessage._fastCount++;
    return res;
  };
})(Window_Message.prototype.updateMessage);
I.e. "when the message is updated, if _showFast is true, then +1 to the new _fastCount property on $gameMessage". You could check/reset that value using script calls.

Edit: added expected return value to updateMessage. :kaoslp:
Edit 2: fixed another typo and tested, seems to work OK now.
Edit 3: added extra check so it doesn't do +1 if triggered when the window ends its open animation.
Edit 4: attachment!
 

Attachments

  • msgSkipCheck.js
    1 KB · Views: 3
Last edited:

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,221
Reaction score
707
First Language
Poland
Primarily Uses
RMMV
@caethyril I'll explain in human language what I meant by "Skip message".

As we all know, text in message is displayed like in typewritter, letter by letter in some short and fast span of time. Imagine now some text, a long text that fills all default 4 rows of message window:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

By skip message I mean some kind of mechanism that detects while text is rendered if user pressed action button (default: enter or Z) and if that key was pressed (end of green text) - aka speed up message to skip it then add 1 to some variable (like in your example code) and if that variable excess some upper value, execute dialog like in movie in my post. Otherwise the event will be processed as it is designed in editor.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,764
Reaction score
2,114
First Language
EN
Primarily Uses
RMMZ
Ah, I see. Yes, that sounds like the _showFast flag, like in my example. :kaothx:

I just made a couple more corrections to the code in my previous post, it seems to work now. I tested with no other plugins, using an event like this:

◆Script:$gameMessage._fastCount = 0; ◆Text:None, Window, Bottom : :text 1 : :text text text text text text text text : :text text text text text text text text ◆Text:None, Window, Bottom : :text 2 : :text text text text text text text text : :text text text text text text text text ◆Control Variables:#0007 Count = $gameMessage._fastCount ◆Text:None, Window, Bottom : :You skipped \v[7] chunks of dialogue.

In this example, the result is 0, 1, or 2: the number of Show Text commands the player skipped through. Feel free to experiment~ :kaohi:

(Notes: when _showFast is active, the entire message can display in a single frame, and the default updateShowFast method never sets _showFast to false. I.e. messages are skipped on a per-command basis.)
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,421
Reaction score
1,682
First Language
Dutch
Primarily Uses
RMMV
@caethyril so basicly what you tell, you either need to make conditional
choices per text and else handler?

$gameMessage._fastCount = 0
text: hi there, how are...... <skipping>
if: script: $gameMessage._fastCount >= 0
DONT SKIP ME PLEASE
else
so I want <skipping>
end
if: script: $gameMessage._fastCount >= 1
DO NOT TRY TO SKIP ME
else
so what I want to tell is..... <skip>
end

and so on? but I think he want to interupt the conversation when
you do "_showFast" unless this can be more controlled by labels
and jump back where you left off by the amount of variable count?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,221
Reaction score
707
First Language
Poland
Primarily Uses
RMMV
I'll try to visualise it a liitle more:

NPC shows some dialog:
2021-08-09 19_14_12-Spellzone 2.3.png

And when player skips message...
2021-08-09 19_16_20-Spellzone 2.3.png

But if message is fully displayed:
2021-08-09 19_19_25-Spellzone 2.3.png
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,764
Reaction score
2,114
First Language
EN
Primarily Uses
RMMZ
Yep, I was thinking like @ShadowDragon described: check the counter between messages. :kaoslp:

To clarify, you want this to happen on skip, right?
  1. End the message immediately,
  2. Branch to a different message, then...
  3. Return to the skipped message (?).
I've been wading through this part of the core scripts this morning and haven't really gotten anywhere. Given the lack of other responses, you may have better luck on the paid requests board.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,221
Reaction score
707
First Language
Poland
Primarily Uses
RMMV
I just realized that your script lacks one thing... What if message speed is set to instant... Anyway I appreciate your help and effort, at this point I will do some tests and experiments. If they fail. I will head to paid requests.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,421
Reaction score
1,682
First Language
Dutch
Primarily Uses
RMMV
I use instant text, but -fastSpeed = 0 to show, but this can only
probably be fixed if you "HOLD" the button to skip through, so
if they hold the button on instant text, that it should apply the
skip as well.

I'm not entirely sure how to accomplish it as well, but more as a workaround,
but this also require labels and 1 variable to track down the text which is
also, a parallel event to see if the player press the button to skip or holing it
to skip.

downside, if you press once, all the text is showing, easier to read faster,
so you need a average of 3 second, if faster than that, it is seen as skipping.

but it would be hard to guess in order to do that, that might be a different
way that @caethyril might know as the following.

what if, you add a button "skip" so you can skip through the next person or
the whole dialogue to go to the end (but also bound to a safety switch.

what I mean here is:

you have regular NPC's, so switch is OFF, so you can skip through the dialogues,
but on NPC's HOLDING a quest, you rather dont want it to be skipped or
something more important that a player must know?

so turning that switch on at the beginning, and when pressing "skip button",
you get prompted for not skipping, and but maybe in a struct per event?
so mapID, NPC event, and text based on number 1, 2, 3,4++ everything
you try to skip a message?

it might be a better solution in my opinion, but it requires knowledge to
accomplish it still (and this is only an idea that come to mind).
 

Latest Threads

Latest Posts

Latest Profile Posts

Another comic with Backstage Malak...
If you want to ask him anything, you can ask on my DeviantArt page! I'm not sure if you're allowed to do it here.
Forum tip of the day ...
If you get a temporary suspension for being a jerk to people who are trying to help you, and arguing with mods and admins, don't go making new accounts. Chances are, if you p**s us off enough to suspend you for a week, we're not going to hesitate giving you a permanent ban when you give us a reason.
E_6fAErVkAQILXu.png
I'm so close to releasing my game on steam! :blush::blush::blush:
Us:
"This game is awesome! I wish there are more games like this in the future."
Also us:
"I hate how games stopped being original and start copying other successful games."
Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the Modern British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.

Forum statistics

Threads
115,291
Messages
1,088,682
Members
149,923
Latest member
R1ck_Str1k3r
Top