# Units In Unit Group With Alliance
Grammar — Units in group|Unit Group having alliance alliance with player, with at most count
Flags —Native
|Function
Returns a unit group that contains units that have passed the specified ally filters from another unit group.
# Arguments
unitgroup
— Groupint
— Playerint
<preset::UnitAlliance> — Allianceint
— Count
Returns — unitgroup
native unitgroup UnitGroupFilterAlliance(
unitgroup g,
int player,
int alliance,
int maxCount,
);
# Related
Category: Unit Group / Useful Unit Groups
- Empty Unit Group —
unitgroup
— UnitGroupEmpty - Idle Units For Player —
unitgroup
— UnitGroupIdle - Convert Unit To Unit Group —
unitgroup
— libNtve_gf_ConvertUnitToUnitGroup - Units In Region Matching Condition —
unitgroup
— UnitGroup - Unit Count In Region Matching Condition —
int
— UnitCount - Units Near Point Matching Condition —
unitgroup
— UnitGroupSearch - Units In Region With Alliance To Player —
unitgroup
— UnitGroupAlliance - Unit Count In Region With Alliance To Player —
int
— UnitCountAlliance - Units In Region With Alliance To Player Matching Condition —
unitgroup
— libNtve_gf_UnitsInRegionWithAllianceToPlayerMatchingCondition - Units In Unit Group For Player —
unitgroup
— UnitGroupFilterPlayer - Units In Unit Group Matching Condition —
unitgroup
— UnitGroupFilter - Units In Unit Group Targetable As —
unitgroup
— UnitGroupFilterPlane - Units In Unit Group With Alliance —
unitgroup
— UnitGroupFilterAlliance - Units In Unit Group With Custom Value —
unitgroup
— libNtve_gf_UnitsInUnitGroupWithCustomValue - Units In Unit Group Within Region —
unitgroup
— UnitGroupFilterRegion
# Examples
mods/heroesbrawlmods/arenamodemods/templearena.stormmod — base.stormdata/LibAMCT.galaxy:2212
lv_currentOrderTarget = OrderGetTargetUnit(lv_currentOrder);
if ((UnitGetOwner(libAMCT_gv_aRMSkyTemple[lv_templeIndex].lv_temple) != libCore_gv_cOMPUTER_Neutral)) {
lv_testTargets = UnitGroupFilterAlliance(lv_validTargets, UnitGetOwner(libAMCT_gv_aRMSkyTemple[lv_templeIndex].lv_beacon), c_unitAllianceAlly, 0);
if ((UnitIsValid(lv_currentOrderTarget) == true) && (UnitGroupHasUnit(lv_testTargets, lv_currentOrderTarget) == true)) {
lv_bestTarget = lv_currentOrderTarget;
mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmod — base.stormdata/LibPEB1.galaxy:8139
libNtve_gf_StopTimer(libPEB1_gv_holdoutTimer);
while (true) {
lv_zergRemaining = (UnitGroupCount(UnitGroupFilterAlliance(libPEB1_gv_activeZergHeroes, libCore_gv_cOMPUTER_TeamChaos, c_unitAllianceAlly, 0), c_unitCountAlive) + UnitGroupCount(UnitGroupFilterPlayer(libPEB1_gv_activeZergMinions, libCore_gv_cOMPUTER_TeamChaos, 0), c_unitCountAlive));
if ((lv_zergRemaining == 0)) {
break;
mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmod — base.stormdata/LibPEB1.galaxy:8729
libNtve_gf_StopTimer(libPEB1_gv_holdoutTimer);
while (true) {
if ((UnitGroupCount(UnitGroupFilterPlayer(libPEB1_gv_activeZergMinions, libCore_gv_cOMPUTER_TeamChaos, 0), c_unitCountAlive) == 0) && (UnitGroupCount(UnitGroupFilterAlliance(libPEB1_gv_activeZergHeroes, libCore_gv_cOMPUTER_TeamChaos, c_unitAllianceAlly, 0), c_unitCountAlive) == 0)) {
break;
}
mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmod — base.stormdata/LibPEB1.galaxy:8733
}
else {
libPEB1_gf_SetHoldoutPanelZergRemaining((UnitGroupCount(UnitGroupFilterAlliance(libPEB1_gv_activeZergHeroes, libCore_gv_cOMPUTER_TeamChaos, c_unitAllianceAlly, 0), c_unitCountAlive) + UnitGroupCount(UnitGroupFilterPlayer(libPEB1_gv_activeZergMinions, libCore_gv_cOMPUTER_TeamChaos, 0), c_unitCountAlive)));
TextExpressionSetToken("Param/Expression/lib_PEB1_8C9C6DCD", "A", IntToText((UnitGroupCount(libPEB1_gv_activeZergHeroes, c_unitCountAlive) + UnitGroupCount(libPEB1_gv_activeZergMinions, c_unitCountAlive))));
TextTagSetText(lv_countdownTextTag, TextExpressionAssemble("Param/Expression/lib_PEB1_8C9C6DCD"));
mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmod — base.stormdata/LibPEB1.galaxy:10700
}
if ((UnitGroupCount(UnitGroupFilterPlayer(libPEB1_gv_activeZergMinions, libCore_gv_cOMPUTER_TeamChaos, 0), c_unitCountAlive) == 0) && (UnitGroupCount(UnitGroupFilterAlliance(libPEB1_gv_activeZergHeroes, libCore_gv_cOMPUTER_TeamChaos, c_unitAllianceAlly, 0), c_unitCountAlive) == 0)) {
TransmissionSendForPlayerSelect(PlayerGroupAll(), TransmissionSource(), c_invalidPortraitId, "", "Talk", SoundLinkNoIndex(ConversationDataGetSound("AdjutantPVEVO|Line00016", false)), null, null, 0.0, c_transmissionDurationAdd, true, c_maxPlayers, false);
}
mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmod — base.stormdata/LibPEB1.galaxy:10901
}
if ((UnitGroupCount(UnitGroupFilterPlayer(libPEB1_gv_activeZergMinions, libCore_gv_cOMPUTER_TeamChaos, 0), c_unitCountAlive) == 0) && (UnitGroupCount(UnitGroupFilterAlliance(libPEB1_gv_activeZergHeroes, libCore_gv_cOMPUTER_TeamChaos, c_unitAllianceAlly, 0), c_unitCountAlive) == 0)) {
TransmissionSendForPlayerSelect(PlayerGroupAll(), TransmissionSource(), c_invalidPortraitId, "", "Talk", SoundLinkNoIndex(ConversationDataGetSound("AdjutantPVEVO|Line00016", false)), null, null, 0.0, c_transmissionDurationAdd, true, c_maxPlayers, false);
}
mods/heroesmapmods/battlegroundmapmods/skytemple.stormmod — base.stormdata/LibMLCP.galaxy:2711
lv_currentOrderTarget = OrderGetTargetUnit(lv_currentOrder);
if ((UnitGetOwner(libMLCP_gv_mMSkyTemples[lv_templeIndex].lv_temple) != libCore_gv_cOMPUTER_Neutral)) {
lv_testTargets = UnitGroupFilterAlliance(lv_validTargets, UnitGetOwner(libMLCP_gv_mMSkyTemples[lv_templeIndex].lv_beacon), c_unitAllianceAlly, 0);
if ((UnitIsValid(lv_currentOrderTarget) == true) && (UnitGroupHasUnit(lv_testTargets, lv_currentOrderTarget) == true)) {
lv_bestTarget = lv_currentOrderTarget;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:1957
lv_abilityAoE = StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "MutatorAmonTychusTossGrenadeDamage", "AreaArray[" + IntToString(0) + "].Radius", c_playerAny));
lv_score = 1;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 3, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonTychusTossGrenade", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:1995
lv_score = 1;
lv_abilityAoE = 0.5;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 1, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonRaynorSnipe", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2217
lv_score = 3;
lv_abilityAoE = 5.0;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 2, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonZagaraMassRoachDrop", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2284
lv_abilityAoE = StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "MutatorAmonArtanisLightningDashSearch", "AreaArray[" + IntToString(0) + "].Radius", lp_owner));
lv_score = 2;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 3, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonArtanisLightningDash", 0), lv_target));
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicTactical.galaxy:437
}
if ((UnitGetDamageTakenTime(lp_aIUnit) > 1.0) && (UnitGetPropertyFixed(lp_aIUnit, c_unitPropLifePercent, c_unitPropCurrent) > 50.0) && (UnitGroupCount(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 3), c_unitCountAlive) <= 2)) {
return ;
}