HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Checking for unit classification

07-24-2004, 03:13 PM#1
35263526
Okay, here's something I'm completely stumped on.

The Illithid race in my mod's maps is special in that most of their units are killed by sunlight. The gameplay solution: One of the Illithid buildings projects a 'Sunless Aura' (based on Devotion Aura; unit ability with one level, no actual effect and a custom buff of Sunless Aura). The way it's supposed to work: Every 5 seconds the game checks all units of the types which are killed by sunlight, and if they don't have the Sunless Aura buff, they are killed with a little fire SFX.

Now I've run into a snag. I'd like to use Unit Classifications to make disinctions between units that burn and units that don't. The problem is that there are only four Unit Classifications who's text I can change (I want the text to appear as 'Sunbaned', the base texts are all innapropriate). They are:

  • Giant
  • Mechanical
  • Tauren
  • Undead
And the Unit Classifications that it's possible to check for are:
  • Summoned
  • Undead
  • Mechanical
  • Ancient
  • Peon
So why don't I just replace either Mechanical or Undead with Sunbaned, I hear you cry. Well, the Undead make up several creeps and units in the mod, and there are many, many abilities that only target undead. As for Mechanical, there aren't many units which match that classification, but there being only one inorganic ship in the mod won't make it any better when it's possible to heal the damned thing.

As far checking for every unit type, I really don't want to, because there are a great many Sunbane units, and I'd like to be able to add new units easily. Of course, I'm willing to use that method, but it's not particuarly efficient so I'd really prefer another solution.

Thanks for any help,
35263526
07-24-2004, 04:20 PM#2
AIAndy
You can check for all unit classifications with JASS.
07-24-2004, 06:02 PM#3
Anitarf
All sunbane units could have a sunbane "aura" that only targets them (targets allowed: self); then, you would check all units with that aura's buff; or, you could just check all the units with that ability. The ability could be anything, based on an ablity with an icon or one without it. True, the sunbane won't appear nicely as a unit classification, but it will still be quite ok as a buff and/or ability icon. You can then add this ability to any unit to make it sunbanable without modifying the triggers (you could even have spells that remove sunbane for some time so you could move out in daylight with some troops (be careful that the opponent doesn't dispell them :) ))
07-24-2004, 06:13 PM#4
35263526
Quote:
Originally Posted by AIAndy
You can check for all unit classifications with JASS.

How, exactly, do I check for Tauren classification (That's the one I'd rather use)? I tried IsUnitType(GetFilterUnit(), UNIT_TYPE_TAUREN), but it turns up errors.

Anitarf, I'll try using an ability if I can't get the Classification thing to work.
07-25-2004, 01:18 PM#5
AIAndy
Strangely I could not find tauren in the constants so that seems to be the only missing one. But giant is there, so I guess you could use that:
UNIT_TYPE_GIANT

EDIT: The tauren unit type can be checked for, it just has not been assigned to a constant strangely. You can get it with: ConvertUnitType(20)
07-25-2004, 02:05 PM#6
35263526
Quote:
Originally Posted by AIAndy
Strangely I could not find tauren in the constants so that seems to be the only missing one. But giant is there, so I guess you could use that:
UNIT_TYPE_GIANT

EDIT: The tauren unit type can be checked for, it just has not been assigned to a constant strangely. You can get it with: ConvertUnitType(20)

Thanks, works like a charm. I'm using Giant. Thanks for the Tauren info, it gives me another unit classification to work with.