# Behavior Count For Player

GrammarbehaviorType count for player player, counting countType
FlagsNative | Function

Returns the count for the specified behavior that the specified player’s units have.

# Arguments

  • int — Player
  • string<gamelink::Behavior> — Behavior
  • int<preset::TechTreeCountType> — Count Type

Returns — int

native int TechTreeBehaviorCount(
	int player,
	string behaviorType,
	int countType,
);

Category: Tech Tree / Counts

# Examples

campaigns/swarm.sc2campaignbase.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.sc2mapMapScript.galaxy:4002

        }

        if (!((TechTreeBehaviorCount(gv_pLAYER_01_USER, "InfestorDetectorRadarDetected", c_techCountQueuedOrBetter) >= 1))) {
            return false;
        }

campaigns/swarmstory.sc2campaignbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.stormdata/LibMDoE.galaxy:3091


    lv_spawnLocation = libGame_gf_HeroKilledLocation();
    if ((TechTreeBehaviorCount(lv_player, "MapMechanicStack", c_techCountCompleteOnly) <= 0)) {
        libMDoE_gf_HideDefenderTextTagsOnAllCannonsForPlayer(lv_player);
    }

mods/heroesdata.stormmodbase.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.stormmodbase.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.sc2modbase.sc2data/LibCOMI.galaxy:6068

    // Automatic Variable Declarations
    // Implementation
    if ((TechTreeBehaviorCount(lp_p, "TychusTier3Behavior", c_techCountCompleteOnly) > 0)) {
        return 3;
    }

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

    }

    if ((TechTreeBehaviorCount(lp_p, "TychusTier2Behavior", c_techCountCompleteOnly) > 0)) {
        return 2;
    }

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

    }

    if ((TechTreeBehaviorCount(lp_p, "TychusTier1Behavior", c_techCountCompleteOnly) > 0)) {
        return 1;
    }

mods/starcoop/starcoop.sc2modbase.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.sc2modbase.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;