move picture script call with wait until finish?

Amarok

Veteran
Veteran
Joined
Dec 15, 2016
Messages
294
Reaction score
712
First Language
Spanish
Primarily Uses
RMMV
hey there, been searching for this for days, but nothing i found actually works. I just want to be able to use the wait command in my own javascript functions, mainly so i can handle animations and all that.
The reason why i need this is because i use way more than 100 pictures at once and thus the editor is useless for this.
So yeah, how exactly do you tell the engine to "wait" until the picture has finished moving? (like you would do if you used the move picture command in the editor)

Thanks in advance!
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,869
Reaction score
615
First Language
Dutch
Primarily Uses
RMMV
this.wait(x) x being the wait. but in the editor, if you move a picture over 60 frames,
the wait is also 60 frames, but I dont know how to use that.

there are places to get the info you need though. if you try to search for
wait scriptcall or javascript rpg mv, you should get the info.

there is also information found here for scriptcalls and stuff used for javascript functions.
 

Amarok

Veteran
Veteran
Joined
Dec 15, 2016
Messages
294
Reaction score
712
First Language
Spanish
Primarily Uses
RMMV
@ShadowDragon i tried this.wait(x) but with no result, maybe because im calling the function from my own, within a for loop, no idea if it can be used like that, i guess not.
This is such a shame because i can do pretty much anything i want with picture commands, but this is the last bit of info i need to wrap everything up.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,653
Reaction score
1,105
First Language
EN
Primarily Uses
RMMV
These wait routines are part of the event command interpreter. If you call your function via a Script command, that's a single command: the interpreter will run the associated code, then check its wait mode/timer stuff before moving onto the next command.

It sounds like you need to split your code into multiple consecutive commands, so that the interpreter has a chance to realise the picture is moving and wait for it before processing the next command?

Also, note that the this keyword is context-dependent. In a normal Script command in an event, this will reference the current event interpreter. In other contexts, you can try one of these:
JavaScript:
$gameMap._interpreter.wait(x);
$gameTroop._interpreter.wait(x);

Depending on the movements you're after, you might find a plugin like this helpful~
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Me Being Dumb spending hrs trying to figure out Irenas Visual Novel busts plugin..lol. I'm probably missing something stupid and obvious xDD

let the journey begin >w>
X.X ok... I guess I'll just have to think about 48x48 a little differently. Its not "room for more work"..."its room for more detail!...yay"
Alexa, play Buck-Tick - Dress
Worst part about doing a plugin based on an existing system: figuring out the best way for developers to set up the data.
Right now, my free time is less when Covid 19 in my country.
Begin to reduce the number of daily infections to 0.

Forum statistics

Threads
99,216
Messages
963,130
Members
130,804
Latest member
oleran
Top