# 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.sc2campaign

MapScript.galaxy

// L1205
AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(100)))
// L1206
AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(1)))
// L1205
AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(100)))
// L1206
AIGetUnitsInWavesWithTarget(gv_p02_ZERG, AIWaveTargetPoint(PointFromId(1)))
// L3663
AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)))
// L3788
AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)))
// L3663
AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)))
// L3788
AIGetUnitsInWavesWithTarget(gv_PLAYER_02_DOMINION_RED, AIWaveTargetPoint(PointFromId(2)))