HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Whirlwind?

02-19-2006, 09:57 PM#1
Tiki
Based off thunderclap, it damages/slows enemies and also casts cyclone on all enemies in 325 range, sometimes it works but only cyclones one unit.

How to make it work?

Trigger:
Whirlwind
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Whirlwind
Collapse Actions
Set Tempest[3] = (Casting unit)
Unit - Create 1 Caster [Caster System] for (Owner of Tempest[3]) at (Position of Tempest[3]) facing Default building facing degrees
Set TempestFx[2] = (Last created unit)
Collapse Unit Group - Pick every unit in (Units in (Region centered at (Position of Tempest[3]) with size (325.00, 325.00)) matching (((Picked unit) belongs to an enemy of (Owner of Tempest[3])) Equal to True)) and do (Actions)
Collapse Loop - Actions
Unit - Order TempestFx[2] to Night Elf Druid Of The Talon - Cyclone (Picked unit)
Unit - Remove TempestFx[2] from the game
02-19-2006, 10:00 PM#2
Blade.dk
IT is because of casting times, sometimes the dummy unit does not have enought time to cast the spell, so it will only cast it on one unit, try to create a new dummy everytime in the For Group Loop and order it to cast it on picked unit, then add an expiration timer of like 1 second to the dummy so it will be removed. That should make it work.
02-19-2006, 10:09 PM#3
Jacek
Blade.dk is right. Oh and you are leaking region, because you make region centered on unit. Use - "Units in range 325 from Position of (Casting unit)" it will leak anyways but I'll leave it to you to fix it.
02-19-2006, 10:27 PM#4
Tiki
Thanks alot guys. lawl i shud learn triggers more

Trigger:
Whirlwind
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Whirlwind
Collapse Actions
Set Tempest[3] = (Casting unit)
Collapse Unit Group - Pick every unit in (Units within 200.00 of (Position of Tempest[3]) matching (((Matching unit) belongs to an enemy of (Owner of Tempest[3])) Equal to True)) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Caster [Caster System] for (Owner of Tempest[3]) at (Position of Tempest[3]) facing Default building facing degrees
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Cyclone (Picked unit)
02-19-2006, 10:33 PM#5
Blade.dk
And leak removal :P.

Trigger:
Whirlwind
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Whirlwind
Collapse Actions
Set Tempest[3] = (Casting unit)
Set MyPointVar = (Position of Tempest[3])
Custom Script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Units within 200.00 of (MyPointVar) matching (((Matching unit) belongs to an enemy of (Owner of Tempest[3])) Equal to True)) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Caster [Caster System] for (Owner of Tempest[3]) at (MyPointVar) facing Default building facing degrees
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Cyclone (Picked unit)
Custom Script: call RemoveLocation(udg_MyPointVar)
02-19-2006, 10:54 PM#6
Tiki
And what does that exactly do?
02-19-2006, 11:07 PM#7
Blade.dk
It prevents your trigger from leaking == creating objects that you never remove, which takes up memory and can make your map lag and stuff.