• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Changing Player Color to White

Status
Not open for further replies.
Level 11
Joined
Dec 13, 2008
Messages
1,047
I know there is a trigger where you can change the color of a player to a different color (red, blue, black, etc) but I did not see white as an option. Is there any way for me to create a trigger where following a certain event, the color of a player will change from red to white? Thanks
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
White:
Code:
"000000"

Black:
Code:
"FFFFFF"

You're not actually changing the player's color, you're just changing the color of the text that is displayed. There are only 12 player colors that can be returned by the function GetPlayerColor. Other than that you're adding hex color-codes to the player's name.

Name:
Code:
SomeName

Hex Color-code (White):
Code:
"|CFF" + "000000" + SomeName + "|R"

This is a string with "SomeName" as white. Similarly, this is a string with "SomeName" as red/blue/green/black.

Red:
Code:
"|CFF" + "FF0000" + "SomeName" + "|R"

Blue:
Code:
"|CFF" + "0000FF" + "SomeName" + "|R"

Green:
Code:
"|CFF" + "00FF00" + "SomeName" + "|R"

Black:
Code:
"|CFF" + "FFFFFF" + "SomeName" + "|R"
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
takakenji said:
impossible, if a team color does not exist you can't add it

Hardly helpful.

Anyways, you can over-ride any in-game colors by using these hex codes. For instance, if the name of your unit is "|cffff0000Footman|r" then it will always be red wherever it is used (unless over-written by more, I don't know how it works when you add multiple color-tags to strings).

Anything inside the "|c ... |r" represents a color tag I think. The first two characters are the alpha (which doesn't do anything). The third/fourth characters represent the Red tint. Fifth/sixth represent Green. Seventh/Eighth represent Blue, giving you: |c FF FF FF FF string |r. Ignore the spaces.

I think its safe to say this query was more about string-coloring than player colors. Just for clarity though there are 12 player-colors for Red through Brown. In GUI there is actually an option for "Black" which is a little more concealed in JASS, because instead of being represented by one of the constants, like PLAYER_COLOR_RED, it is represented by a ConvertPlayerColor(12) call.

Also, ConvertPlayerColor(n) where n is anything from 12 to 15 will also be black. n > 15 will crash WarCraft III.
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
Unfortunately most the answers you are getting are from pure Trigger and Script coders, so your answer seems to have no clear answer.

It is impossible to change a hero or unit's team color to white, as hero glow and team colors are done like so by a modeler:

The area where you want team color to show up is alpha'ed out on the model. The team color is then added in via some edits to the model, which can be done via notepad.

Only the 13 team colors are available as team hero colors. If you want to create a white "team color" you will need to open the model, fix the alpha channel, and color the alpha'ed out area to white.

You will then need to replace the specified unit you want with a duplicate, similar unit that has the same model.

It's really quiet a lot of work and even more difficult for an entire team's units to be changed, and totally not work it. But if you want to try it, ask the model section for more info.
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
hmmm, i see. alright, well thank you everyone for your help. ill just stick with the units being red, haha. thanks though for the attempted help!
 
Level 7
Joined
Jul 11, 2007
Messages
512
It is possible to change TC; but it only works in WE, aka you can't see the changes in WC3. I discovered that independently while scrolling through my game interface thingies.

YourNameHere is partially right.

I'm still working on a solution to make TC changeable... If I can't by myself, I'll send a letter to Blizz requesting some WE feats in a new patch.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
YourNameHere said:
Well then they're loaded when WC3 is, just like fonts. You can however replace them locally for you :/

You can change in-game font for every player in the game. I don't see why another interface field would only be locally dynamic. Just find out what paths the player color textures are hidden at.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I just tried it now, importing a white version of TeamColor00.blp with the path ReplaceableTextures\TeamColor\TeamColor00.blp. When I reopen my World Editor it seems that it successfully replaced the color in the editor but once I load up WarCraft III it reverts to the default colors.

When you're trying to replace fonts you just have to import another font with the same name as the one used in WarCraft and it works in-game, I'm still trying to figure out what is different about player colors. When you look in the Custom Interface menu you'll notice the path for team colors is:

ReplaceableTextures\TeamColor\TeamColor

If you look up this path in WarCraft III Image Extractor II it actually doesn't exist, instead there are TeamColor00 through TeamColor15. Perhaps it has something to do with the path that they are being referenced from?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Now that I think of it its actually kind of strange how the font works. Try importing a TrueType font into your map and rename is as:

Code:
frizqt__.ttf

This needs to be the name of the font. You don't even need to change the file-path after importing it it will just work.
 
Status
Not open for further replies.
Top