# Tech Tree Behavior Count For Unit

Grammar — Count of behaviorType|Behavior at inUnit, counting countType
FlagsNative | Function

Returns the count of the specified behavior for the specified unit.

# Arguments

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

Returns — int

native int UnitTechTreeBehaviorCount(
	unit inUnit,
	string behaviorType,
	int countType,
);

Category: Tech Tree / Counts

# Examples

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:140

        }

        if (((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountQueuedOrBetter) >= 1))) {
            if ((lv_count < 240)) {
                lv_count += 1;

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:140

        }

        if (((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountQueuedOrBetter) >= 1))) {
            if ((lv_count < 240)) {
                lv_count += 1;

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:140

        }

        if (((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountQueuedOrBetter) >= 1))) {
            if ((lv_count < 240)) {
                lv_count += 1;

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1080


    // Implementation
    if (((libGame_gv_gameOver == true) || (TimerGetRemaining(libMHPP_gv_mHPPTransmissions.lv_approachingCheckpointWarningTimerCD) > 0.0)) && ((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountCompleteOnly) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountCompleteOnly) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountCompleteOnly) < 1))) {
        return true;
    }

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1080


    // Implementation
    if (((libGame_gv_gameOver == true) || (TimerGetRemaining(libMHPP_gv_mHPPTransmissions.lv_approachingCheckpointWarningTimerCD) > 0.0)) && ((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountCompleteOnly) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountCompleteOnly) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountCompleteOnly) < 1))) {
        return true;
    }

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1080


    // Implementation
    if (((libGame_gv_gameOver == true) || (TimerGetRemaining(libMHPP_gv_mHPPTransmissions.lv_approachingCheckpointWarningTimerCD) > 0.0)) && ((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountCompleteOnly) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountCompleteOnly) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountCompleteOnly) < 1))) {
        return true;
    }

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1288


    // Implementation
    if (((libGame_gv_gameOver == true) || (TimerGetRemaining(libMHPP_gv_mHPPTransmissions.lv_approachingDestinationWarningTimerCD) > 0.0)) && ((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountQueuedOrBetter) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountQueuedOrBetter) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountQueuedOrBetter) < 1))) {
        return true;
    }

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1288


    // Implementation
    if (((libGame_gv_gameOver == true) || (TimerGetRemaining(libMHPP_gv_mHPPTransmissions.lv_approachingDestinationWarningTimerCD) > 0.0)) && ((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountQueuedOrBetter) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountQueuedOrBetter) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountQueuedOrBetter) < 1))) {
        return true;
    }

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1288


    // Implementation
    if (((libGame_gv_gameOver == true) || (TimerGetRemaining(libMHPP_gv_mHPPTransmissions.lv_approachingDestinationWarningTimerCD) > 0.0)) && ((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountQueuedOrBetter) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountQueuedOrBetter) < 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountQueuedOrBetter) < 1))) {
        return true;
    }

mods/heroesbrawlmods/brawlmapmods/hanamurapayloadpush.stormmodbase.stormdata/LibMHPP.galaxy:1789

    }

    if (((UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior1", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior2", c_techCountQueuedOrBetter) >= 1) || (UnitTechTreeBehaviorCount(libMHPP_gv_payload.lv_payload, "PayloadAllyProximityBehavior3", c_techCountQueuedOrBetter) >= 1))) {
        libMHPP_gf_MHPPOvertime();
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3161

            }
            else {
                if ((UnitTechTreeBehaviorCount(lv_rexxar, "ShrubStatusController", c_techCountQueuedOrBetter) <= 0)) {
                    if ((DistanceBetweenPoints(UnitGetPosition(lv_misha), UnitGetPosition(lv_rexxar)) > 3.0) && ((OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) == AbilityCommand("attack", 0)) || (UnitOrderCount(lv_misha) == 0) || (DistanceBetweenPoints(OrderGetTargetPosition(UnitOrder(lv_misha, 0)), UnitGetPosition(lv_rexxar)) > 6.0))) {
                        UnitIssueOrder(lv_misha, OrderTargetingPoint(AbilityCommand("move", 0), PointWithOffsetPolar(UnitGetPosition(lv_rexxar), 3.0, libNtve_gf_RandomAngle())), c_orderQueueReplace);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3175

                }
                else {
                    if ((UnitTechTreeBehaviorCount(lv_misha, "ShrubStatusController", c_techCountQueuedOrBetter) == 0) && (OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) != AbilityCommand("move", 0))) {
                        UnitAbilityEnable(lv_misha, "attack", true);
                        lv_itNearbyShrubChecks = 0;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3258

        else {
            lv_autoAquired = true;
            if ((UnitTechTreeBehaviorCount(lv_rexxar, "ShrubStatusController", c_techCountQueuedOrBetter) > 0) && (UnitTechTreeBehaviorCount(lv_misha, "ShrubStatusController", c_techCountQueuedOrBetter) == 0) && (OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) != AbilityCommand("move", 0))) {
                lv_itNearbyShrubChecks = 0;
                for ( ; ( (auto817393C0_ai >= 0 && lv_itNearbyShrubChecks <= auto817393C0_ae) || (auto817393C0_ai < 0 && lv_itNearbyShrubChecks >= auto817393C0_ae) ) ; lv_itNearbyShrubChecks += auto817393C0_ai ) {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3258

        else {
            lv_autoAquired = true;
            if ((UnitTechTreeBehaviorCount(lv_rexxar, "ShrubStatusController", c_techCountQueuedOrBetter) > 0) && (UnitTechTreeBehaviorCount(lv_misha, "ShrubStatusController", c_techCountQueuedOrBetter) == 0) && (OrderGetAbilityCommand(UnitOrder(lv_misha, 0)) != AbilityCommand("move", 0))) {
                lv_itNearbyShrubChecks = 0;
                for ( ; ( (auto817393C0_ai >= 0 && lv_itNearbyShrubChecks <= auto817393C0_ae) || (auto817393C0_ai < 0 && lv_itNearbyShrubChecks >= auto817393C0_ae) ) ; lv_itNearbyShrubChecks += auto817393C0_ai ) {