HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Attachment's team color?

07-29-2007, 08:59 PM#1
Exilus
How do you make an attachment team-colored? I need it for a CTF game because as soon as i add the "flag" attachment wich uses the human flag model, the flag attached is white and i would like to know if it is possible to configure it to show up as red or green.
07-29-2007, 09:10 PM#2
Rising_Dusk
If the attachment model has team color, calling call SetUnitColor(MyUnit, SomePlayerColor) will also color all TC parts of attached models.
07-30-2007, 03:21 AM#3
Exilus
I want to change just my attachment's color. not the unit's
07-30-2007, 03:38 AM#4
moyack
Quote:
Originally Posted by PitzerMike's The Warcraft III Ability Guide

ACnr (Life Regeneration Aura): Perfect to attach effects with team colour to units. Just set the amount of life regenerated to zero and targets to only self. Then add the model you want to attach to the target art field and specify the attachment point. This will attach the model to the unit that has this ability and the team colour parts of it will change according to the owner. This also works in conjunction with morph abilities. If the team colour happens to mess up in certain situations the following code should fix it.

Collapse JASS:
call SetUnitColor(<unit>, GetPlayerColor(GetOwningPlayer(<unit>)))

Check the full document here
07-31-2007, 01:28 AM#5
Panto
Indeed, using the right base ability is the key here. Sphere was the favorite effect-attachment ability of the community for a long time (because that's what it appeared to be designed for) but people didn't realize that it had a lot of drawbacks, including not using teamcolor easily. The Life Regeneration Aura is what I use, and I've never had problems.

This, however, will only let you change the color of the attachment to the color of the player who's unit has it. If you want it to be only red or green, I can think of two methods:

First, and easiest: Make two more flag models based off the existing ones, altered to have no teamcolor and show red or green where the teamcolor would be.

Second, and less-import-intensive: Make all player colors red or green, and then individually change each player's hero's color to whatever the player color would be. The unit will change over but the attachments should use the teamcolor.