# Known Unit Count
Grammar — Get the number of units of type unitType owned by player otherPlayer that have been seen by the specified player player
Flags —Native
|Function
Returns the number of units of of the specified unit type owned by another player that have been seen by the specified player.
# Arguments
int
— Playerint
— OtherPlayerstring
[ gamelink::Unit ] — UnitType
Returns — int
native int AIKnownUnitCount(
int player,
int testPlayerId,
string aliasUnitType,
);
# Related
Category: AI Advanced / Construction / Functions
- [F] —
int
— Get Default Build Flags — ( ) - [F] —
bool
— Player Has Resources — ( AIHasRes ) - [F] —
int
— Tech Count — ( AITechCount ) - [F] —
int
— Known Unit Count — ( AIKnownUnitCount ) - [F] —
point
— Get AI Suggested Build Loc — ( AIGetBuildingPlacement )
# Examples
# mods/core.sc2mod
// L453
AIKnownUnitCount(player, c_maxPlayers, c_ZB_RoachWarren)
// L454
AIKnownUnitCount(player, c_maxPlayers, c_ZB_BanelingNest)
// L455
AIKnownUnitCount(player, c_maxPlayers, c_PB_Gateway)
// L456
AIKnownUnitCount(player, c_maxPlayers, c_TB_Barracks)
// L461
AIKnownUnitCount(player, c_maxPlayers, c_PB_Gateway)
// L462
AIKnownUnitCount(player, c_maxPlayers, c_TB_Barracks)
// L467
AIKnownUnitCount(player, c_maxPlayers, c_ZB_SpawningPool)
// L515
AIKnownUnitCount(player, c_maxPlayers, c_TB_Bunker)
// L516
AIKnownUnitCount(player, c_maxPlayers, c_PB_PhotonCannon)
// L517
AIKnownUnitCount(player, c_maxPlayers, c_ZB_SpineCrawler)
// L453
AIKnownUnitCount(player, c_maxPlayers, c_ZB_RoachWarren)
// L454
AIKnownUnitCount(player, c_maxPlayers, c_ZB_BanelingNest)
// L455
AIKnownUnitCount(player, c_maxPlayers, c_PB_Gateway)
// L456
AIKnownUnitCount(player, c_maxPlayers, c_TB_Barracks)
// L461
AIKnownUnitCount(player, c_maxPlayers, c_PB_Gateway)
// L462
AIKnownUnitCount(player, c_maxPlayers, c_TB_Barracks)
// L467
AIKnownUnitCount(player, c_maxPlayers, c_ZB_SpawningPool)
// L515
AIKnownUnitCount(player, c_maxPlayers, c_TB_Bunker)
// L516
AIKnownUnitCount(player, c_maxPlayers, c_PB_PhotonCannon)
// L517
AIKnownUnitCount(player, c_maxPlayers, c_ZB_SpineCrawler)