HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to get a player color?

10-12-2005, 04:57 AM#1
The_AwaKening
I have this trigger to display text to all players. How would I make the player name display matching their color?

Code:
DragonKill
    Events
        Unit - El Dorado 0481 <gen> Dies
        Unit - Infernum 0225 <gen> Dies
        Unit - Draconios 0226 <gen> Dies
    Conditions
        And - All (Conditions) are true
            Conditions
                (El Dorado 0481 <gen> is dead) Equal to True
                (Infernum 0225 <gen> is dead) Equal to True
                (Draconios 0226 <gen> is dead) Equal to True
    Actions
        Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Killing unit))) +  has slain the Dragons !!!)
        Custom script:   call DestroyTrigger( GetTriggeringTrigger() )
10-12-2005, 06:38 AM#2
divine_peon
what i do is set up strings in the initialization with the proper color codes. ex: set strings[1]=|cffffff00sadgsgsd|r. then on your trigger, write Game-Display text to all players: Strings[Player number of owner of killing unit] killed a Dragon.
10-13-2005, 03:58 PM#3
Zoxc
I have a script in submission that does this for you ....
10-13-2005, 08:25 PM#4
Gandalf2349
Or even easier just do this:

PlrColor[1] = "|cffff0000"
PlrColor[2] = "|Cff0000ff"
etc.

Then:

Display - (PlrColor[1] + ("Player 1" or Player Name of (Player 1 <Red)) + "|r has slain Smog the Magnificent."
10-13-2005, 10:30 PM#5
Tim.
You just repeated divine_peon's suggestion?
10-14-2005, 07:08 PM#6
Gandalf2349
Similar, except he was adding the player name to the constant string.
10-15-2005, 12:25 AM#7
iNfraNe
What about "ConvertPlayerColor(playernumber - 1)" no need to make entries on those stupid arrays and searching for color values u dont know from heart (since player red is not simply |cffff0000 but something weird.)

Just check the jass for the game display u have now and then add ConvertPlayerColor
10-18-2005, 12:23 AM#8
The_AwaKening
You're saying to convert trigger to jass and use ConvertPlayerColor? I'm not real great at jass so maybe you could show me exactly how that line would go along with the rest of my action.
10-18-2005, 03:31 PM#9
iNfraNe
nvm I was wrong about that :) didnt quite work as I suspected. Just do what the others said, here are the colors (1-8 hope u dont need more ;)):
Code:
Set ColorCode[1] = |cFFFF0303
Set ColorCode[2] = |cFF0042FF
Set ColorCode[3] = |cFF1CE6B9
Set ColorCode[4] = |cFF540081
Set ColorCode[5] = |cFFFFFC00
Set ColorCode[6] = |cFFFE8A0E
Set ColorCode[7] = |cFF20C000
Set ColorCode[8] = |cFFE55BB0
10-18-2005, 09:12 PM#10
The_AwaKening
I actually have the color strings already set in initialization as a variable. My problem is that I can't get the option to use it and display player name (only player number), once I put that string in there.

Also I guess my strings may have been wrong

Code:
set udg_playerColorString[1] = "ff0000"
set udg_playerColorString[2] = "0000ff"
set udg_playerColorString[3] = "1CE6B9"
set udg_playerColorString[4] = "540081"
set udg_playerColorString[5] = "FFFC01"
set udg_playerColorString[6] = "FE8A0E"
set udg_playerColorString[7] = "20C000"
set udg_playerColorString[8] = "E55BB0"
set udg_playerColorString[9] = "959697"
10-19-2005, 09:12 AM#11
Anitarf
Here's the correct player color data for all players, in all usable formats:

XXX/255 Values:
red: 255-3-3
blue: 0-66-255
teal: 28-230-185
purple: 84-0-129
yellow: 255-252-1
orange: 254-186-14
green: 32-192-0
pink: 229-91-176
grey: 149-150-151
light blue: 126-191-241
dark green: 16-98-70
brown: 78-42-4

RGB % Values:
red: 100.00, 1.17, 1.17
blue: 0.00, 25.88, 100.00
teal: 9.80, 90.20, 72.55
purple: 32.94, 0.00, 50.59
yellow: 100.00, 98.82, 0.40
orange: 99.61, 72.94, 5.49
green: 12.55, 75.30, 0.00
pink: 89.80, 35.69, 69.02
grey: 58.43, 58.82, 59.21
light blue: 49.41, 74.90, 94.51
dark green: 6.27, 38.43, 27.45
brown: 30.59, 16.47, 1.57

Colorcode values:
Set color[1] = |c00ff0303
Set color[2] = |c000042ff
Set color[3] = |c001ce6b9
Set color[4] = |c00540081
Set color[5] = |c00fffc01
Set color[6] = |c00ff8000
Set color[7] = |c0020c000
Set color[8] = |c00e55bb0
Set color[9] = |c00959697
Set color[10] = |c007ebff1
Set color[11] = |c00106246
Set color[12] = |c004e2a04
10-19-2005, 11:26 AM#12
iNfraNe
what u obviously need todo is:
colorcode[playerNUMBER] + (this is an OTHER string) player NAME + (YET ANOTHER STrING) "|r"
10-20-2005, 12:20 AM#13
The_AwaKening
Awesome. I set those strings in my initialization then made my action basically to match what toot said and everything works great. Thanks for the help all.