# Unit Alias Count For Player

GrammarunitType alias count for player player, counting countType
FlagsNative | Function

Returns the number of unit aliases, of a specific unit alias determined by the Unit parameter, owned by the chosen player. The Count Type will determine what state the units must be in to be considered for this function.

# Arguments

Returns — int

native int TechTreeUnitAliasCount(
	int player,
	string unitType,
	int countType,
);

Category: Tech Tree / Counts

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:6090

    // Automatic Variable Declarations
    // Variable Initialization
    lv_incomplete = TechTreeUnitAliasCount(lp_p, "Alias_TychusUniqueUnit", c_techCountIncompleteOnly);
    lv_completed = TechTreeBehaviorCount(lp_p, "TychusHeroCount", c_techCountCompleteOnly);

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/Common_ai.galaxy:21

}
int GetUnitCount(int player, string unitid){
    return TechTreeUnitAliasCount(player,unitid, c_techCountQueuedOrBetter);
}
int GetUnitCountDone(int player, string unitid){

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/Common_ai.galaxy:24

}
int GetUnitCountDone(int player, string unitid){
    return TechTreeUnitAliasCount(player,unitid, c_techCountCompleteOnly);
}
int TownCountEx(int player, string unitid, boolean only_done, integer townid){

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/Orc/Orc.galaxy:53

void StockHero(int player,int count,string aliasUnitType){
    //count = count - TechTreeUnitAliasCount(player, aliasUnitType, c_techCountRevivableOnly) - TechTreeUnitAliasCount(player, aliasUnitType, c_techCountQueuedOrBetter);
    count = count - TechTreeUnitAliasCount(player, aliasUnitType, c_techCountQueuedOrBetter);
    if(count<=0){return;}
    if(!GetUnitCountDone(player,"TALT")){return;}