Script call for show animation (wait) -- (it's the "wait" part I don't get)

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
Hello. I want the current event to trigger animation #5 in another event (whose ID # is set as the value of Variable #25), so I have:

Code:
$gameMap.event($gameVariables.value(25)).requestAnimation(5);
But how do I make it wait? As in finish playing the animation before executing the next line. In the "official" script call list I see that there's:

Code:
this.setWaitMode('animation');
But that doesn't do anything. I assume I'm supposed to replace 'animation' with something? I've tried everything I can think of, but nothing seems to have any effect. Could someone please straighten me out on this? Thanks!
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
hmm, did you put both lines in the same script call box?
Can you show us the event and the script call itself as it is instead of just pieces like this?
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
did you put both lines in the same script call box?
Well, I've tried it a bunch of different ways, including:

Code:
$gameMap.event($gameVariables.value(25)).requestAnimation(5); this.setWaitMode('animation');
if that's what you're asking. To keep it simple, on a fresh project with no plugins I tried:

Code:
$gameMap.event(2).requestAnimation(5); this.setWaitMode('animation');
and I get the error message: Cannot read property 'isAnimationPlaying' of null.", although I don't get that error message in my current project.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
529
Reaction score
275
First Language
thai
Primarily Uses
RMMV
sorry if this don't answer anything
but if you call in event
why won't you use the editor default
it can trigger this with other event too
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
I may be wrong, but... is this a common event or something like that?
the problem is most likely that the interpreter you are using is not the same as the game map's, where the animation is running.

instead of "this.setWaitMode" try "$gameMap._interpreter.setWaitMode"
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
@pasunna in the editor I have to specify exactly which event to show the animation on, but I don't know which event it's going to be, thus the $gameMap.event($gameVariables.value(25)).requestAnimation(5);
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
@YoraeRasante
It's not in a common event. I tried $gameMap._interpreter.setWaitMode, but it didn't make any difference.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
529
Reaction score
275
First Language
thai
Primarily Uses
RMMV
edit out
for less confusion for other
 
Last edited:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
ah, ok, I think I found the problem.
the error you gave earlier is because there were no events set on the interpreter's _character. And if there are no errors then there is one there, but... it is not the one the animation is playing on.
so, try adding the line "this._character = $gameMap.event($gameVariables.value(25))" before the wait... maybe even before the animation, so you can just use it on the requestAnimation too.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
529
Reaction score
275
First Language
thai
Primarily Uses
RMMV
edit out
for less confusion for other
 
Last edited:

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
Thanks y'all for trying to help me with this, I've tried all suggestions, but so far nothing works. I mean I could always just use something like:

Code:
$gameMap.event($gameVariables.value(25)).requestAnimation(5);
$gameMap._interpreter.wait(30);
But then I'd need to know exactly how long the animation was, but that would be tedious and could get messy. Besides, I feel like there has to be a way to do this with scripting.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
@JDevain did you try my last post too?

I am not sure if
Code:
$gameMap._interpreter._character = $gameMap.event($gameVariables.value(25));
$gameMap._interpreter._character.requestAnimation(5);
$gameMap._interpreter.setWaitMode('animation');
or
Code:
this._character = $gameMap.event($gameVariables.value(25));
this._character.requestAnimation(5);
this.setWaitMode('animation');
but one or the two should have worked...
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
529
Reaction score
275
First Language
thai
Primarily Uses
RMMV
edit out
for less confusion for other
 
Last edited:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
@pasunna actually there are only three relevant things there. The things my script calls check.
the interpreter's _character is set to the animation's target.
the target has the animation played on.
the interpreter is set to wait until the animation is done.
that wait is done by checking if the interpreter's _character still has an animation playing on it.
so yeah, the reason it is not waiting is very likely because the _character is not being changed to the animation's target, so as far as the wait is concerned the event checked is not playing an animation, so it can continue.
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
@YoraeRasante

Yes! The second one worked. I wasn't implementing it right when I tried it before. Thank you so much!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top