# Units In Waves With Target

Grammar — Units owned by player player in waves targeting waveTarget|Wave Target
FlagsNative | Function

Returns a group of all the units owned by a player in any waves that are targeting the specified wave target.

# Arguments

  • int — Player
  • wavetarget — WaveTarget

Returns — unitgroup

native unitgroup AIGetUnitsInWavesWithTarget(
	int player,
	wavetarget target,
);

Category: AI / MiscCampaign / Functions

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttychus03.sc2map/MapScript.galaxy:1205

    TimerWindowShow(gv_kerrigansETAWINDOW, PlayerGroupAll(), false);
    TriggerExecute(gt_ObjectiveDestroyDataUpdate, true, true);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(100))), lv_guardUnits);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(1))), lv_guardUnits);
    UnitGroupIssueOrder(lv_guardUnits, OrderTargetingPoint(AbilityCommand("move", 0), RegionRandomPoint(RegionFromId(5))), c_orderQueueAddToEnd);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttychus03.sc2map/MapScript.galaxy:1206

    TriggerExecute(gt_ObjectiveDestroyDataUpdate, true, true);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(100))), lv_guardUnits);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(1))), lv_guardUnits);
    UnitGroupIssueOrder(lv_guardUnits, OrderTargetingPoint(AbilityCommand("move", 0), RegionRandomPoint(RegionFromId(5))), c_orderQueueAddToEnd);
    PingDestroy(gv_pINGSite1);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttychus03.sc2mapMapScript.galaxy:1205

    TimerWindowShow(gv_kerrigansETAWINDOW, PlayerGroupAll(), false);
    TriggerExecute(gt_ObjectiveDestroyDataUpdate, true, true);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(100))), lv_guardUnits);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(1))), lv_guardUnits);
    UnitGroupIssueOrder(lv_guardUnits, OrderTargetingPoint(AbilityCommand("move", 0), RegionRandomPoint(RegionFromId(5))), c_orderQueueAddToEnd);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttychus03.sc2mapMapScript.galaxy:1206

    TriggerExecute(gt_ObjectiveDestroyDataUpdate, true, true);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(100))), lv_guardUnits);
    libNtve_gf_AddUnitGroupToUnitGroup(AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(1))), lv_guardUnits);
    UnitGroupIssueOrder(lv_guardUnits, OrderTargetingPoint(AbilityCommand("move", 0), RegionRandomPoint(RegionFromId(5))), c_orderQueueAddToEnd);
    PingDestroy(gv_pINGSite1);

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zkorhal03.sc2map/MapScript.galaxy:3663

        Wait(1.0, c_timeAI);
    }
    lv_attackGroup = AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)));
    auto6FC17D8E_g = lv_attackGroup;
    auto6FC17D8E_u = UnitGroupCount(auto6FC17D8E_g, c_unitCountAll);

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zkorhal03.sc2map/MapScript.galaxy:3788

        Wait(1.0, c_timeAI);
    }
    lv_attackGroup = AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)));
    auto44B49985_g = lv_attackGroup;
    auto44B49985_u = UnitGroupCount(auto44B49985_g, c_unitCountAll);

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zkorhal03.sc2mapMapScript.galaxy:3663

        Wait(1.0, c_timeAI);
    }
    lv_attackGroup = AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)));
    auto6FC17D8E_g = lv_attackGroup;
    auto6FC17D8E_u = UnitGroupCount(auto6FC17D8E_g, c_unitCountAll);

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zkorhal03.sc2mapMapScript.galaxy:3788

        Wait(1.0, c_timeAI);
    }
    lv_attackGroup = AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)));
    auto44B49985_g = lv_attackGroup;
    auto44B49985_u = UnitGroupCount(auto44B49985_g, c_unitCountAll);