- Joined
- Jun 27, 2010
- Messages
- 70
How do i do this: Ok i hve this Engineer unit and i want to add a ability to it that can put down mines then be able to detonate them when they want to causing damage to anyone in area. Plz help!

Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

Events

Unit - A unit Starts the effect of an ability
Conditions

(Ability being cast) Equal to Land mine
Actions

Unit - Add Detonate to (Casting unit)
Events

Unit - A unit Starts the effect of an ability
Conditions

(Ability being cast) Equal to Detonate
Actions

Unit Group - Pick every unit in (Units of type Mine) and do (Actions)


Loop - Actions



Unit - Explode (Picked unit)
Events

Unit - A unit Dies
Conditions

(Unit-type of (Dying unit)) Equal to Mine
Actions

Unit - Cause (Dying unit) to damage circular area after 0.00 seconds of radius 550.00 at (Position of (Dying unit)), dealing 300.00 damage of attack type Chaos and damage type Demolition
Use Triggering Unit instead of dying unit.
Could you please explain exactly why "Triggering unit" is better than "Dying unit"?
I always thought it's better not to use Triggering unit everywhere except such cases when there's no specific event-respond unit. Because "Triggering unit is too general and may not work properly sometimes. Maybe I'm just dumb, explain me where am I wrong?
Are you kidding me? (Triggering Unit) is in the bottom of that dialog, nearly the last string in it. So why do I have to use it?it is closer to the top of the drop-down dialog
Add Ability to (Triggering Unit)
Decrease your menu-scrolling time
Not only is (Triggering unit) <<faster>> than (Casting unit) or (Dying unit) in terms of execution time, it's actually faster to click because it is always the first option on the menu tree. Just use (Triggering unit) and, of course, set it to a variable if you use it more than 2-3 times.
Now that that's been mentioned, how about (Owner of (Triggering unit))? Ever notice that (Triggering player) is the first item on the menu-tree? That's because it's able to be used in more cases than you could imagine.
Every event which is selectable as "Any unit ---" is, in JASS, a "playerunitevent". This means that it has two triggering components, a unit, and a player.
Long story short, every "Any unit event" can use (Triggering player) instead of (Owner of (Triggering unit)) and get the same results.
This will cut down on your menu-scrolling time as well as game execution time, so it's faster in every sense of the word.
You can thank PurgeAndFire for showing me the (Triggering player) trick.
