1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Custom colors

Discussion in 'World Editor Help Zone' started by MasterHaosis, Apr 18, 2012.

  1. MasterHaosis

    MasterHaosis

    Joined:
    Sep 18, 2007
    Messages:
    1,470
    Resources:
    30
    Models:
    15
    Icons:
    13
    Maps:
    2
    Resources:
    30
    Hello all! This is first time that I ever open thread in We Help zone.
    I have to ask cause it has been for years since I created maps, and also I haven't seen or heard that someone did that at all.
    I asked -Kobas-, and he did not find idea for that, so its better to ask majority of you.
    So, I am working on some things now, editing some of Blizzard maps from original campaign, and there is thing what I want but do not know how to do.
    How can I add new colors to players?
    For example, in campaign there are three Undead races, in three different colors. I want them all to be purple, in different purple variations (original purple, light purple and dark purple), and as we all know there is only one purple.
    And 12 colors in total plus 13. black one for neutral passive/hostile.
    So, how can I add new colors, or even ,,convert" or ,,redefine" some existing colors into new ones? For example if new colors cannot be add, can I convert unused brown to convert into new purple for example?
    Is there a trigger or way to add new colors or change existing? or it is hard-coded in exe file, so cannot be done?
    I know only for trigger, And I did that yesterday to change color or player ! Red to blue, and player blue to get red. Still those are just ,,giving" existing colors to different players, and I need to really change color code of exist ones, or even better to add new ones if possible.
     
  2. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    Only thing I can imagine is change the "Art - Team Color" and select "Purple" as fixed color.
     
  3. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,568
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    [trigger=Three shades of purple]
    Events
    Unit - A unit enters (Playable map area)
    Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    Then - Actions
    Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 0.00%, 100.00%) with 0.00% transparency
    Unit - Change color of (Triggering unit) to Purple
    Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    (Owner of (Triggering unit)) Equal to Player 2 (Blue)
    Then - Actions
    Animation - Change (Triggering unit)'s vertex coloring to (75.00%, 5.00%, 100.00%) with 0.00% transparency
    Unit - Change color of (Triggering unit) to Purple
    Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    (Owner of (Triggering unit)) Equal to Player 3 (Teal)
    Then - Actions
    Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 5.00%, 75.00%) with 0.00% transparency
    Unit - Change color of (Triggering unit) to Purple
    Else - Actions

    [/trigger]
     
  4. MasterHaosis

    MasterHaosis

    Joined:
    Sep 18, 2007
    Messages:
    1,470
    Resources:
    30
    Models:
    15
    Icons:
    13
    Maps:
    2
    Resources:
    30
    People, DAT-C3, this is what I wanted to do for example
    This is original screenshot from map
    [​IMG]

    And I want to change team color of players to this, so those green and blue will turn into blue, look at corners. So I want their armies to have those colors.Of course those purples are quickly done to represent only what I want to be done, I may use different variates.
    [​IMG]
     
  5. Statharas

    Statharas

    Joined:
    Jul 9, 2008
    Messages:
    2,332
    Resources:
    14
    Tools:
    1
    StarCraft II Resources:
    5
    Tutorials:
    8
    Resources:
    14
    Wc3 engine, Yaoming.jpg
     
  6. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    You could MAYBE and PROBABLY search in the MPQ of Wc3 where the Player Colors are holded, and import a player color into the same path.
     
  7. Hashjie

    Hashjie

    Joined:
    Apr 20, 2009
    Messages:
    1,515
    Resources:
    0
    Resources:
    0
    I think it's hard-coded into warcraft 3 and therefore impossible to accomplish.
    Sure you might be abled to change the chat color and multiboard color of a player, but I don't think it's possible to alter the actual color.

    I mean, if you look under Scripts inside war3.mpq even the ai scripts are based on colors.
    I couldn't really find anything specific to players inside the MPQ's. Good luck to those who'd like to search for it.
     
  8. MasterHaosis

    MasterHaosis

    Joined:
    Sep 18, 2007
    Messages:
    1,470
    Resources:
    30
    Models:
    15
    Icons:
    13
    Maps:
    2
    Resources:
    30
    Hashjie, yeah man, sadly, I think that too, that they hardcoded colors in exe.
    But there must be way or trick for that which nobody discovered yet.

    Well, I did not hear yet that colors are hold in MPQ.

    Guys, we discussed whole night, around few hours about that in chat.
    Dat-C3 and Darkdread were talking about GUI and Jass for that case, maybe you can find something useful for some idea. Here is something:


    [01-51-37] Dat-C3: MasterHaosis, doesn't seem possible unless jass has a function where you can tell it to convert a players color by string
    [01-51-46] Dat-C3: otherwise yea im sry.... =(
    [01-52-03] Dat-C3: only base 13 that way it seems unless you can find a way to do that
    [01-52-09] Darkdread: jass doesn't have that function I'm afraid.
    [01-52-09] Dat-C3: im sure there has to be a way, i just don't know it yet
    [01-52-55] Dat-C3: call SetPlayerColorBJ( Player(0), PLAYER_COLOR_RED, true )
    [01-52-59] Dat-C3: so you couldn't use a string variable in that?
    [01-53-08] Dat-C3: like convert player_color_red to a varible that uses a string?
    [01-53-38] Darkdread: Dat-C3, nope.
    [01-55-09] MasterHaosis: Darkdread, Dat-C3, so cannot be folled system to think that red color is for example red, even you somehow change its color code?
    [01-55-24] MasterHaosis: Actually as you say there is not way to change color code
    [01-55-49] Dat-C3: if you can find a way to replace the base 13 colors then sure
    [01-55-55] Dat-C3: otherwise i see no way to add it without having open source wc3
    [01-56-50] Darkdread: there's no such thing as PLAYER_COLOR_BLACK or whatever
    [01-56-56] Darkdread: only existing 12 colors..
    [01-57-06] MasterHaosis: Darkdread, there is black
    [01-57-12] MasterHaosis: 13 color I am sure
    [01-57-16] Dat-C3: Darkdread, theres 13, 1 to 12 then black
    [01-57-19] Darkdread: o_O
    [01-57-25] Dat-C3: there is, Lol
    [01-57-30] MasterHaosis: neutral hostile and passive uses it
    [01-57-32] Dat-C3: neutral hostile uses black
    [01-57-35] Darkdread: there isn't in my jasshelper
    [01-57-48] Dat-C3: o_O a gui function jass doesn't have?
    [01-58-30] Darkdread: I mean
    [01-58-36] Darkdread: there's only 12 constant :\
    [01-58-49] Dat-C3: Darkdread, theres no black for jass?
    [01-59-40] Dat-C3: call SetPlayerColorBJ( Player(0), ConvertPlayerColor(12), true )
    [01-59-47] Darkdread: heck, it's constant 13
    [01-59-47] Dat-C3: there so is black >.>
    [01-59-56] Dat-C3: you forget in jass, 0 is red
    [01-59-56] Dat-C3: 12 is black
    [02-00-03] Darkdread: I think so
    [02-00-03] Darkdread: no
    [02-00-06] Darkdread: there's 0-11 in jass only
    [02-00-09] Dat-C3: in gui its 1 to 13
    [02-00-12] Dat-C3: in jass its 0 to 12
    [02-00-12] Darkdread: 12 is hidden
    [02-00-32] Dat-C3: then explain " call SetPlayerColorBJ( Player(0), ConvertPlayerColor(12), true )"
    [02-01-10] Darkdread: ConvertPlayerColor(12) is actually PLAYER_COLOR_BLACK. BUT, PLAYER_COLOR_BLACK is not in jass
    [02-01-29] Dat-C3: Darkdread, yes.. its in numbers isn't it?
    [02-01-49] Darkdread: if not, you try to convert red or whatever with black
    [02-01-49] Darkdread: lol
    [02-02-05] Darkdread: if you convert red or whatever, you get PLAYER_COLOR_RED
    [02-02-47] MasterHaosis: but there is no way to redefine that red?
    [02-03-31] Darkdread: no
     
  9. Boris_Spider

    Boris_Spider

    Joined:
    Dec 12, 2009
    Messages:
    728
    Resources:
    6
    Icons:
    3
    Maps:
    2
    Tutorials:
    1
    Resources:
    6
    I don't believe it's possible to add additional colors. You should be able to import a custom color over the existing color's path. The game references the colors from somewhere, so there exists a path to that color.

    You can use DAT-C3's method to change the units and then change the color of the text names seen in the dialog box to achieve what you want to do.

    I can't look for it now, since I lost WC3 yesterday when my laptop crashed and had to be rebooted from the last safe point. Friday after 7PM (Eastern Time) is the soonest I can reinstall and fool around with the map in question.

    //\\oo//\\
     
  10. Mechanical Man

    Mechanical Man

    Joined:
    Jan 18, 2005
    Messages:
    5,384
    Resources:
    39
    Models:
    30
    Icons:
    3
    Packs:
    1
    Maps:
    4
    Tutorials:
    1
    Resources:
    39
    I don't really have idea what is going on, but it's not possible to override those tga colors in mpq?
     
  11. Hashjie

    Hashjie

    Joined:
    Apr 20, 2009
    Messages:
    1,515
    Resources:
    0
    Resources:
    0
    And which path is that?
     
  12. Mechanical Man

    Mechanical Man

    Joined:
    Jan 18, 2005
    Messages:
    5,384
    Resources:
    39
    Models:
    30
    Icons:
    3
    Packs:
    1
    Maps:
    4
    Tutorials:
    1
    Resources:
    39
    ReplaceableTextures\TeamColor\TeamColor , I'm not sure it will work though
     
  13. MasterHaosis

    MasterHaosis

    Joined:
    Sep 18, 2007
    Messages:
    1,470
    Resources:
    30
    Models:
    15
    Icons:
    13
    Maps:
    2
    Resources:
    30
    Guys, it is not working.
    Darkdread and I tested that last night. He tried to replace in map blue with yellow, I replaced red with blue, and we failed.
    Still in map, I was red color instead blue and he had blue instead of yellow.
    Then why for are those team colors under replaceable textures?
     
  14. The Reborn Devil

    The Reborn Devil

    Joined:
    Dec 31, 2006
    Messages:
    1,325
    Resources:
    0
    Resources:
    0
    Lol easy.
    Change the name of the player like you would change the name of a unit to give it color.

    |c00<hex code>+PLAYER NAME+|r

    F.ex, to change my name to Red even if I'm Player Blue, I would need to change my name to "|c00ff0000The Reborn Devil|r".
     
  15. MasterHaosis

    MasterHaosis

    Joined:
    Sep 18, 2007
    Messages:
    1,470
    Resources:
    30
    Models:
    15
    Icons:
    13
    Maps:
    2
    Resources:
    30
    The Reborn Devil, no, it does not give player color, only name

    [​IMG]
     
  16. The Reborn Devil

    The Reborn Devil

    Joined:
    Dec 31, 2006
    Messages:
    1,325
    Resources:
    0
    Resources:
    0
    Derp. Thought that was what you wanted :D

    "How can I add new colors to players?"

    To change colors on units (without using Animation - Change Unit's vertex coloring which sucks) to colors not already predefined, you need to change the TeamColor textures manually and import the new textures into your map with the same path as the old ones. For the minimap I'm not sure, but I suspect you can edit the .slk files (or perhaps some of the derpy files within the map).
     
  17. Hashjie

    Hashjie

    Joined:
    Apr 20, 2009
    Messages:
    1,515
    Resources:
    0
    Resources:
    0
    Mechanical Man and The Reborn Devil where right!

    proof
    [​IMG]


    I simply went into war3.mpq with an mpq editor, exported ReplaceableTextures\TeamColor\TeamColor08.blp
    Then I went into the map and imported the blp under this path: ReplaceableTextures\TeamColor\TeamColor01.blp

    Now player blue's textures have changed to the color of player grey.

    This same thing counts for TeamGlow.

    Of course you could alter the blp to have any custom color you like...

    You can use this with the chat color system that you already have to completely change the player's color!
    By doing this the minimap is also solved as you can see... A test map is attached:


    EDIT: Okay.... This seems not to work since in-game the colors change back to blue instead of grey :S
    This only seems to work for inside the world editor? Which means it is probably hard-coded like I said before :(

    EDIT 2: I think it got to do with the map header:

    Code (vJASS):

    //***************************************************************************
    //*
    //*  Players
    //*
    //***************************************************************************

    function InitCustomPlayerSlots takes nothing returns nothing

        // Player 0
        call SetPlayerStartLocation(Player(0) , 0)
        call SetPlayerColor(Player(0) , ConvertPlayerColor(0))
        call SetPlayerRacePreference(Player(0) , RACE_PREF_HUMAN)
        call SetPlayerRaceSelectable(Player(0) , true)
        call SetPlayerController(Player(0) , MAP_CONTROL_USER)

        // Player 1
        call SetPlayerStartLocation(Player(1) , 1)
        call SetPlayerColor(Player(1) , ConvertPlayerColor(1))
        call SetPlayerRacePreference(Player(1) , RACE_PREF_ORC)
        call SetPlayerRaceSelectable(Player(1) , true)
        call SetPlayerController(Player(1) , MAP_CONTROL_COMPUTER)

    endfunction


    As you can see in war3map.j the colors of the players will be set. I'm trying to override it right now...

    EDIT 3: Even if I physically alter war3map.j to have ConverPlayerColor(8) and import it with an MPQ editor, it still shows up blue in-game.
    AAAARHG >.<!
     

    Attached Files:

    Last edited: Apr 19, 2012
  18. MasterHaosis

    MasterHaosis

    Joined:
    Sep 18, 2007
    Messages:
    1,470
    Resources:
    30
    Models:
    15
    Icons:
    13
    Maps:
    2
    Resources:
    30
    Hashjie, thanks for trying man!
    We already tested that and it is not working. Pain in ass problem.

    Guys, today in chat GhostThruster tried to help to do something, and basically at least he managed ,,something".

    [15-43-26] GhostThruster: MasterHaosis, http://www.hiveworkshop.com/forums/pastebin.php?id=220o2t
    [15-43-29] GhostThruster: you can do what i did in that
    [15-43-39] GhostThruster: look at stand 1
    [15-43-42] GhostThruster: and stand 2
    [15-44-31] GhostThruster: i edited the alpha of TeamColour00 via material manager to only show it in stand -2 anim

    And here is his result,

    [​IMG]

    Well, replacing manualy unit's textures and reimport models again will solve problem to certain point, but following problems will occur:

    1. Hero Team Glow
    2. Mini map
    3. Owner of that color posses or charms unit from another color, so posseded/charmed unit wont turn back into this color. Same happens when owner has regular color and posses/charms unit which belongs to this new color, this light purple peon for example. Peon will remain that color because he loses alpha channels which turns out team colors.
    Okay this third problem can be solved, simply I wont use Ghosts and Banshies in campaign maps.
    But minimap and hero glow are problems.
     
  19. Hashjie

    Hashjie

    Joined:
    Apr 20, 2009
    Messages:
    1,515
    Resources:
    0
    Resources:
    0
    How can you use a material manager on TeamColour00? It's a blp not a mdl or mdx :S?

    Either ways, if this can be done on TeamColour00.blp then why can't it be done on TeamGlow00.blp? They basically are the same...
     
  20. MasterHaosis

    MasterHaosis

    Joined:
    Sep 18, 2007
    Messages:
    1,470
    Resources:
    30
    Models:
    15
    Icons:
    13
    Maps:
    2
    Resources:
    30
    Hashjie, I will send him now visitor message so he can get here and example better.
    I think he did that because he exported some blp color, or just edited manually in some program that blp, and reimported into mdl model under TeamColor00 path. So instead being red it is that light purple, but also cannot change color, its always light purple.
    And about material manager, I did not check it, but he will explain better.
    However, mini map and team glow are still problems.
    Thats why I prefer whole team color to be altered, but seems that its impossible for now.