# Upgrade Is Allowed For Player
Grammar — inUpgrade is allowed for player inPlayer
Flags —Native
|Function
Returns true if an upgrade is allowed for the specified player. Use “Allow/Disallow Upgrade For Player” to modify this.
# Arguments
int
— Playerstring
<gamelink::Upgrade> — Upgrade
Returns — bool
native bool TechTreeUpgradeIsAllowed(
int player,
string upgradeType,
);
# Related
Category: Tech Tree / Individual Restrictions
- Specific Requirements Are Enabled For Player —
bool
— TechTreeSpecificRequirementEnabled - Enable/Disable SpecificTech Tree Requirements —
void
— TechTreeSpecificRequirementEnable - Allow/Disallow Behavior For Player —
void
— TechTreeBehaviorAllow - Allow/Disallow Ability For Player —
void
— TechTreeAbilityAllow - Allow/Disallow Unit For Player —
void
— TechTreeUnitAllow - Allow/Disallow Upgrade For Player —
void
— TechTreeUpgradeAllow - Ability Is Allowed For Player —
bool
— TechTreeAbilityIsAllowed - Behavior Is Allowed For Player —
bool
— TechTreeBehaviorIsAllowed - Unit Is Allowed For Player —
bool
— TechTreeUnitIsAllowed - Upgrade Is Allowed For Player —
bool
— TechTreeUpgradeIsAllowed - Add Upgrade Level For Player —
void
— TechTreeUpgradeAddLevel - Set Upgrade Level For Player —
void
— libNtve_gf_SetUpgradeLevelForPlayer - Set Production Cap For Player —
void
— TechTreeSetProduceCap - Production Cap For Player —
int
— TechTreeGetProduceCap
# Examples
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignLib.galaxy:1506
// Implementation
libVoiC_gf_PC_UpdateWeaponArmorUpgrades(1);
if ((TechTreeUpgradeIsAllowed(1, "ProtossAirWeaponsLevel1") == true) && (libVoiC_gv_pCX_UpgradesTaught == false)) {
libVoiC_gv_pCX_UpgradesTaught = true;
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:3477
Wait(0.1, c_timeGame);
}
if ((libVoiC_gv_pCX_UpgradesTaught == false) && (libVCMI_gv_pM_UpgradeUnit == null) && (UnitGetType(lp_teachUnit) == "CyberneticsCore") && (TechTreeUpgradeIsAllowed(1, "ProtossAirWeaponsLevel1") == true) && (libVoiC_gf_PC_CampaignInEpilogue() == false)) {
if ((libNtve_gf_UnitIsUnderConstruction(lp_teachUnit) == true)) {
while (true) {