HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Explosives

01-11-2006, 11:55 PM#1
Volte
I tried making a unit called "Explosives" and having a trigger watch for when it dies, which then deals damage to the surrounding area, only problem is it doesnt work. O.o

- Events
Unit - A unit Dies
- Conditions
(Unit-type of (Triggering unit)) Equal to Explosive
- Actions
Game - Display to (All players) the text: Explode
Unit - Cause (Attacking unit) to damage circular area after 0.00 seconds of radius 8000.00 at (Position of (Dying unit)), dealing 6000.00 damage of attack type Spells and damage type Normal

I have the text in there to check to see if it actually gets triggered and it does, so why aren't my units dying?

EDIT: Oh and I tried having the dying unit deal the damage but that didn't work either. And at any-rate, I thought that the attacking unit should do the damage so it is responsible for the occurring deaths.
01-12-2006, 12:11 AM#2
AnarkiNet
because "Attacking Unit" doesnt exist in this situation. Attacking Unit is an event response for the "Unit - Unit is Attacked" event.
01-12-2006, 12:14 AM#3
Volte
Awesome thanks, but after your suggestions I changed it to:
Unit - Cause (Killing unit) to damage circular area after 0.00 seconds of radius 8000.00 at (Position of (Dying unit)), dealing 6000.00 damage of attack type Spells and damage type Normal

And it still does not work, any ideas?
01-12-2006, 12:20 AM#4
[niro]
Just make a ability based off of AoE on death and give it to the unit.
01-12-2006, 12:31 AM#5
Volte
I need the killing unit to be responsible for the deaths, how can I make this trigger work?

BTW: This needs to be moved to the trigger section, I posted before I realized this.
01-12-2006, 12:48 AM#6
AnarkiNet
you should use "Dying Unit" instead of "Killing Unit". "Killing Unit" is the one that lands the final blow on the "Dying Unit", so if the unit which dies is supposed to explode and deal the damage, it would make absolutely no sense to have the AOE damage caused by the killing unit.
01-12-2006, 01:20 AM#7
[niro]
What I meant, was give the unit that is going to die, the AoE on death, then you don't have to worry about doing it with triggers.
01-12-2006, 01:58 AM#8
Shisho
Well the trigger conditions say the dying unit has to be an explosion unit dying. So that doesn't make much sense if you want this explosion unit to be spawned from a dying unit, or if it's something like an exploding unit like a bomb or barrel of explosives you attack and dies you will set your trigger actions to be based of (triggering unit).

The triggering unit in the case is a "Dying Unit" = "Exploding Unit".

Those attacked and attacking triggers are only really used in events for A Unit is Attack, and the Dying and Killing are similiar to that. However, triggering unit is the unit that firing the triggers event/condition. Try that one out.
01-12-2006, 02:45 AM#9
Naakaloh
He wants an explosive that other units can destroy so that the unit that destroys the explosive gets credit for the kills made by the explosion. So he wants the 'Killing Unit' to do the damage.

I'm not sure what's wrong, but it might have something to do with the action. Try putting some text after the action also; if it doesn't display, then there is probably something wrong with the action. I'm not sure if this will help, but you might want to try it instead.

Trigger:
Actions
Collapse Unit Group - Pick every unit in (Units within 8000.00 of (Position of (Dying unit))) and do (Actions)
Collapse Loop - Actions
Unit - Cause (Killing unit) to damage (Picked unit), dealing 6000.00 damage of attack type Spells and damage type Normal

Also, as a side note, 8000 is a huge radius. The radius for Starfall is only 1000.
01-12-2006, 03:18 AM#10
Volte
Quote:
Originally Posted by Naakaloh
He wants an explosive that other units can destroy so that the unit that destroys the explosive gets credit for the kills made by the explosion. So he wants the 'Killing Unit' to do the damage.

I'm not sure what's wrong, but it might have something to do with the action. Try putting some text after the action also; if it doesn't display, then there is probably something wrong with the action. I'm not sure if this will help, but you might want to try it instead.

Trigger:
Actions
Collapse Unit Group - Pick every unit in (Units within 8000.00 of (Position of (Dying unit))) and do (Actions)
Collapse Loop - Actions
Unit - Cause (Killing unit) to damage (Picked unit), dealing 6000.00 damage of attack type Spells and damage type Normal

Also, as a side note, 8000 is a huge radius. The radius for Starfall is only 1000.

Exactly, and that's what I've done thanks for your help all :D

EDIT: BTW here is my final thing:

Trigger:
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Explosive
Collapse Actions
Wait 0.15 seconds
Game - Display to (All players) the text: Explode
Collapse Unit Group - Pick every unit in (Units within 400.00 of (Position of (Dying unit))) and do (Actions)
Collapse Loop - Actions
Unit - Cause (Killing unit) to damage (Picked unit), dealing (400.00 - (Distance between (Position of (Dying unit)) and (Position of (Picked unit)))) damage of attack type Pierce and damage type Normal
01-12-2006, 03:41 AM#11
AnarkiNet
that leaks a lot, but if it works, i guess it works.
01-12-2006, 07:49 AM#12
Starcraftfreak
Quote:
Originally Posted by AnarkiNet
that leaks a lot, but if it works, i guess it works.
Yes so when this sort of unit dies a lot on your map, you want to optimize it. Start learning Jass

To be precise, it leaks a group and 3 locations.
01-12-2006, 03:32 PM#13
Immoralis
You know how clockwork goblins do damage when they die, give your unit that ability and you don't even need triggers.
01-12-2006, 03:42 PM#14
Chuckle_Brother
Note again that he wants the killing unit to be responsible.

Trigger:
Actions
Set TempPoint = (Position of (Dying unit))
Set TempGroup = (Units within 8000.00 of TempPoint)
Collapse Unit Group - Pick every unit in TempGroup and do (Actions)
Collapse Loop - Actions
Unit - Cause (Killing unit) to damage (Picked unit), dealing 6000.00 damage of attack type Spells and damage type Normal
Unit Group - Remove all units from TempGroup
Custom script: call DestroyGroup(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint)

This wouldn't leak would it?

P.S. @Thread Started Guy, waiting will cause this trigger to restart if another unit dies during that wait period.
01-12-2006, 03:53 PM#15
Volte
How does it leak? Not to sure on what that all entails.