# Player Color
Grammar — option|Current/Default player player color
Flags —Native
|Function
Returns the player color of the player.
# Arguments
int
— Playerbool
<preset::PlayerColorOption> — Option
Returns — int
<playercolor>
native int PlayerGetColorIndex(
int inPlayer,
bool inDefault,
);
# 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
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zchar01.sc2map/MapScript.galaxy:842
auto09291B66_var = UnitGroupUnitFromEnd(auto09291B66_g, auto09291B66_u);
if (auto09291B66_var == null) { break; }
UnitSetTeamColorIndex(auto09291B66_var, PlayerGetColorIndex(gv_pLAYER_02_ZERG, false));
}
auto9DF72A04_g = UnitGroup("InfestedCC", gv_pLAYER_02_ZERG2, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map/MapScript.galaxy:811
UnitSetState(lp_cHOSEN_UNIT, c_unitStateTargetable, true);
libNtve_gf_RescueUnit(lp_cHOSEN_UNIT, gv_pLAYER_01_USER, true);
UnitSetTeamColorIndex(lp_cHOSEN_UNIT, PlayerGetColorIndex(gv_pLAYER_01_USER, false));
SoundPlayAtPoint(SoundLink("Event_Expedition01_FreeRoachVox", -1), PlayerGroupAll(), UnitGetPosition(lp_cHOSEN_UNIT), 0.0, 100.0, 0.0);
if (((UnitGroupCount(UnitGroup(null, gv_pLAYER_01_USER, RegionCircle(UnitGetPosition(lp_cHOSEN_UNIT), 6.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterSummoned - 32))), 1), c_unitCountAlive) == 0) || (UnitGetOwner(lp_cHOSEN_UNIT) != gv_pLAYER_02_RESCUE_ZERG))) {
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar01.sc2map — MapScript.galaxy:842
auto09291B66_var = UnitGroupUnitFromEnd(auto09291B66_g, auto09291B66_u);
if (auto09291B66_var == null) { break; }
UnitSetTeamColorIndex(auto09291B66_var, PlayerGetColorIndex(gv_pLAYER_02_ZERG, false));
}
auto9DF72A04_g = UnitGroup("InfestedCC", gv_pLAYER_02_ZERG2, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition01.sc2map — MapScript.galaxy:811
UnitSetState(lp_cHOSEN_UNIT, c_unitStateTargetable, true);
libNtve_gf_RescueUnit(lp_cHOSEN_UNIT, gv_pLAYER_01_USER, true);
UnitSetTeamColorIndex(lp_cHOSEN_UNIT, PlayerGetColorIndex(gv_pLAYER_01_USER, false));
SoundPlayAtPoint(SoundLink("Event_Expedition01_FreeRoachVox", -1), PlayerGroupAll(), UnitGetPosition(lp_cHOSEN_UNIT), 0.0, 100.0, 0.0);
if (((UnitGroupCount(UnitGroup(null, gv_pLAYER_01_USER, RegionCircle(UnitGetPosition(lp_cHOSEN_UNIT), 6.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterSummoned - 32))), 1), c_unitCountAlive) == 0) || (UnitGetOwner(lp_cHOSEN_UNIT) != gv_pLAYER_02_RESCUE_ZERG))) {
mods/core.sc2mod — base.sc2data/TriggerLibs/DebugAI.galaxy:26
1,
StringToText("[") +
PlayerColorName(PlayerGetColorIndex(player, false)) +
StringToText("] ") +
StringToText(s),
mods/core.stormmod — base.stormdata/TriggerLibs/DebugAI.galaxy:26
1,
StringToText("[") +
PlayerColorName(PlayerGetColorIndex(player, false)) +
StringToText("] ") +
StringToText(s),
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:10018
// Automatic Variable Declarations
// Implementation
return libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(libGame_gf_ComputerPlayerInTeam(lp_team), false));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3795
}
else {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(0, false)));
}
}
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:155
}
libNtve_gf_CreatePingFacingAngle(lv_pingPlayers, lv_pingMinimapModel, lp_pingLocation, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false)), 5.0, 270.0);
PingSetScale(PingLastCreated(), lv_pingScale);
SoundPlayForPlayer(lv_pingSound, c_maxPlayers, lv_pingPlayers, 100.0, 0.0);
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:242
}
libNtve_gf_CreatePingFacingAngle(lv_pingPlayers, lv_pingMinimapModel, lp_pingTargetPosition, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false)), 5.0, 270.0);
PingSetScale(PingLastCreated(), lv_pingScale);
SoundPlayForPlayer(lv_pingSound, c_maxPlayers, lv_pingPlayers, 100.0, 0.0);
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:335
DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
libLbty_gv_meleeSurrender_Title[lp_player] = DialogControlLastCreated();
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), (TextWithColor(PlayerName(lp_player), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false))) + StringExternal("Param/Value/lib_Lbty_1D191C56")), PlayerGroupAll());
DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 360, 50);
libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "AISurrenderTitle", PlayerGroupAll());
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:760
libCOUI_gv_cU_CommanderAccountNameAlly = DialogControlLastCreated();
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(1), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(2), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(1));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:762
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(2), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(1));
DialogControlHookup(libCOUI_gv_cU_CommanderPanel, c_triggerControlTypeLabel, "AccountLabelSelf");
libCOUI_gv_cU_CommanderAccountNameSelf = DialogControlLastCreated();
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:766
libCOUI_gv_cU_CommanderAccountNameSelf = DialogControlLastCreated();
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(2), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(1), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(1));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:768
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(1), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(1));
DialogControlHookup(libCOUI_gv_cU_CommanderPanel, c_triggerControlTypeButton, "ReadyButton");
libCOUI_gv_cU_CommanderReadyButton = DialogControlLastCreated();
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:973
libNtve_gf_SetDialogItemPaused(libCOUI_gv_cU_CommanderButtonPortrait[lv_commIndex], false, lv_playerSelf);
DialogControlSetVisible(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libCOOC_gv_cC_HumanPlayerGroup, true);
libNtve_gf_SetDialogItemColor(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false)), libCOOC_gv_cC_HumanPlayerGroup);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:984
libNtve_gf_SetDialogItemPaused(libCOUI_gv_cU_CommanderButtonPortrait[lv_commIndex], false, libCOOC_gv_cC_HumanPlayerGroup);
DialogControlSetVisible(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libCOOC_gv_cC_HumanPlayerGroup, true);
libNtve_gf_SetDialogItemColor(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(libCOOC_gf_CC_PlayerAlly(lp_player), false)), libCOOC_gv_cC_HumanPlayerGroup);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:5988
lv_mapScale = (lv_baseMapSize / MaxF(libNtve_gf_WidthOfRegion(RegionPlayableMap()), libNtve_gf_HeightOfRegion(RegionPlayableMap())));
lv_mapScale = (lv_mapScale * lv_baseScale);
libNtve_gf_CreatePingFacingAngle(PlayerGroupSingle(1), "PingViewArea", CameraGetTarget(2), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), 0.0, 270.0);
PingSetScale(PingLastCreated(), lv_mapScale);
libCOUI_gv_cU_MinimapAllyViewPing[1] = PingLastCreated();
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:5991
PingSetScale(PingLastCreated(), lv_mapScale);
libCOUI_gv_cU_MinimapAllyViewPing[1] = PingLastCreated();
libNtve_gf_CreatePingFacingAngle(PlayerGroupSingle(2), "PingViewArea", CameraGetTarget(1), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), 0.0, 270.0);
PingSetScale(PingLastCreated(), lv_mapScale);
libCOUI_gv_cU_MinimapAllyViewPing[2] = PingLastCreated();
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:1064
lv_uT = EventPlayerEffectUsedUnitType(c_effectUnitCaster);
lv_p = EventPlayerEffectUsedUnitOwner(c_effectPlayerCaster);
lv_color = libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lv_p, false));
lv_ally = PlayerGroupAlliance(c_playerGroupAlly, lv_p);
lv_prop = UnitGetName(lv_u);
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:937
if ((PlayerGroupHasPlayer(libWCdr_gv_legends.lv_legendPlayers, lv_currentIndex) == true)) {
DialogControlSetAnimationState(libWCdr_gv_debugHeroSelectUI.lv_readyPanels[lv_currentIndex].lv_readyPanel, PlayerGroupAll(), libWCdr_gv_animationStates.lv_emptyState, libWCdr_gv_animationStates.lv_emptyState_NotEmpty);
libNtve_gf_SetDialogItemColor(libWCdr_gv_debugHeroSelectUI.lv_readyPanels[lv_currentIndex].lv_playerLabel, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lv_currentIndex, false)), PlayerGroupAll());
libNtve_gf_SetDialogItemText(libWCdr_gv_debugHeroSelectUI.lv_readyPanels[lv_currentIndex].lv_playerLabel, PlayerName(lv_currentIndex), PlayerGroupAll());
}
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:3088
lv_player = PlayerGroupNextPlayer(auto187B1612_g, lv_player);
if (lv_player < 0) { break; }
libNtve_gf_SetDialogItemTeamColor(libWCdr_gv_gameUI.lv_hero_Portrait, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lv_player, false)), PlayerGroupSingle(lv_player));
libNtve_gf_SetDialogItemCamera(libWCdr_gv_gameUI.lv_hero_Portrait, "Camera01", PlayerGroupAll());
}
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/DebugAIWar3.galaxy:26
1,
StringToText("[") +
PlayerColorName(PlayerGetColorIndex(player, false)) +
StringToText("] ") +
StringToText(s),