Wait via Script

Hi all,

i wanna use the wait command from the game in my script.
Thats what i got so far:

Code:
Scene_BattleFront.prototype.update = function() {
    
    //Actor 1 Idle
    if ($gameVariables.value(449) == 1) {
        if ($gameVariables.value(441) == 1) {
            $gameScreen.showPicture(50,"DevonFightPos1", "Center", $gameVariables.value(501), $gameVariables.value(502), 100, 100, 255, 0);
            $gameMap._interpreter.wait(60);
            $gameScreen.showPicture(50,"DevonFightPos2", "Center", $gameVariables.value(501), $gameVariables.value(502), 100, 100, 255, 0);
            $gameMap._interpreter.wait(60);
        }
    }

Theoretically it should change the puctire after 1 second but it doesnt. Anyone gotn idea?
I messed a bit with animation wait on the map scene some time ago and, as I can remember, in order for the interpreter to update wait it must actually be running, which means it must have something on its "_list" property, which also means you should not use it inside an update function (because it usually runs at each frame and the interpreter has its own controlls).

I'm not familiar with the battle scene, but a way to control the picutres display duration would be to define a custom wait value (in frames) on a property for the class (in this case Scene_BattleFront), so every time the update function is executed, if a picture is being shown, the wait value is changed and the function then checks if the current value is the desired, if so it does something (show or hide).
Well i made a custom scene that is based on Scene_Map im usin it for my custom battlesystem. My goal is atm to change the same picture often to make it look like the picture is in move (the picture itself shows a character). So you say that i have first to define
$gameMap._interpreter.wait(60); ?
No, for the Game_Interpreter to work you must assign a command list to it.
By what you are describing it's not a simple script, the logic will rely on what your code actually does and how it does.

If you want to use the interpreter to do something for you it would be something like this:

Code:
var list = [
    {
        indent: 0,
        code: 231, //show picture
        parameters: [
            //replace these values by the actual values from $gameScreen.showPicture
            pictureId,
            name,
            origin,
            0, //leave this zero, it means direct assign to the x,y
            x,
            y,
            scaleX,
            scaleY,
            opacity,
            blendMode
        ]
    },
    {
        indent: 0,
        code: 230, //wait
        parameters: [
            frames //replace this for the actual value
        ]
    }
  
];
$gameMap._interpreter.setup(list);

Not tested of course.
Have a look at the Game_Interpreter class on the rpg_objects.js
the best way for use system wait in js it use callback

PHP:
this.timer1 = new IAVRA.ANIMATE.Tween(null,{},3); // timer

and you make a callback function that will call all stuf you need

PHP:
var CallMEE = function(){
  // stuff to do when timer finish
}

 this.timer1.stop().dur(1000).start().onComplete( CallMEE); // wait 1000 ms and  call function CallMEE↑↑↑↑↑↑ when onComplete

look at the plugin
https://forums.rpgmakerweb.com/index.php?threads/iavra-animate-everything-easing-library.46826/
It allows to do exceptional thing, and also include a timer to execute callbacks when finish
You just need to use it in this context or you do not assign any object to it and use the update callback

Original thread: https://forums.rpgmakerweb.com/threads/wait-via-script.83082/