HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to damage all units in group?

11-11-2006, 02:25 AM#1
Toink
I was wondering how I could damage every unit in a unit group. Could someone help me about it. I would appreciate it if you would also post the code.
11-11-2006, 02:45 AM#2
Anopob
You haven't explained who's in your unit group, so I'll just use a variable "unit_group" and you can set it to whatever you want.

Trigger:
Trigger
Collapse Events
Unit - A unit begins the effect of an ability (or your own event)
Collapse Conditions
(Ability being cast) Equal to (your spell or your own condition)
Collapse Actions
Collapse Unit Group - Pick every unit in unit_group and do (Actions)
Collapse Loop - Actions
Unit - Cause (Your Unit) to damage (Picked unit), dealing (Your Damage) damage of attack type (Pick 1) and damage type (Pick 1)
-------- OR --------
Unit - Cause (Your Unit) to damage circular area after (Your #) seconds of radius (Your Radius) at (Your Place), dealing (Your Damage) damage of attack type (Pick 1) and damage type (Pick 1)

Here I am assuming you are casting a spell. If you got other questions let me know.
11-11-2006, 02:48 AM#3
Toink
OMG, how could I forget that!?! Thanks anyways lol. BUT, I have another question about knockback functions.Here it is :

I was working on my map awhile ago, then I got to the point where I have to ask here again some questions. I don't know much about kattana's handle vars. How could I make a knockback function? I know it uses kattana's handle vars but I don't know much of it. And also how do I make it knockback multiple enemies? Like units within 300 units of my unit. +rep to anyone who can help me here.
11-11-2006, 11:07 PM#4
Anopob
So your question is about JASS? Sorry I can't help much with that :P
11-12-2006, 02:42 AM#5
TaintedReality
Quote:
I was working on my map awhile ago, then I got to the point where I have to ask here again some questions. I don't know much about kattana's handle vars. How could I make a knockback function? I know it uses kattana's handle vars but I don't know much of it. And also how do I make it knockback multiple enemies? Like units within 300 units of my unit. +rep to anyone who can help me here.

Any specific questions? Knockback functions are pretty simple, but it sounds like you might need to learn some basics first. But anyways, here's a basic outline of the steps.

1. Add all enemies (or whatever) within 300 units of your unit to a unit group.
2. Find the angle between your unit and each of the enemies.
3. Periodically move the units back while keeping track of how far they are away from their original position. Use timers or a periodic trigger for this. Once they reach the desired distance then stop knocking them back.

Of course, this is just a very basic outline but I need more specific questions to help you. Here are tutorials on KaTTaNa's system:

http://www.wc3jass.com/viewtopic.php?t=2006
http://www.wc3jass.com/viewtopic.php?t=1999