• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Changing color on units?

Status
Not open for further replies.
Level 17
Joined
Apr 13, 2008
Messages
1,608
Well there is no way to get a unit's color as far as I know. You can only set it. When you set the unit's color set a variable too.

Every 3 seconds
if UnitColorVariable == red then
set Footman's color to blue.
set UnitColorVariable to blue.
if UnitColorVariable == blue then
set Footman's color to green
set UnitColorVariable to green
if UnitColorVariable == green then
set Footman's color to red
set UnitColorVariable to red
 
Last edited:
Level 6
Joined
Nov 7, 2007
Messages
39
that actually wouldn't work. You would need to have else's in there, otherwise it would always be the same color.

  • color change
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • acolorvar Equal to (==) Green
        • Then - Actions
          • Set acolorvar = Red
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • acolorvar Equal to (==) Red
            • Then - Actions
              • Set acolorvar = Blue
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • acolorvar Equal to (==) Blue
                • Then - Actions
                  • Set acolorvar = Green
                • Else - Actions
      • Unit - Change color of aaunit to acolorvar
acolorvar should also have a default color as red, blue, or green
 
Status
Not open for further replies.
Top