HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Using Dummy Units to Target Units in an AOE...

08-09-2006, 03:04 AM#1
Ignitedstar
I'm making a spell that is sort of like Purge and Earthquake put together. What supposed to happen is that every unit in the 300 AOE of Earthquake get hit by Purge.

I have to trigger that, but since Dummy Units are the ones who are going to use Purge, how do I make it so that each unit in the AOE get the Purge buff?

If I'm not descriptive enough, then please say so. Thanks in advance.
08-09-2006, 03:17 AM#2
DioD
Trigger:
Untitled Trigger 001
Events
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 512.00 of (Target point of ability being cast)) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Footman for Player 1 (Red) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)

Something like this
08-09-2006, 03:21 AM#3
Wyvernoid
Hello^^ Set Purge's Cooldown to 0, and try this:
Trigger:
Collapse Events
Unit - XXX Begins casting an ability
Collapse Conditions
(Ablitity Being Cast) Equal to Earthquake
Collapse Actions
Set tempPoint=(Point of Ability Being Cast)
Set tempPlayer=(Owner of (Triggering Unit))
Unit - Create 1 Dummy for tempPlayer at tempPoint facing 0.00 degrees
Set tempUG=(Units in 300.00 of tempPoint Matching ((Matching Unit) belongs to an enemy of tempPlayer))
Unit Group - Pick Every Unit in tempUG and do (Unit - Order (Last Created Unit) to Purge (Picked Unit))
Wait 1.00 seconds
Unit - Remove (Last Created Unit) from game
Custom Script: set udg_tempUG=null
Custom Script: set udg_tempPlayer=null
Custom Script: set udg_tempPoint=null
If there are errors point out plz! Hope there are NO LEAKS^^
08-09-2006, 03:25 AM#4
DioD
Heh unit will not cast ANY spell...
08-09-2006, 05:27 AM#5
Ignitedstar
So, even if I turn the Purge's cooldown to 0, one Dummy unit will purge all of the ones in the AOE? That's kinda strange. I'll try it out. Thanks.
08-09-2006, 05:43 AM#6
Jacek
Quote:
Originally Posted by Wyvernoid
Hello^^ Set Purge's Cooldown to 0, and try this:
Trigger:
Collapse Events
Unit - XXX Begins casting an ability
Collapse Conditions
(Ablitity Being Cast) Equal to Earthquake
Collapse Actions
Set tempPoint=(Point of Ability Being Cast)
Set tempPlayer=(Owner of (Triggering Unit))
Unit - Create 1 Dummy for tempPlayer at tempPoint facing 0.00 degrees
Set tempUG=(Units in 300.00 of tempPoint Matching ((Matching Unit) belongs to an enemy of tempPlayer))
Unit Group - Pick Every Unit in tempUG and do (Unit - Order (Last Created Unit) to Purge (Picked Unit))
Wait 1.00 seconds
Unit - Remove (Last Created Unit) from game
Custom Script: set udg_tempUG=null
Custom Script: set udg_tempPlayer=null
Custom Script: set udg_tempPoint=null
If there are errors point out plz! Hope there are NO LEAKS^^
You are leaking group and location

you should add

Trigger:
Custom script - call RemoveLocation(udg_tempPoint)
Custom script - call DestroyGroup(udg_tempUG)
08-09-2006, 08:18 AM#7
blu_da_noob
That won't work, even with 0 cooldown there is a cast time for the spell. You will need to create a new dummy for each unit in the AoE and make it cast purge on that unit.
08-09-2006, 12:53 PM#8
StockBreak
Yes, blu is right. There is the cast animation time and such (also if you put cast animation to 0 seconds, it will take time to cast etc...). Another thing: it is not wise to use "Last Created Unit" in a trigger after a wait (it should be replaced with a local/global variable).
08-09-2006, 01:54 PM#9
DioD
Best way to use locals inside triggers like this.
08-09-2006, 03:59 PM#10
Ignitedstar
I'm confused. Even if I create a number of Dummy Units equal to the number of units in the AOE, how will I know whether if they each cast Purge on each unit in the AOE or cast Purge on just one person in the AOE?

I don't quite understand how to use local variables. Someone mind telling or directing me someplace?
08-09-2006, 04:13 PM#11
Captain Griffen
Trigger:
Set TempGroup = Units within range you want to Purge
Collapse Unit Group - For each unit in Temp Group do actions
Collapse Loop
Set TempPoint = Position of (Picked Unit).
Unit - Create PURGER DUMMY at TempPoint.
Unit - Order (last created unit) to PURGE (Picked unit).
Unit - Add Generic expiration timer of 2 seconds to (last created unit).
Custom script: call RemoveLocation(udg_TempPoint).
Custom script: call DestroyGroup(udg_TempGroup).
08-09-2006, 05:23 PM#12
The)TideHunter(
Yep, Griff is right.
Although it was written himself, it is right!
08-09-2006, 07:04 PM#13
Vexorian
Purge is instant cast. It is possible to make one dummy cast purge on multiple units in the same moment

You only need a unit with cast backswing point and stuff like that set to 0.

Just remember to move the unit to the position of the target and to reset cooldown and mana / have the spell cost 0 cooldown and mana.
08-09-2006, 07:20 PM#14
blu_da_noob
Is that a special attribute of purge? I'm fairly sure it isn't like that for all spells.
08-09-2006, 07:22 PM#15
Vexorian
Almost every spell is instant cast. So I see your "fairly sure" as "I did not try to change the fields of the dummy unit". In fact, this is the first reason I got to make the caster system.