oriongates

Veteran
Veteran
Joined
Dec 26, 2019
Messages
204
Reaction score
55
First Language
english
Primarily Uses
RMMV
Okay, so I've got a scene where the player is walking a fairly lengthy (19 steps) distance while dialogue bubbles open up for a conversation in the party. Once the player reaches their destination and the dialogue completes then the player performs a new action (hopping over a fence) and the scene moves on.

Simple enough, set the initial movement command to "do not wait", insert the text displays and then at the end a new movement command for the fence-hop.

With fairly average (I assume) clicking through the dialogue, this goes perfectly fine. The player reaches their destination just a bit before the dialogue ends and then jumps the fence.

But the problem arises if a player is clicking through the dialogue quicker than intended. Maybe they're a fast reader, maybe they don't care about this scene. Whatever the reason. This leads to the player stopping early (once they reach the end of their dialogue) and jumping over a point several (in testing, up to 5 steps) too quickly.

Now, I could attach an arbitrary amount of wait time at the end of the dialogue in order to ensure that those who're rushing through won't break sequence, but then that means if you are moving through the dialogue at a normal pace then there's a weird pause while nothing happens and the sequence catches up.


I considered setting the fence jump as a player-touch event triggered by the player arriving at their destination, but this has the opposite problem: if a player is slow flipping through the dialogue then they'll reach the event early and the sequence is broken in the opposite direction.

Any thoughts on how to resolve this?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
857
First Language
English
Primarily Uses
RMMV
@oriongates Whenever I want to ensure that an event waits until the player (or another event) reaches the destination, I toss out a loop.

Code:
◆Loop
  ◆If:Script:!$gamePlayer.isMoving() && !$gameMap._events[6].isMoving()
    ◆Break Loop
    ◆
  :End
  ◆Wait:1 frame
  ◆
:Repeat Above

The above will loop until both the player and the event are finished moving. It is important to add in the 1 frame Wait, so always remember to put that in there.

Code:
◆Loop
  ◆If:Script:$gameMap._events[6]._x === 7 && $gameMap._events[6]._y === 6
    ◆Break Loop
    ◆
  :End
  ◆Wait:1 frame
  ◆
:Repeat Above

You can also specify a certain X,Y location.
 

oriongates

Veteran
Veteran
Joined
Dec 26, 2019
Messages
204
Reaction score
55
First Language
english
Primarily Uses
RMMV
The first one doesn't seem to be working for me (although let me know if I need to edit the text of the script at all, totally script illiterate). It seems to break the loop immediately (essentially having no effect rather than sticking the player in an endless wait loop). This is how I've got it in the event:

1580013088886.png

If it matters, the event controlling this is immobile (and I've got a parallel event running in the scene which randomly changes facing to produce animation.)


I was able to get the second one running, since I am barely literate enough to figure out I needed to change the $gameMap._events[6] to $gamePlayer, but I'd love to find out what I did wrong on the first one.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
857
First Language
English
Primarily Uses
RMMV
@oriongates Ah, sorry. If you only want to have the event wait for the player to stop moving, you only need : '!$gamePlayer.isMoving()' in the script field. I copied the loop directly from my test project and I had an event with an ID of 6 that was also in motion.

For the second example, you will need to change the '6' (the ID of the event) and the X,Y map coordinates (the 7 and 6).


You can also use the loop to wait for a certain part of a song :

Code:
◆Loop
  ◆If:Script:AudioManager._bgmBuffer.seek() >= 2
    ◆Break Loop
    ◆
  :End
  ◆Wait:1 frame
  ◆
:Repeat Above

The above will wait until the current BGM is greater than or equal to two seconds. This ... sort of works. Anything below two seconds is kind of iffy, but eh.

You can also do some crazy stuff within the Move Route itself :

Code:
◆Set Movement Route:adventurer@x5y2 (Wait)
:                  :◇Script:$gameMessage.add("\\>That was a regular rat, you moron!\\|\\|\\|\\|\\^");
:                  :◇Speed:6
:                  :◇Script:this._animationCount = -900; this._pattern = 0;
:                  :◇Jump:+0, +0
:                  :◇Script:this._pattern = 1;
:                  :◇Wait:5 frames
:                  :◇Script:if ($gameMessage.isBusy()) { this._moveRouteIndex -= 5; this._waitCount = 1; };
:                  :◇Speed:1

The above will display a message and cause the character event to hop in place (giving the appearance of anger) until the message is closed. '_moveRouteIndex' is the internal index used by the Move Route to determine its progression through the list of commands. So, by subtracting 5, we are going back up the list 5 spots wherein the 'hop' begins again. This is rather complex and could be done using a loop, but I was fiddling around.
 

Latest Threads

Latest Posts

Latest Profile Posts

Froggo is back after a long break!
SF_People1_1 added!
index.php

I was reading some emails from a few days ago, and I saw an update notice for RPG Maker MZ . . . I like that update notices are being sent via email, I often forget to check from within the program. :smile:
Long time no see. Is “put on and take off my hat readily” right or natural?
My English teacher said the "readily" is used wrongly here. But I am not sure. Thank you very much for answering my small question.
More: The context is: The hat was too tight to wear originally and modified to suit the head and now I'm trying on it.
Ami
--- Difficulty Affect: Price ---

(Very Easy Difficulty)
Merchant: This HP Bottle just cost 5G per item
M.Archer: How much i sell it?
Merchant: It cost 50G per item
M.Archer: Alright,i buy 50
(Very Hard Difficulty)
Merchant: This HP Bottle cost 100G per item
M.Archer: How much i sell it?
Merchant: 5G
M.Archer: (Mouth Bleeding)

Forum statistics

Threads
109,139
Messages
1,042,473
Members
141,645
Latest member
byte
Top