# Set Target UnitGroup For Attack Waves
Grammar — Set the target for player player attack waves to unitGroup
Flags —Native
|Action
Sets a unit group to be the target of a player’s attack waves.
# Arguments
int
— Attackerunitgroup
— UnitGroup
Returns — void
native void AIAttackWaveSetTargetUnitGroup(
int player,
unitgroup ug,
);
# Related
Category: AI / AttackWaves / Actions
- Add Unit To Attack Wave —
void
— AIAttackWaveUseUnit - Add Unit Group To Attack Wave —
void
— AIAttackWaveUseGroup - Add Escort Unit To Attack Wave —
void
— AIAttackWaveAddEscortUnit - Add Escort UnitType To Attack Wave —
void
— AIAttackWaveAddEscortType - Add Attack Wave Waypoint —
void
— AIAttackWaveAddWaypoint - Send Attack Wave —
void
— AIAttackWaveSend - Cancel Attack Wave —
void
— AIAttackWaveCancel - Set Attack Wave Gather Point —
void
— AIAttackWaveSetGatherPoint - Set Target Player For Attack Waves —
void
— AIAttackWaveSetTargetPlayer - Set Target Unit For Attack Waves —
void
— AIAttackWaveSetTargetUnit - Set Target UnitGroup For Attack Waves —
void
— AIAttackWaveSetTargetUnitGroup - Set Target UnitArea For Attack Waves —
void
— AIAttackWaveSetTargetUnitPoint - Set Target Point For Attack Waves —
void
— AIAttackWaveSetTargetPoint - Set Target Merge For Attack Waves —
void
— AIAttackWaveSetTargetMerge - Set Target Patrol For Attack Waves —
void
— AIAttackWaveSetTargetPatrol - Set Target Escort For Attack Waves —
void
— AIAttackWaveSetTargetEscort - Set Target Escort For Attack Waves, No Leashing —
void
— AIAttackWaveSetTargetEscortNL - Set Target Gather Defense For Attack Waves —
void
— AIAttackWaveSetTargetGatherD - Set Target Gather Offense For Attack Waves —
void
— AIAttackWaveSetTargetGatherO - Set Target Melee For Attack Waves —
void
— AIAttackWaveSetTargetMelee - Set Target Melee Harass For Attack Waves —
void
— AIAttackWaveSetTargetMeleeHarass - Set Target Region For Attack/Defense Waves —
void
— AIAttackWaveSetTargetRegion - Add Attack Wave Unit Types (Liberty) —
void
— AIAttackWaveAddUnits4 - Add Attack Wave Unit Types (Swarm) —
void
— AIAttackWaveAddUnits3 - Set Attack Wave Keep Alive —
void
— AIAttackWaveSetKeepAlive - Set Attack Wave Gather Early No Replace —
void
— AIAttackWaveSetGatherEarlyNoReplace
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thanson01.sc2map/MapScript.galaxy:1815
CampaignInitAI();
AIAttackWaveSetTargetUnitGroup(gv_p2_ZERG_ORANGE_NW, gv_colonistsOnTheMove);
AIAttackWaveSetTargetUnitGroup(gv_p3_ZERG_LIGHTBLUE_SE, gv_colonistsOnTheMove);
AIAttackWaveSetGatherPoint(gv_p2_ZERG_ORANGE_NW, PointFromId(2714));
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thanson01.sc2map/MapScript.galaxy:1816
CampaignInitAI();
AIAttackWaveSetTargetUnitGroup(gv_p2_ZERG_ORANGE_NW, gv_colonistsOnTheMove);
AIAttackWaveSetTargetUnitGroup(gv_p3_ZERG_LIGHTBLUE_SE, gv_colonistsOnTheMove);
AIAttackWaveSetGatherPoint(gv_p2_ZERG_ORANGE_NW, PointFromId(2714));
AIAttackWaveSetGatherPoint(gv_p3_ZERG_LIGHTBLUE_SE, PointFromId(2715));
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:9665
AICampaignStart(gv_p09_NEUTRAL_ATTACK);
Wait(0.2, c_timeGame);
AIAttackWaveSetTargetUnitGroup(gv_p09_NEUTRAL_ATTACK, gv_hybridUnitGroup);
AIAttackWaveSetGatherPoint(gv_p09_NEUTRAL_ATTACK, UnitGetPosition(gv_escapeWarbot));
AIAttackWaveUseUnit(gv_p04_HYBRID, gv_escapeWarbot);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:9707
}
AIAttackWaveSetTargetUnitGroup(gv_p04_HYBRID, gv_playerGroupforAI);
AIAttackWaveSetGatherPoint(gv_p04_HYBRID, UnitGetPosition(gv_hybrid));
AIAttackWaveUseUnit(gv_p04_HYBRID, gv_hybrid);
campaigns/liberty.sc2campaign — base.sc2maps/maps/challenges/protosspsionics.sc2map/MapScript.galaxy:873
AICampaignStart(gv_pLAYER_COMPUTER1);
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_COMPUTER1, gv_playerUnits);
TriggerEnable(gt_RocksDestroyed, true);
IntLoopBegin(1, 14);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson01.sc2map — MapScript.galaxy:1815
CampaignInitAI();
AIAttackWaveSetTargetUnitGroup(gv_p2_ZERG_ORANGE_NW, gv_colonistsOnTheMove);
AIAttackWaveSetTargetUnitGroup(gv_p3_ZERG_LIGHTBLUE_SE, gv_colonistsOnTheMove);
AIAttackWaveSetGatherPoint(gv_p2_ZERG_ORANGE_NW, PointFromId(2714));
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson01.sc2map — MapScript.galaxy:1816
CampaignInitAI();
AIAttackWaveSetTargetUnitGroup(gv_p2_ZERG_ORANGE_NW, gv_colonistsOnTheMove);
AIAttackWaveSetTargetUnitGroup(gv_p3_ZERG_LIGHTBLUE_SE, gv_colonistsOnTheMove);
AIAttackWaveSetGatherPoint(gv_p2_ZERG_ORANGE_NW, PointFromId(2714));
AIAttackWaveSetGatherPoint(gv_p3_ZERG_LIGHTBLUE_SE, PointFromId(2715));
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:9665
AICampaignStart(gv_p09_NEUTRAL_ATTACK);
Wait(0.2, c_timeGame);
AIAttackWaveSetTargetUnitGroup(gv_p09_NEUTRAL_ATTACK, gv_hybridUnitGroup);
AIAttackWaveSetGatherPoint(gv_p09_NEUTRAL_ATTACK, UnitGetPosition(gv_escapeWarbot));
AIAttackWaveUseUnit(gv_p04_HYBRID, gv_escapeWarbot);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:9707
}
AIAttackWaveSetTargetUnitGroup(gv_p04_HYBRID, gv_playerGroupforAI);
AIAttackWaveSetGatherPoint(gv_p04_HYBRID, UnitGetPosition(gv_hybrid));
AIAttackWaveUseUnit(gv_p04_HYBRID, gv_hybrid);
campaigns/liberty.sc2campaign/base.sc2maps/maps/challenges/protosspsionics.sc2map — MapScript.galaxy:873
AICampaignStart(gv_pLAYER_COMPUTER1);
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_COMPUTER1, gv_playerUnits);
TriggerEnable(gt_RocksDestroyed, true);
IntLoopBegin(1, 14);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:580
AISetUnitScriptControlled(auto8A204714_var, false);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:3273
AISetUnitScriptControlled(lv_zealot01, false);
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, lv_zealot01);
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:4109
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto8673C225_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
Wait(24.0, c_timeGame);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:4124
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, autoC398C246_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
Wait(16.0, c_timeGame);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:4139
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto1F4283D7_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
Wait(16.0, c_timeGame);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:4154
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, autoEBA732BE_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:6211
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, autoB222EDC9_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:6271
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto56424322_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:6319
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto84912346_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map/MapScript.galaxy:6440
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto6DFDDD01_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map/MapScript.galaxy:2968
libNtve_gf_CreateUnitsWithDefaultFacing(1, "InfestedCivilian", 0, gv_pLAYER_06_INFESTED, libNtve_gf_PointOffsetTowardsPoint(UnitGetPosition(autoE2EEC058_var), 0.5, PointFromId(4)));
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_06_INFESTED, gv_sneakAttackTerranBase);
AIAttackWaveAddUnits3(4, 4, 3, "InfestedCivilian");
AIAttackWaveSend(gv_pLAYER_06_INFESTED, 0, true);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:580
AISetUnitScriptControlled(auto8A204714_var, false);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:3273
AISetUnitScriptControlled(lv_zealot01, false);
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, lv_zealot01);
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:4109
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto8673C225_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
Wait(24.0, c_timeGame);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:4124
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, autoC398C246_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
Wait(16.0, c_timeGame);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:4139
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto1F4283D7_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
Wait(16.0, c_timeGame);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:4154
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, autoEBA732BE_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, false);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:6211
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, autoB222EDC9_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:6271
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto56424322_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:6319
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto84912346_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition03.sc2map — MapScript.galaxy:6440
AIAttackWaveUseUnit(gv_pLAYER_02_ZERG, auto6DFDDD01_var);
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_02_ZERG, UnitGroup(null, gv_pLAYER_01_USER, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
AIAttackWaveSend(gv_pLAYER_02_ZERG, 0, true);
return true;
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map — MapScript.galaxy:2968
libNtve_gf_CreateUnitsWithDefaultFacing(1, "InfestedCivilian", 0, gv_pLAYER_06_INFESTED, libNtve_gf_PointOffsetTowardsPoint(UnitGetPosition(autoE2EEC058_var), 0.5, PointFromId(4)));
}
AIAttackWaveSetTargetUnitGroup(gv_pLAYER_06_INFESTED, gv_sneakAttackTerranBase);
AIAttackWaveAddUnits3(4, 4, 3, "InfestedCivilian");
AIAttackWaveSend(gv_pLAYER_06_INFESTED, 0, true);