# Wave Set Type

Grammar — Sets the type type|WaveType and the target target|WaveTarget for wave wave
FlagsNative | Action

Sets the wave type and wave target for a wave.

# Arguments

  • wave — Wave
  • int — Type
  • wavetarget — Target

Returns — void

native void AIWaveSetType(
	wave w,
	int type,
	wavetarget target,
);

Category: AI Advanced / Waves / Actions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:179

    AIWaveSet(player, c_waveDefend,     AIWaveCreate(AIWaveInfoCreate(), player, targDPoint));

    AIWaveSetType(AIWaveGet(player, c_waveMain),     c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:180


    AIWaveSetType(AIWaveGet(player, c_waveMain),     c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:181

    AIWaveSetType(AIWaveGet(player, c_waveMain),     c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:182

    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:183

    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);
    AIWaveSetType(AIWaveGet(player, c_waveDefend),   c_waveStateIdle, targD);

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:184

    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);
    AIWaveSetType(AIWaveGet(player, c_waveDefend),   c_waveStateIdle, targD);

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:185

    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);
    AIWaveSetType(AIWaveGet(player, c_waveDefend),   c_waveStateIdle, targD);

    attackersLimit = 1 << diff;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeAI.galaxy:258

    wave merge = AIWaveCreate(AIWaveInfoCreate(), player, AIGetGatherLocation(player, c_townMain));
    AIWaveAddUnit(merge, u);
    AIWaveSetType(merge, c_waveStateMerge, AIWaveTargetMerge(w));
}

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

        if (AIWaveState(w) != c_waveStateRetreat) {
DebugAIPlayerWave(player, "self defend1 set wave = retreat to gather defense");
            AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherD(player, c_townMain));
        }
    }

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

            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:108

        if (AIWaveState(w) != c_waveStateRetreat) {
DebugAIPlayerWave(player, "ally defend1 set wave = retreat to gather defense");
            AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherD(player, c_townMain));
        }
    }

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

            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:138

    else if (AIWaveState(w) != c_waveStateIdle) {
DebugAIPlayerWave(player, "defend3 set defend = idle at gather defense");
        AIWaveSetType(w, c_waveStateIdle, AIWaveTargetGatherMelee(player));
    }
    else {

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

    if (state != c_waveStateIdle) {
DebugAIPlayerWave(player, "main2 set main = idle at gather offense");
        AIWaveSetType(w, c_waveStateIdle, AIWaveTargetGatherMelee(player));
    }
}

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

        if (PlayerBeaconIsSet(player, c_beaconArmy)) {
            if (state != c_waveStateBeacon) {
                AIWaveSetType(w, c_waveStateBeacon, AIWaveTargetMeleeBeacon(player));
            }
            return;

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

    if (state == c_waveStateDefend || state == c_waveStateBeacon) {
DebugAIPlayerWave(player, "return to divert control from defend/beacon");
        AIWaveSetType(w, c_waveStateIdle, AIWaveTargetGatherD(player, c_townMain));
        return;
    }

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

        if (state != c_waveStateRetreat) {
DebugAIPlayerWave(player, "set divert = retreat to harass point");
            AIWaveSetType(w, c_waveStateRetreat, AIWaveHarassRetreat(player, w, c_harassRetreatRange));            
        }
    }

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

        if (state != c_waveStateRetreat) {
DebugAIPlayerWave(player, "set divert = retreat to harass point");
            AIWaveSetType(w, c_waveStateRetreat, AIWaveHarassRetreat(player, w, c_harassRetreatRange));            
        }
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:119

        else {
            w = AIWaveCreate(AIWaveInfoCreate(), player, AIWaveTargetGatherDPoint(player, c_townMain));
            AIWaveSetType(w, c_waveStateGuardHome, AIWaveTargetGuardHomeUnit(drop));
            AIWaveAddUnitPriority(w, u, c_prioWavePeon);
            AIWaveSetDeleteWhenEmpty(w, true);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:214

    AIWaveSet(player, c_waveDefend,     AIWaveCreate(AIWaveInfoCreate(), player, targDPoint));

    AIWaveSetType(AIWaveGet(player, c_waveMain),     c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:215


    AIWaveSetType(AIWaveGet(player, c_waveMain),     c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:216

    AIWaveSetType(AIWaveGet(player, c_waveMain),     c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:217

    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:218

    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);
    AIWaveSetType(AIWaveGet(player, c_waveDefend),   c_waveStateIdle, targD);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:219

    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);
    AIWaveSetType(AIWaveGet(player, c_waveDefend),   c_waveStateIdle, targD);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:220

    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);
    AIWaveSetType(AIWaveGet(player, c_waveDefend),   c_waveStateIdle, targD);

    attackersLimit = 1 << diff;

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/MeleeAI.galaxy:258

    wave merge = AIWaveCreate(AIWaveInfoCreate(), player, AIGetGatherLocation(player, c_townMain));
    AIWaveAddUnit(merge, u);
    AIWaveSetType(merge, c_waveStateMerge, AIWaveTargetMerge(w));
}

mods/swarm.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:125

        else {
            w = AIWaveCreate(AIWaveInfoCreate(), player, AIWaveTargetGatherDPoint(player, c_townMain));
            AIWaveSetType(w, c_waveStateGuardHome, AIWaveTargetGuardHomeUnit(drop));
            AIWaveAddUnitPriority(w, u, c_prioWavePeon);
            AIWaveSetDeleteWhenEmpty(w, true);

mods/void.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:131

        else {
            w = AIWaveCreate(AIWaveInfoCreate(), player, AIWaveTargetGatherDPoint(player, c_townMain));
            AIWaveSetType(w, c_waveStateGuardHome, AIWaveTargetGuardHomeUnit(drop));
            AIWaveAddUnitPriority(w, u, c_prioWavePeon);
            AIWaveSetDeleteWhenEmpty(w, true);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:2898

        AIWaveAddUnit(lv_enemywave, auto36E4A908_var);
    }
    AIWaveSetType(lv_enemywave, c_waveAttack, lp_attackTarget);
    return true;
}

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

        if (AIWaveState(w) != c_waveStateRetreat) {
DebugAIPlayerWave(player, "defend1 set wave = retreat to gather defense");
            AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherD(player, c_townMain));
        }
    }

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

            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:242

    else if (AIWaveState(w) != c_waveStateIdle) {
DebugAIPlayerWave(player, "defend3 set defend = idle at gather defense");
        AIWaveSetType(w, c_waveStateIdle, AIWaveTargetGatherD(player, c_townMain));
    }
}

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

    if (state != c_waveStateIdle) {
DebugAIPlayerWave(player, "main2 set main = idle at gather offense");
        AIWaveSetType(w, c_waveStateIdle, AIWaveTargetGatherO(player, c_townMain));
    }
}

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

        if (PlayerBeaconIsSet(player, c_beaconArmy)) {
            if (state != c_waveStateBeacon) {
                AIWaveSetType(w, c_waveStateBeacon, AIWaveTargetMeleeBeacon(player));
            }
            return;

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

    if (state == c_waveStateDefend || state == c_waveStateBeacon) {
DebugAIPlayerWave(player, "return to divert control from defend/beacon");
        AIWaveSetType(w, c_waveStateIdle, AIWaveTargetGatherD(player, c_townMain));
        return;
    }

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

        if (state != c_waveStateRetreat) {
DebugAIPlayerWave(player, "set divert = retreat to harass point");
            AIWaveSetType(w, c_waveStateRetreat, AIWaveHarassRetreat(player, w, c_harassRetreatRange));            
        }
    }

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

        if (state != c_waveStateRetreat) {
DebugAIPlayerWave(player, "set divert = retreat to harass point");
            AIWaveSetType(w, c_waveStateRetreat, AIWaveHarassRetreat(player, w, c_harassRetreatRange));            
        }
    }

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

        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:361

    if (state != c_waveStateGuardHome) {
DebugAIPlayerWave(player, "home set divert = idle at gather defense");
        AIWaveSetType(w, c_waveStateGuardHome, AIWaveTargetGatherD(player, c_townMain));
        return;
    }