# Commander Of Player
Grammar — Commander of player p
Flags —Native
|Function
Returns the commander of the player.
# Arguments
int
— Player
Returns — string
<gamelink::Commander>
native string PlayerCommander(int inPlayer);
# Related
Category: Player / Player Settings
- Modify Player Property (Integer) —
void
— PlayerModifyPropertyInt - Modify Player Property (Real) —
void
— PlayerModifyPropertyFixed - Player Property (Integer) —
int
— PlayerGetPropertyInt - Player Property (Real) —
fixed
— PlayerGetPropertyFixed - Modify Player Score (Integer) —
void
— PlayerScoreValueSetFromInt - Modify Player Score (Real) —
void
— PlayerScoreValueSetFromFixed - Player Score Value (Integer) —
int
— PlayerScoreValueGetAsInt - Player Score Value (Real) —
fixed
— PlayerScoreValueGetAsFixed - Turn Player Flag On/Off —
void
— PlayerSetState - Player Flag Check —
bool
— PlayerGetState - Player License Check —
bool
— PlayerHasLicense - Player Access Check —
bool
— PlayerHasAccessTo - Player Has Reward —
bool
— PlayerHasReward - Player Has Talent —
bool
— PlayerHasTalent - Name Of Player —
text
— PlayerName - Handle Of Player —
string
— PlayerHandle - Race Of Player —
string
<gamelink::Race> — PlayerRace - Hero Of Player —
string
<gamelink::Hero> — PlayerHero - Skin Of Player —
string
<gamelink::Skin> — PlayerSkin - Mount Of Player —
string
<gamelink::Mount> — PlayerMount - Spray Of Player —
string
<gamelink::Spray> — PlayerSpray - Artifact Of Player —
string
<gamelink::Artifact> — PlayerArtifact - Artifact Rank Of Player —
int
— PlayerArtifactRank - Commander Of Player —
string
<gamelink::Commander> — PlayerCommander - Commander Level Of Player —
int
— PlayerCommanderLevel - Commander Mastery Level Of Player —
int
— PlayerCommanderMasteryLevel - Commander Mastery Talent Rank Of Player —
int
— PlayerCommanderMasteryTalentRank - Commander Selected Prestige Of Player —
int
— PlayerCommanderSelectedPrestige - Brutal Plus Difficulty of Player —
int
— PlayerBrutalPlusDifficulty - Retry Mutation Index of Player —
int
— PlayerRetryMutation - Allied Commander Enemy Wave Type —
int
— PlayerACEnemyWaveType - Start Location Of Player —
point
— PlayerStartLocation - Controller Of Player —
int
<preset::PlayerController> — PlayerType - Status Of Player —
int
<preset::PlayerStatus> — PlayerStatus - Set Player Color —
void
— PlayerSetColorIndex - Set Player Race —
void
— PlayerSetRace - Set Player Hero —
void
— PlayerSetHero - Set Player Skin —
void
— PlayerSetSkin - Set Player Console Skin —
void
— PlayerSetConsoleSkin - Apply Player Skin —
void
— PlayerApplySkin - Apply Player Skin (Replacing Existing Unit) —
void
— libNtve_gf_PlayerApplySkinReplacingExistingUnit - Set Player Mount —
void
— PlayerSetMount - Set Player Spray —
void
— PlayerSetSpray - Set Player Commander —
void
— PlayerSetCommander - Set Player Commander Level —
void
— PlayerSetCommanderLevel - Set Player Commander Mastery Level —
void
— PlayerSetCommanderMasteryLevel - Set Player Death Timer —
void
— PlayerSetDeathTimer - Set Player Bounds —
void
— PlayerSetBounds - Add Player Talent —
void
— PlayerAddTalent - Remove Player Talent —
void
— PlayerRemoveTalent - Add Player Response —
void
— PlayerAddResponse - Remove Player Response —
void
— PlayerRemoveResponse - Clear Player Response —
void
— PlayerClearResponse - Player Color —
int
<playercolor> — PlayerGetColorIndex - Override Player Option —
void
— PlayerOptionOverride - Player Hotkey Profile —
string
— PlayerGetHotkeyProfile - Player Property Changed —
void
— TriggerAddEventPlayerPropChange - Player Joins Game —
void
— TriggerAddEventPlayerJoin - Player Leaves Game —
void
— TriggerAddEventPlayerLeft - Triggering Player —
int
— EventPlayer - Triggering Player Property —
int
<preset::Player_Property_Get> — EventPlayerProperty - Triggering Player Property Change (Integer) —
int
— EventPlayerPropertyChangeInt - Triggering Player Property Change (Real) —
fixed
— EventPlayerPropertyChangeFixed - Player Add Label —
void
— PlayerAddLabel - Player Remove Label —
void
— PlayerRemoveLabel - Player Remove All Labels —
void
— PlayerRemoveAllLabels - Player Has Label —
bool
— PlayerHasLabel - Player Add Reward —
void
— PlayerAddReward
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:8968
lv_i = 1;
for ( ; ( (auto583267D6_ai >= 0 && lv_i <= auto583267D6_ae) || (auto583267D6_ai < 0 && lv_i >= auto583267D6_ae) ) ; lv_i += auto583267D6_ai ) {
autoA8B54D99_val = PlayerCommander(lv_i);
if (autoA8B54D99_val == "Raynor") {
libCOMI_gv_playerColor[lv_i] = 2;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:10601
}
lv_adjutantRace = UserDataGetGameLink("PlayerCommanders", libCOOC_gf_CC_CommanderUserInstance(PlayerCommander(lv_indexPlayer)), "AdjutantRace", 1);
auto085E9DF9_val = lv_adjutantRace;
if (auto085E9DF9_val == "Terr") {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:12338
lv_indexPlayer = PlayerGroupNextPlayer(auto698A507A_g, lv_indexPlayer);
if (lv_indexPlayer < 0) { break; }
if ((lv_indexPlayer != 15) && (PlayerCommander(lv_indexPlayer) == null)) {
libNtve_gf_SetAllianceBetweenTwoPlayerGroups(PlayerGroupSingle(lv_indexPlayer), PlayerGroupSingle(15), libNtve_ge_AllianceSetting_Neutral);
libNtve_gf_SetAllianceBetweenTwoPlayerGroups(PlayerGroupSingle(15), PlayerGroupSingle(lv_indexPlayer), libNtve_ge_AllianceSetting_Neutral);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:12689
}
auto864A12EB_val = PlayerCommander(EventPlayer());
if (auto864A12EB_val == "Fenix") {
libNtve_gf_PlayerRemoveCooldown(EventPlayer(), "SOASummonFenix");
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:13397
}
if ((PlayerCommander(lv_dyingUnitPlayer) == "Horner")) {
lv_scrapPlayerDivisor = 5;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15150
// Conditions
if (testConds) {
if (!((PlayerCommander(UnitGetOwner(EventUnit())) == "Abathur"))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15409
// Conditions
if (testConds) {
if (!(((UnitGetType(EventUnit()) != "Locust") && (PlayerCommander(lv_killedPlayer) == "Abathur") && ((UnitHasBehavior2(EventUnit(), "BiomassBuff1") == true) || (UnitHasBehavior2(EventUnit(), "BiomassBuff10") == true) || (UnitHasBehavior2(EventUnit(), "BiomassBuff100") == true)) && (UnitFilterMatch(EventUnit(), 1, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), 0)) == true) && ((libNtve_gf_UnitIsHidden(EventUnit()) == false) || (EventUnitDamageEffect() == libCOMI_gv_cM_CargoDeathKillEffect)) && (lv_biomassRefundChance > 0.0)))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15450
// Conditions
if (testConds) {
if (!(((UnitGetType(EventUnit()) != "Locust") && (PlayerCommander(UnitGetOwner(EventUnit())) == "Abathur") && (UnitFilterMatch(EventUnit(), 1, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), (1 << (c_targetFilterHidden - 32)))) == true)))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15501
// Conditions
if (testConds) {
if (!(((PlayerCommander(UnitGetOwner(EventUnit())) == "Abathur") && ((UnitHasBehavior2(EventUnit(), "BiomassBuff1") == true) || (UnitHasBehavior2(EventUnit(), "BiomassBuff10") == true) || (UnitHasBehavior2(EventUnit(), "BiomassBuff100") == true)) && ((libNtve_gf_TriggeringProgressUnitType() == "RavagerAbathur") || (libNtve_gf_TriggeringProgressUnitType() == "GuardianMP") || (libNtve_gf_TriggeringProgressUnitType() == "Devourer"))))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15565
// Conditions
if (testConds) {
if (!(((UnitIsAlive(EventUnit()) == true) && (PlayerCommander(UnitGetOwner(EventUnit())) == "Abathur") && ((UnitHasBehavior2(EventUnit(), "BiomassBuff1") == true) || (UnitHasBehavior2(EventUnit(), "BiomassBuff10") == true) || (UnitHasBehavior2(EventUnit(), "BiomassBuff100") == true))))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:1957
}
if ((PlayerCommander(lp_player) != libCOOC_gf_CC_CommanderData(lp_commander))) {
PlayerSetCommander(lp_player, libCOOC_gf_CC_CommanderData(lp_commander));
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:4121
else if ((PlayerRace(lp_player) == "Prot") && (libCOOC_gf_ActiveCommanderForPlayer(lp_player) == "ProtossZeratul")) {
}
else if ((PlayerRace(lp_player) == "Prot") && (PlayerCommander(lp_player) == "Alarak")) {
TechTreeAbilityAllow(lp_player, AbilityCommand("ForgeResearch", 17), true);
TechTreeAbilityAllow(lp_player, AbilityCommand("ForgeResearch", 18), true);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:4519
TextExpressionSetToken("Param/Expression/lib_COOC_D5B22955", "A", IntToText(lp_player));
TextExpressionSetToken("Param/Expression/lib_COOC_D5B22955", "B", PlayerName(lp_player));
TextExpressionSetToken("Param/Expression/lib_COOC_D5B22955", "C", StringToText((PlayerCommander(lp_player))));
TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_COOC_D5B22955"), false);
lv_chosenCommander = libCOOC_gf_CC_CommanderUserInstance(PlayerCommander(lp_player));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:4521
TextExpressionSetToken("Param/Expression/lib_COOC_D5B22955", "C", StringToText((PlayerCommander(lp_player))));
TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_COOC_D5B22955"), false);
lv_chosenCommander = libCOOC_gf_CC_CommanderUserInstance(PlayerCommander(lp_player));
libCOOC_gf_CC_PlayerCommanderSet(lp_player, lv_chosenCommander);
if ((PlayerRace(lp_player) != libCOOC_gf_CC_CommanderRace(lv_chosenCommander))) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:5257
// Automatic Variable Declarations
// Implementation
if ((PlayerCommander(lp_player) != null)) {
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:8445
}
if (!((PlayerCommander(EventUnitDamageSourcePlayer()) == "Mengsk"))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:1045
// Implementation
if ((libCOOC_gf_CC_PlayerActivePrestigeIndex(lp_player) == 0) && (CatalogEntryIsValid(c_gameCatalogCommander, PlayerCommander(lp_player)) == true)) {
lv_playerPrestigeText = StringExternal(CatalogFieldValueGet(c_gameCatalogCommander, PlayerCommander(lp_player), "Description", c_playerAny));
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:1046
// Implementation
if ((libCOOC_gf_CC_PlayerActivePrestigeIndex(lp_player) == 0) && (CatalogEntryIsValid(c_gameCatalogCommander, PlayerCommander(lp_player)) == true)) {
lv_playerPrestigeText = StringExternal(CatalogFieldValueGet(c_gameCatalogCommander, PlayerCommander(lp_player), "Description", c_playerAny));
}
else if ((libCOOC_gf_CC_PlayerActivePrestigeIndex(lp_player) == 0)) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:1051
lv_playerPrestigeText = null;
}
if ((libCOOC_gf_CC_PlayerActivePrestigeIndex(lv_playerAlly) == 0) && (CatalogEntryIsValid(c_gameCatalogCommander, PlayerCommander(lv_playerAlly)) == true)) {
lv_playerAllyPrestigeText = StringExternal(CatalogFieldValueGet(c_gameCatalogCommander, PlayerCommander(lv_playerAlly), "Description", c_playerAny));
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:1052
}
if ((libCOOC_gf_CC_PlayerActivePrestigeIndex(lv_playerAlly) == 0) && (CatalogEntryIsValid(c_gameCatalogCommander, PlayerCommander(lv_playerAlly)) == true)) {
lv_playerAllyPrestigeText = StringExternal(CatalogFieldValueGet(c_gameCatalogCommander, PlayerCommander(lv_playerAlly), "Description", c_playerAny));
}
else if ((libCOOC_gf_CC_PlayerActivePrestigeIndex(lv_playerAlly) == 0)) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:1612
lv_itemIndex = 0;
for ( ; ( (auto606ADCEC_ai >= 0 && lv_itemIndex <= auto606ADCEC_ae) || (auto606ADCEC_ai < 0 && lv_itemIndex >= auto606ADCEC_ae) ) ; lv_itemIndex += auto606ADCEC_ai ) {
lv_face = libCOOC_gf_CC_CommanderPrestigeIndexFace(PlayerCommander(lp_player), lv_itemIndex);
libNtve_gf_SetDialogItemImage(libCOUI_gv_cU_PrestigeSelectors[lv_itemIndex].lv_icon, (CatalogFieldValueGet(c_gameCatalogButton, lv_face, "Icon", c_playerAny)), PlayerGroupSingle(lp_player));
libNtve_gf_SetDialogItemTooltip(libCOUI_gv_cU_PrestigeSelectors[lv_itemIndex].lv_button, libCOOC_gf_TooltipTextofButton(lp_player, lv_face), PlayerGroupSingle(lp_player));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:2250
// Automatic Variable Declarations
// Variable Initialization
lv_face = libCOOC_gf_CC_CommanderPrestigeIndexFace(PlayerCommander(lp_player), libCOOC_gf_CC_PlayerActivePrestigeIndex(lp_player));
// Implementation
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:4777
}
if ((PlayerCommander(lp_player) == "Tychus")) {
auto6AE23501_g = UnitGroup("TychusMedivacPlatform", lp_player, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto6AE23501_u = UnitGroupCount(auto6AE23501_g, c_unitCountAll);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:4790
}
if ((PlayerCommander(lp_player) == "Zeratul")) {
UnitGroupAdd(libCOUI_gv_cU_GPCasterGroupSecondary[lp_player], libCOMI_gv_cM_GlobalCasterUnitSecondary[lp_player]);
libNtve_gf_SetDialogItemUnitGroup(libCOUI_gv_cU_ZeratulSelectionCmdPanel, libCOUI_gv_cU_GPCasterGroupSecondary[lp_player], PlayerGroupSingle(lp_player));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:4795
}
if ((PlayerCommander(lp_player) == "Mengsk")) {
UnitSetPropertyFixed(lp_casterUnit, c_unitPropEnergy, RoundI(UnitGetPropertyFixed(lp_casterUnit, c_unitPropEnergy, c_unitPropCurrent)));
libCOMI_gf_CM_Mengsk_EnergyChanged(lp_player);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:4823
// Variable Initialization
lv_updatePlayers = PlayerGroupEmpty();
lv__2DGlobalPanel = UserDataGetInt("PlayerCommanders", libCOOC_gf_CC_CommanderUserInstance(PlayerCommander(lp_player)), "GlobalCast2D", 1);
// Implementation