# Ability Is Allowed For Player
Grammar — abilCmd is allowed for player p
Flags —Native
|Function
Returns true if an ability is allowed for the specified player. Use “Allow/Disallow Ability For Player” to modify this.
# Arguments
int
— Playerabilcmd
— Ability Command
Returns — bool
native bool TechTreeAbilityIsAllowed(
int player,
abilcmd inAbilCmd,
);
# 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/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:723
if ((libCamp_gf_StoryState(libCamp_ge_StoryStateID_StoryStateTipFactoryPlayed) == 0)) {
if ((TechTreeAbilityIsAllowed(1, AbilityCommand("TerranBuild", 10)) == true)) {
libCamp_gf_SetStoryState(libCamp_ge_StoryStateID_StoryStateTipFactoryPlayed, 1);
libCamp_gf_CreateTipFromConversationState("StoryTips|MissionNewStructureFactory", libNtve_ge_TipType_NewStructure, PlayerGroupAll());
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:732
if ((libCamp_gf_StoryState(libCamp_ge_StoryStateID_StoryStateTipStarportPlayed) == 0)) {
if ((TechTreeAbilityIsAllowed(1, AbilityCommand("TerranBuild", 11)) == true)) {
libCamp_gf_SetStoryState(libCamp_ge_StoryStateID_StoryStateTipStarportPlayed, 1);
libCamp_gf_CreateTipFromConversationState("StoryTips|MissionNewStructureStarport", libNtve_ge_TipType_NewStructure, PlayerGroupAll());
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7143
// Implementation
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
lv_allowDisallowBarracksTechLab = true;
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7143
// Implementation
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
lv_allowDisallowBarracksTechLab = true;
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7143
// Implementation
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
lv_allowDisallowBarracksTechLab = true;
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7143
// Implementation
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
lv_allowDisallowBarracksTechLab = true;
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7143
// Implementation
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
lv_allowDisallowBarracksTechLab = true;
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7149
lv_allowDisallowBarracksTechLab = false;
}
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 5)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 8)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
lv_allowDisallowFactory = true;
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7149
lv_allowDisallowBarracksTechLab = false;
}
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 5)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 8)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
lv_allowDisallowFactory = true;
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7149
lv_allowDisallowBarracksTechLab = false;
}
if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 5)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 8)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
lv_allowDisallowFactory = true;
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignLib.galaxy:5590
// Implementation
if ((AbilityCommandGetAbility(UserDataGetAbilCmd("CampaignPerk", lp_ability, "AbilityCommand", 1)) != null)) {
return TechTreeAbilityIsAllowed(1, UserDataGetAbilCmd("CampaignPerk", lp_ability, "AbilityCommand", 1));
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9790
// Automatic Variable Declarations
// Implementation
if ((lp_abilityCommand != null) && (TechTreeAbilityIsAllowed(lp_player, lp_abilityCommand) == false)) {
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:4660
if ((CatalogFieldValueGet(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Type")), lp_player) == "AbilCmd") && (CatalogFieldValueGetAsInt(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Row")), lp_player) == 0) && (CatalogFieldValueGetAsInt(c_gameCatalogUnit, "SoACaster", ((lv_path + ".Column")), lp_player) == (lp_slot-1))) {
lv_command = StringToAbilCmd(CatalogFieldValueGet(c_gameCatalogUnit, "SoACaster", ((lv_path + ".AbilCmd")), lp_player));
if ((TechTreeAbilityIsAllowed(lp_player, lv_command) == true)) {
return lv_command;
}