MV Wait as ScriptCall at Database => Common Events

Hi, iam stuck again at doing some Javascript lines. This time - a (simple?) wait.
Iv'e googled already but there is no answer that works for my intent:

Iam at Database => Common Events and want to call a wait with an variable. If already tried the following:


JavaScript:
this.wait($gameVariables.value(6));
this seems to work only at script calls at events on maps, at my section it will be simply ignored
i think this one works as a Wait at a MoveRoute for current event (wich also would be ignored at 'common event' section)

JavaScript:
$gameInterpreter.wait($gameVariables.value(6));
this returns an '$gameInterpreter is not defined.' error. dont know where to use this. maybe also events on map?

JavaScript:
$gameMap._interpreter.wait($gameVariables.value(6));
some other post told that this worked for him. for me it also only were be ignored.

Anyone have a solution that works for me? 🙄🙂
Hello,
in a event (or common event), this.wait() is the correct call (which is the same as $gameMap._interpreter.wait()).
But this will only make the interpreter wait, and not the code.

Example:
Capture d’écran, le 2022-04-16 à 09.23.23.png

This will wait 2 sec before proceding to the next 'show text' command. The exact same as putting a regular 'wait' event command.
Capture d’écran, le 2022-04-16 à 09.25.26.png

This will show 'I am not waiting' immediately after you press 'ok' on the 'hello' message box. Then it will wait 2 sec before it show the next command, because making the interpreter wait doesn't stop the actual code reading, it will process all the code of the script call, then move to the next command.

So if you're expecting to stop the rest of the code after your wait() call, it won't work. But to prevent the interpreter to move to the next command, the call is ok.

But by splitting the code in 2 code blocks you could make it work:
Capture d’écran, le 2022-04-16 à 09.32.45.png

Will show 'hello', then wait 2 sec, then show 'I am not waiting' followed by 'hello again'.

Hope that help.
Regards.
this.wait(60)
Works on my end in a Parallel Common Event.

Here:
Scriptcall List
there is this Info next to the Wait command:
This wait time applies between event commands. If you want to wait in the middle of a Script command, split it into 2+ commands so the wait time can apply.

Maybe there is a better solution for this, but i dont know the Syntax for it.
Nice explanation of both of you! Now i got it and it works 👍
I had a script-line direct after the wait line and thought it will also wait between the lines in one script-call. now i splitted the wait command as one single script-call and
JavaScript:
this.wait($gameVariables.value(6));
works fine!

Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/wait-as-scriptcall-at-database-common-events.146813/