HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help making an ability target only 1 type of unit

10-13-2003, 01:46 PM#1
~DarkX~
OK, what I want to do is to make this ability target only 1 type of building. What I have already tryed is this; I gave all the buildings I want targetable the Ancient type, and then made the ability only affect buildings and Ancients. This did not seam to work for some reson tho.
The ability increases attack speed and I based it off Endurance Aura, so would this be 1 of those hard coded only affects troops type of spells?
If you know how to get something like this to work plz post, it would be very helpful.
10-13-2003, 02:44 PM#2
Dark_Templar
This won't work if your ability is not targeted


I would suggest (pick every unit (matching - unit type equal to **you define**) in playable map area and add units to affected unit group). Then, just add a trigger that doesn't cause any ability effects for units that aren't in the specified unit group.

I would be like this:

Events:
A unit is issued an order targeting an object
Conditions:
Issued order equal to (**orderstring of your ability**)
Targeted unit is in (targeted unit group) equal to true
Actions:
You specify

Or you would make a trigger that cancels the effect of the ability if the unit is not in the unit group.
10-13-2003, 03:03 PM#3
Grater
When you say "Does not seem to work" I assume you mean it doesn't affect the buildings you want affected, rather than it affecting everything...

It may very well be possible to simulate an aura by using add-ability, I would do it something like this:
Make a unit group which contains all affectable units.

Periodic event: Every 5 seconds.
Actions:
Pick every unit in affectable unit group.
Ability - remove (improved attack speed) from (picked unit)

Pick every unit in range of aura-granting unit matching condition (matching unit is in affectable unit group)
Ability - add (improved attack speed) to picked unit.



That should do what you want, unless theres something I'm missing. For IAS ability just use the item ability like gloves of haste.
Doing remove ability then add ability is a great way to ensure that the appropriate units have the ability exactly once.