HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Invulnerability Aura

01-02-2006, 10:27 AM#1
Uzhgi
The problem with this, the units become invulnerable, but stays like that even though they leave the aura.

Quote:
Unit - A unit Learns a skill

(Learned Hero Skill) Equal to Human Paladin - Devotion Aura

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Learning Hero) is in (Units owned by Player 1 (Red))) Equal to True
Then - Actions
Region - Center Invulnerability Red <gen> on (Position of (Learning Hero))
Wait 0.05 seconds
Unit Group - Pick every unit in (Units in Invulnerability Red <gen> owned by Player 1 (Red)) and do (Actions)
Loop - Actions
Unit - Make (Picked unit) Invulnerable
Wait 2.80 seconds
Unit - Make (Picked unit) Vulnerable
Wait 0.05 seconds
Trigger - Run (This trigger) (ignoring conditions)
Else - Actions
Do nothing
01-02-2006, 11:24 AM#2
Blade.dk
You cannnot use waits in group functions. Instead I would add all units in the rect to a global unit group variable, and make a trigger that periodically checks if the units are outside the rect, and when they are, make them vulnerable and remove them from the group.
01-02-2006, 03:16 PM#3
Vexorian
if you execute a trigger inside "pick every unit" statements, the trigger can use picked unit and have waits
01-02-2006, 04:44 PM#4
Starcraftfreak
And please, don't use [quote] for trigger posting. Use [trigger] (preferred) or at least [code].
01-02-2006, 05:48 PM#5
[niro]
I'd use three triggers, one that constantly centers the invulnerability aura region on the hero.

One that gives invulnerability to the entering unit if they are on their team.

And one that removes tha aura when they leave the region.
01-02-2006, 06:24 PM#6
Uzhgi
soz star :P
... tried what niro suggested... however... no result...
these are the 3 triggers i made:
Trigger:
Protection of Wind Red 1
Collapse Events
Unit - A unit Learns a skill
Collapse Conditions
(Learned Hero Skill) Equal to Human Paladin - Devotion Aura
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Learning Hero) is in (Units owned by Player 1 (Red))) Equal to True
Collapse Then - Actions
Region - Center Invulnerability Red <gen> on (Position of (Learning Hero))
Wait 2.00 seconds
Trigger - Run (This trigger) (checking conditions)
Collapse Else - Actions
Do nothing


Trigger:
Protection of Wind Red 2
Collapse Events
Unit - A unit enters Invulnerability Red <gen>
Collapse Conditions
(Owner of (Entering unit)) Equal to Player 1 (Red)
Collapse Actions
Unit - Make (Entering unit) Invulnerable


Trigger:
Protection of Wind Red 3
Collapse Events
Unit - A unit leaves Invulnerability Red <gen>
Collapse Conditions
(Owner of (Leaving unit)) Equal to Player 1 (Red)
Collapse Actions
Unit - Make (Leaving unit) Vulnerable