# Set Production Cap For Player

Grammar — Limit player p to only be able to produce cap production in cat category
FlagsNative | Action

Use -1 to remove the cap of the production.

# Arguments

  • int — Player
  • string<anygamelink> — Production
  • int<preset::TechTreeCategory> — Category
  • int — Cap

Returns — void

native void TechTreeSetProduceCap(
	int p,
	string production,
	int cat,
	int cap,
);

Category: Tech Tree / Individual Restrictions

# Examples

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

    // Automatic Variable Declarations
    // Implementation
    TechTreeSetProduceCap(lp_player, "Alias_TychusUniqueUnit", c_techCatUnit, libCOMI_gv_cM_Tychus_MaxHeroCount);
    TechTreeSetProduceCap(lp_player, "TychusCoop", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusReaper", c_techCatUnit, 1);

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

    // Implementation
    TechTreeSetProduceCap(lp_player, "Alias_TychusUniqueUnit", c_techCatUnit, libCOMI_gv_cM_Tychus_MaxHeroCount);
    TechTreeSetProduceCap(lp_player, "TychusCoop", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusReaper", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusWarhound", c_techCatUnit, 1);

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

    TechTreeSetProduceCap(lp_player, "Alias_TychusUniqueUnit", c_techCatUnit, libCOMI_gv_cM_Tychus_MaxHeroCount);
    TechTreeSetProduceCap(lp_player, "TychusCoop", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusReaper", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusWarhound", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusFirebat", c_techCatUnit, 1);

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

    TechTreeSetProduceCap(lp_player, "TychusCoop", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusReaper", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusWarhound", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusFirebat", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusHERC", c_techCatUnit, 1);

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

    TechTreeSetProduceCap(lp_player, "TychusReaper", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusWarhound", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusFirebat", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusHERC", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusMarauder", c_techCatUnit, 1);

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

    TechTreeSetProduceCap(lp_player, "TychusWarhound", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusFirebat", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusHERC", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusMarauder", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusGhost", c_techCatUnit, 1);

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

    TechTreeSetProduceCap(lp_player, "TychusFirebat", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusHERC", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusMarauder", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusGhost", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusSpectre", c_techCatUnit, 1);

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

    TechTreeSetProduceCap(lp_player, "TychusHERC", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusMarauder", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusGhost", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusSpectre", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusMedic", c_techCatUnit, 1);

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

    TechTreeSetProduceCap(lp_player, "TychusMarauder", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusGhost", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusSpectre", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusMedic", c_techCatUnit, 1);
}

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

    TechTreeSetProduceCap(lp_player, "TychusGhost", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusSpectre", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TychusMedic", c_techCatUnit, 1);
}

mods/warcoop/warclassic.sc2modbase.sc2data/TriggerLibs/WarClassic.galaxy:1140

        }

        TechTreeSetProduceCap(lv_p, "uske", c_techCatUnit, libGAw3_gv_bj_MAX_SKELETONS);
    }
    return true;

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:259

        for ( ; autoACA08899_i <= UserDataInstanceCount(autoACA08899_userType) ; autoACA08899_i += 1 ) {
            lv_itLimitInstance = UserDataInstance(autoACA08899_userType, autoACA08899_i);
            TechTreeSetProduceCap(lv_p, UserDataGetGameLink("MeleeSetting_HeroLimit", lv_itLimitInstance, "Hero", 1), c_techCatUnit, UserDataGetInt("MeleeSetting_HeroLimit", lv_itLimitInstance, "Limit", 1));
        }
    }

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:2073

    PlayerSetCommander(lp_player, lv_commander);
    TechTreeUpgradeAddLevel(lp_player, "WarcraftCommander", 1);
    TechTreeSetProduceCap(lp_player, "_CoopHero", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TALT", c_techCatUnit, 1);
    TechTreeRestrictionsEnable(lp_player, true);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:2074

    TechTreeUpgradeAddLevel(lp_player, "WarcraftCommander", 1);
    TechTreeSetProduceCap(lp_player, "_CoopHero", c_techCatUnit, 1);
    TechTreeSetProduceCap(lp_player, "TALT", c_techCatUnit, 1);
    TechTreeRestrictionsEnable(lp_player, true);
    auto7F49E592_ae = (CatalogFieldValueCount(c_gameCatalogCommander, lv_commander, "DataCollectionAllowed", lp_player) - 1);