I've spent quite a bit of time looking around in the editor aswell as on the forums trying to figure out how to dynamically change the color of units using triggers. I eventually came with the solution and thought I'd share this with everyone who currently has the same problem as I had.
Problem:
Convert the color of a basic bunker to a completely different color using a trigger.
Change this bunker:
To this bunker:
Although the solution to this is in fact quite simple, it took me a lot of time to find this.
Here's the solution(In a pick each bunker loop, it's possible to set individual units and the like as with any other trigger):
To set it to a completely white color;
Actor - Send actor message (Set Tint Color (100%, 100%, 100%) with HDR 1.0 over 0.0 seconds) to main actor of unit (Picked unit)
To set it as the color of the player;
Actor - Send actor message (Set Tint Color (Color((Current player (Owner of (Picked unit)) color))) with HDR 1.0 over 0.0 seconds) to main actor of unit (Picked unit)
Note how its possible to set other value's of these individual item actors, size, their team color instead of tint color, basically everything you can do in the data editor.
Edit;
Setting the actors of AI controlled units currently seem to have no support for this function, however it works fine with player controlled units.
Edit2:
Found out what the problem was with computer controlled units, use "Tint color", instead of "Local tint color"
Adjusted the rest of the tutorial to reflect this
I've been trying to figure this out and never discovered it was so simple, I always had to change colors using the data Events+, and couldn't change it via triggers.
you sir, just increased my ability of freedom by 10%
You can also use the trigger actions "Unit - Set (Triggering unit) team color to (Player 01) Red" or "Player - Set player 1 color to (Player 01) Red (Change the color of existing units)" but those don't let you set a hex value.
hmm actually Unit - Set (Last created unit) scale to (100.0%, 100.0%, 100.0%) of its original size isnt working always. but Actor - Send message (SetScale 1.0, 1.0, 1.0 3.0) to actor (Actor for (Last created unit)) is working
I've spent quite a bit of time looking around in the editor aswell as on the forums trying to figure out how to dynamically change the color of units using triggers. I eventually came with the solution and thought I'd share this with everyone who currently has the same problem as I had.
Problem: Convert the color of a basic bunker to a completely different color using a trigger.
Change this bunker:
To this bunker:
Although the solution to this is in fact quite simple, it took me a lot of time to find this.
Here's the solution(In a pick each bunker loop, it's possible to set individual units and the like as with any other trigger):
To set it to a completely white color;
Actor - Send actor message (Set Tint Color (100%, 100%, 100%) with HDR 1.0 over 0.0 seconds) to main actor of unit (Picked unit)
To set it as the color of the player;
Actor - Send actor message (Set Tint Color (Color((Current player (Owner of (Picked unit)) color))) with HDR 1.0 over 0.0 seconds) to main actor of unit (Picked unit)
Note how its possible to set other value's of these individual item actors, size, their team color instead of tint color, basically everything you can do in the data editor.
Edit;
Setting the actors of AI controlled units currently seem to have no support for this function, however it works fine with player controlled units.
Edit2: Found out what the problem was with computer controlled units, use "Tint color", instead of "Local tint color" Adjusted the rest of the tutorial to reflect this
@Stracho: Go
:O
I've been trying to figure this out and never discovered it was so simple, I always had to change colors using the data Events+, and couldn't change it via triggers.
you sir, just increased my ability of freedom by 10%
Omg, so bad I didnt know about this until now! Send message to actor is cool, dont know why did blizz hided that so much.D
You can also use the trigger actions "Unit - Set (Triggering unit) team color to (Player 01) Red" or "Player - Set player 1 color to (Player 01) Red (Change the color of existing units)" but those don't let you set a hex value.
ALso scaleing doesnt works for ai units which is really sad:(
but I can use Unit - Set (Last created unit) scale to (100.0%, 100.0%, 100.0%) of its original size for that.
hmm actually Unit - Set (Last created unit) scale to (100.0%, 100.0%, 100.0%) of its original size isnt working always. but Actor - Send message (SetScale 1.0, 1.0, 1.0 3.0) to actor (Actor for (Last created unit)) is working
Can you make units glow using triggers? I want to make some units seem radioactive and just changing them green isn't doing it.
@Keyeszx: Go
Check out my Dynamic Skybox tutorial in my sig.
It uses "send actor messsage" to change the skybox color
That would make all units glow, correct? I want just the enemy mobs to glow like they're radioactive. The human players are normal.
Bumping an old topic cause I have a followup question:
So you can change a units tint by the actor trigger, but how do you change it back to its original tint?
For example, when a unit walks into a region, the trigger sends the actor message to tint the unit red
Now when the unit walks back out of the region, How do you tint the unit back to its original color?
EDIT: just use clear tint lol, i didnt see that at first