# UnitGroupFilterThreat
Flags —
Native
# Arguments
unitgroup
— gunit
— ustring
— alternateTypeint
— maxCount
Returns — unitgroup
native unitgroup UnitGroupFilterThreat(
unitgroup g,
unit u,
string alternateType,
int maxCount,
);
# Related
Category: Unclassified
# Examples
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:57
// Is there a threat in the area
threatGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
numPossibleThreats = UnitGroupCount(threatGroup, c_unitCountAll);
while (numPossibleThreats > 0) {
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:84
barrageGroup = UnitGroup(null, c_playerAny, RegionCircle(loc, barrageRadius), null, 0);
barrageThreatGroup = UnitGroupFilterThreat(barrageGroup, aiUnit, null, 0);
numPossibleThreatsInBarrage = UnitGroupCount(barrageThreatGroup, c_unitCountAll);
while (numPossibleThreatsInBarrage > 0) {
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:167
}
enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:57
// Is there a threat in the area
threatGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
numPossibleThreats = UnitGroupCount(threatGroup, c_unitCountAll);
while (numPossibleThreats > 0) {
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:84
barrageGroup = UnitGroup(null, c_playerAny, RegionCircle(loc, barrageRadius), null, 0);
barrageThreatGroup = UnitGroupFilterThreat(barrageGroup, aiUnit, null, 0);
numPossibleThreatsInBarrage = UnitGroupCount(barrageThreatGroup, c_unitCountAll);
while (numPossibleThreatsInBarrage > 0) {
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:167
}
enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
campaigns/void.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:167
}
enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:662
// Also, go to air mode when a pack of new air units shows up and we have killed most of the
// ground units.
targetGroupAirThreatToGround = UnitGroupFilterThreat(targetGroupAir, aiUnit, null, 0);
inAirThreatToGroundCount = UnitGroupCount(targetGroupAirThreatToGround, c_unitCountAlive);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:407
// Is there a threat in the area
threatGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
numPossibleThreats = UnitGroupCount(threatGroup, c_unitCountAll);
while (numPossibleThreats > 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:434
barrageGroup = UnitGroup(null, c_playerAny, RegionCircle(loc, barrageRadius), null, 0);
barrageThreatGroup = UnitGroupFilterThreat(barrageGroup, aiUnit, null, 0);
numPossibleThreatsInBarrage = UnitGroupCount(barrageThreatGroup, c_unitCountAll);
while (numPossibleThreatsInBarrage > 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:517
}
enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1193
// Is there a threat in the area
threatGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
numPossibleThreats = UnitGroupCount(threatGroup, c_unitCountAll);
while (numPossibleThreats > 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1220
barrageGroup = UnitGroup(null, c_playerAny, RegionCircle(loc, barrageRadius), null, 0);
barrageThreatGroup = UnitGroupFilterThreat(barrageGroup, aiUnit, null, 0);
numPossibleThreatsInBarrage = UnitGroupCount(barrageThreatGroup, c_unitCountAll);
while (numPossibleThreatsInBarrage > 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1475
// Is there a threat in the area
threatGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
numPossibleThreats = UnitGroupCount(threatGroup, c_unitCountAll);
while (numPossibleThreats > 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1502
barrageGroup = UnitGroup(null, c_playerAny, RegionCircle(loc, barrageRadius), null, 0);
barrageThreatGroup = UnitGroupFilterThreat(barrageGroup, aiUnit, null, 0);
numPossibleThreatsInBarrage = UnitGroupCount(barrageThreatGroup, c_unitCountAll);
while (numPossibleThreatsInBarrage > 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:638
// Also, go to air mode when a pack of new air units shows up and we have killed most of the
// ground units.
targetGroupAirThreatToGround = UnitGroupFilterThreat(targetGroupAir, aiUnit, null, 0);
inAirThreatToGroundCount = UnitGroupCount(targetGroupAirThreatToGround, c_unitCountAlive);