# Unit Alias Count For Player
Grammar — unitType alias count for player player, counting countType
Flags —Native
|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
int
— Playerstring
— Unitint
<preset::TechTreeCountType> — Count Type
Returns — int
native int TechTreeUnitAliasCount(
int player,
string unitType,
int countType,
);
# Related
Category: Tech Tree / Counts
- Behavior Count For Player —
int
— TechTreeBehaviorCount - Ability Count For Player —
int
— TechTreeAbilityCount - Unit Count For Player —
int
— TechTreeUnitCount - Unit Alias Count For Player —
int
— TechTreeUnitAliasCount - Upgrade Count For Player —
int
— TechTreeUpgradeCount - Tech Tree Behavior Count For Unit —
int
— UnitTechTreeBehaviorCount - Tech Tree Unit Count For Unit —
int
— UnitTechTreeUnitCount - Tech Tree Upgrade Count For Unit —
int
— UnitTechTreeUpgradeCount
# Examples
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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;}