• 🏆 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 color on units?

Status
Not open for further replies.
Level 17
Joined
Apr 13, 2008
Messages
1,597
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