# Wait For Condition With Maximum Duration
Grammar — Wait for (Conditions), checking every t timeType|Real/Game/AI Time seconds, for no longer than maxDuration seconds
Flags —SubFunctions
|Action
Pauses a trigger until the specified condition is met. The pause will last no longer than Max Duration seconds. Real time is normal time. Game time can pass faster or slower depending on the game speed. AI time passes at the same rate as game time, but can be paused or unpaused while real time and game time are still running. It is useful to pause the AI time while a player is watching a cinematic, so timed attack waves will wait until the player is finished with the cinematic before resuming their countdowns.
# Arguments
fixed
— Timeint
<preset::TimeType> — Time Typefixed
— Max Duration
Returns — void
#AUTOVAR(at,fixed) = 0;
while (!(#SUBFUNCS(cond," && ")) && #AUTOVAR(at) <= #PARAM(maxDuration)) {
Wait(#PARAM(t), #PARAM(timeType));
#AUTOVAR(at) = #AUTOVAR(at) + #PARAM(t);
}
# Related
Category: General / Waits
- Wait —
void
— Wait - Wait For Condition — macro
- Wait For Condition With Maximum Duration — macro
- Wait For Timer —
void
— libNtve_gf_WaitForTimer - Critical Section — macro
# Examples
— None found —