Function: Wait
Function: Wait

Function: Wait

Wait ( DURATION )

Adds a WAIT cue to the response, which signals the shell to pause processing of cues for a specific duration of time (in milliseconds), then automatically continue.

Parameters

Parameter Type Description
DURATION VALUE(INTEGER) The amount of time to wait in milliseconds.

Returns

Returns nothing. Cannot be used in expressions.

What It Does

Adds a finitely-timed pause to the list of cues in the response. All TAME Shells interpret a WAIT cue as, "halt for X milliseconds, then continue." This does not hold up the engine in any way - the wait happens entirely in the shell. Waits are good for timing other cues that create an animatic or other text effects.

This is a convenience function, and is functionally equivalent to:


	addCue("wait", duration);

Example

NOTE: Running this in debug mode will not actually do any waiting, but you'll see how it appears in response cues.

Wait Example


world
{
	start()
	{
		textln("This will count up from 0 to 9, waiting a little between numbers.");
		pause();
	
		local x = 0;
		while (x < 10)
		{
			text(x);
			wait(250);
			x = x + 1;
		}
		// Stick a newline at the end.
		text("\n");
		textln("Done!");
		quit;
	}
}

See Also

AddCue() — Adds cues to the Response.

Additional Technical Notes

Although all TAME shells must handle WAIT, there may be a few shells that will not make this possible. In those cases, WAIT will be skipped during cue processing.

Despite the content of a WAIT cue being a string, an integer gets parsed from it. TAME Shells must treat a bad parse or a parse of a negative integer as a WAIT of 0, or rather, ignore the WAIT cue.

×

Modal Header