# Wave Time Since Ordered

Grammar — How long since the specified wave waveRef has been ordered
FlagsNative | Function

Returns how long since the specified wave has been ordered.

# Arguments

  • wave — Wave

Returns — int

native int AIWaveGetTimeSinceOrdered(wave w);

Category: AI Advanced / Waves / Functions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:90

    else if (AIWaveState(w) != c_waveStateDefend) {
        if (eval > neededEval+10) {
            if (AIWaveGetTimeSinceOrdered(w) >= 20) {
DebugAIPlayerWave(player, "self defend2 set wave = defend vs. threats");
                AIWaveSetType(w, c_waveStateDefend, AIWaveTargetMeleeDefend(player));

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:113

    else if (AIWaveState(w) != c_waveStateDefend) {
        if (eval > neededEval+10) {
            if (AIWaveGetTimeSinceOrdered(w) >= 5) {
DebugAIPlayerWave(player, "ally defend2 set wave = defend vs. threats");
                AIWaveSetType(w, c_waveStateDefend, AIWaveTargetMeleeDefend(player));

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:142

    else {
        // if we've been idle for 30 seconds, just merge back into the attack wave
        if (AIWaveGetTimeSinceOrdered(w) >= 30) {
            DebugAIPlayerWave(player, "defend4 merge defend back into attack");
            AIWaveMerge(player, c_waveDefend, c_waveAttack);

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:256

    }
    else if (state != c_waveStateAttack) {
        if (AIWaveGetTimeSinceOrdered(w) >= RandomInt(8, 12)) {
DebugAIPlayerWave(player, "set divert = attack harass target");
            AIWaveSetType(w, c_waveStateAttack, AIWaveTargetMeleeHarass(player));

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:220

    else if (AIWaveState(w) != c_waveStateDefend) {
        if (eval > neededEval+10) {
            if (AIWaveGetTimeSinceOrdered(w) >= 20) {
                DebugAIPlayerWave(player, "defend2 set wave = defend vs. threats");
                AIWaveSetType(w, c_waveStateDefend, AIWaveTargetMeleeDefend(player));

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:345

    }
    else if (state != c_waveStateAttack) {
        if (AIWaveGetTimeSinceOrdered(w) >= RandomInt(8, 12)) {
DebugAIPlayerWave(player, "set divert = attack harass target");
            AIWaveSetType(w, c_waveStateAttack, AIWaveTargetMeleeHarass(player));