# Behavior Count For Player
Grammar — behaviorType count for player player, counting countType
Flags —Native
|Function
Returns the count for the specified behavior that the specified player’s units have.
# Arguments
int
— Playerstring
<gamelink::Behavior> — Behaviorint
<preset::TechTreeCountType> — Count Type
Returns — int
native int TechTreeBehaviorCount(
int player,
string behaviorType,
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
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map/MapScript.galaxy:4002
}
if (!((TechTreeBehaviorCount(gv_pLAYER_01_USER, "InfestorDetectorRadarDetected", c_techCountQueuedOrBetter) >= 1))) {
return false;
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map — MapScript.galaxy:4002
}
if (!((TechTreeBehaviorCount(gv_pLAYER_01_USER, "InfestorDetectorRadarDetected", c_techCountQueuedOrBetter) >= 1))) {
return false;
}
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:17294
}
if ((TechTreeBehaviorCount(1, "ZerglingRespawnPrimary", c_techCountCompleteOnly) == 0)) {
lv_hatcheryGroup = UnitGroup("Hive", 1, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
UnitGroupAddUnitGroup(lv_hatcheryGroup, UnitGroup("Lair", 1, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmod — base.stormdata/LibMDoE.galaxy:911
lv_itPlayer = PlayerGroupNextPlayer(auto367C004B_g, lv_itPlayer);
if (lv_itPlayer<0) { break; }
if ((TechTreeBehaviorCount(lv_itPlayer, "MapMechanicStack", c_techCountCompleteOnly) >= 1)) {
TextTagSetText(libCore_gf_TextTagStoredForUnit(autoD89CBBED_var, libGame_gv_teamChaosIndex_C), StringExternal("Param/Value/lib_MDoE_2AD56E6B"));
TextTagShow(libCore_gf_TextTagStoredForUnit(autoD89CBBED_var, libGame_gv_teamChaosIndex_C), PlayerGroupSingle(lv_itPlayer), true);
mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmod — base.stormdata/LibMDoE.galaxy:2843
TextTagShow(libCore_gf_TextTagStoredForUnit(lv_handInHeroUnit2, libGame_gv_teamChaosIndex_C), PlayerGroupAll(), false);
Wait(0.0625, c_timeGame);
if ((TechTreeBehaviorCount(lv_handInPlayer, "MapMechanicStack", c_techCountCompleteOnly) <= 0)) {
libMDoE_gf_HideDefenderTextTagsOnAllCannonsForPlayer(lv_handInPlayer);
}
mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmod — base.stormdata/LibMDoE.galaxy:3091
lv_spawnLocation = libGame_gf_HeroKilledLocation();
if ((TechTreeBehaviorCount(lv_player, "MapMechanicStack", c_techCountCompleteOnly) <= 0)) {
libMDoE_gf_HideDefenderTextTagsOnAllCannonsForPlayer(lv_player);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/UILib.galaxy:6948
// Automatic Variable Declarations
// Implementation
if (((PlayerHasTalent(lp_player, "GuldanDarkBargain") == true) || (TechTreeBehaviorCount(lp_player, "MalthaelNoOneCanStopDeathActivated", c_techCountQueuedOrBetter) == 1))) {
return true;
}
mods/heroesmapmods/battlegroundmapmods/blackheartsbay.stormmod — base.stormdata/LibBBAY.galaxy:1443
lv_itPlayer = 1;
for ( ; ( (auto49362910_ai >= 0 && lv_itPlayer <= auto49362910_ae) || (auto49362910_ai < 0 && lv_itPlayer >= auto49362910_ae) ) ; lv_itPlayer += auto49362910_ai ) {
if ((TechTreeBehaviorCount(lv_itPlayer, "MapMechanicStack", c_techCountCompleteOnly) > 0)) {
UnitSetStateForPlayer(libBBAY_gv_mMBBCannonballsGhostShipCaptain, c_unitStateTargetable, lv_itPlayer, true);
UnitSetStateForPlayer(libBBAY_gv_mMBBCannonballsGhostShipBeacon, c_unitStateTargetable, lv_itPlayer, true);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6068
// Automatic Variable Declarations
// Implementation
if ((TechTreeBehaviorCount(lp_p, "TychusTier3Behavior", c_techCountCompleteOnly) > 0)) {
return 3;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6072
}
if ((TechTreeBehaviorCount(lp_p, "TychusTier2Behavior", c_techCountCompleteOnly) > 0)) {
return 2;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6076
}
if ((TechTreeBehaviorCount(lp_p, "TychusTier1Behavior", c_techCountCompleteOnly) > 0)) {
return 1;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6091
// Variable Initialization
lv_incomplete = TechTreeUnitAliasCount(lp_p, "Alias_TychusUniqueUnit", c_techCountIncompleteOnly);
lv_completed = TechTreeBehaviorCount(lp_p, "TychusHeroCount", c_techCountCompleteOnly);
// Implementation
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:29994
lv_closestHatchery = null;
lv_distance = 500.0;
if (((TechTreeBehaviorCount(lv_indexPlayer, "ZerglingRespawnPrimary", c_techCountCompleteOnly) == 0) || (libCOMI_gf_CM_PrimaryTownHall(lv_indexPlayer) == null))) {
lv_hatcheryGroup = libCOOC_gf_CC_TownHallsForPlayer(lv_indexPlayer);
auto1A7E7594_g = lv_hatcheryGroup;