HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why does this trigger work only about 75% of the time?

07-30-2006, 06:24 PM#1
Sardius
The problem with this is that most of the time it works, but about 25% of the time, the web effect doesn't get destroyed and remains on the hero... Any idea why that would happen occasionally but not everytime?

Trigger:
Web
Collapse Events
Unit - A unit comes within 66.00 of Web 0291 <gen>
Collapse Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Collapse Actions
Unit - Hide Web 0291 <gen>
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Undead\Web\WebTarget.mdl
Set Web = (Last created special effect)
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 50.00)
Unit - Pause (Triggering unit)
Wait 3.00 seconds
Special Effect - Destroy Web
Unit - Unpause (Triggering unit)
07-30-2006, 07:10 PM#2
Anitarf
Are any other triggers using the variable Web?
07-30-2006, 07:23 PM#3
Fireeye
Ok, i'll tell you why (I think), only fits when Player 1 has more than 1 Unit.
What happens when a second unit comes within range 66 owned by Player 1?
Right, a new effect is created and set.
What happens if the old Effect isn't removed?
Right, the new effect gets the place of the old effect, so you can't remove the old with Web anymore.
This maybe a bit noobish, but i would do it like this.
1. Trigger
Trigger:
Collapse Events
Unit - A unit comes within 66.00 of Web 0291 <gen>
Collapse Conditions
(Owner of (Enteringunit)) Equal to Player 1 (Red)
(Entering unit) Equal to Hero1
Collapse Actions
Unit - Hide Web 0291 <gen>
Special Effect - Create a special effect attached to the overhead of (Entering unit) using Abilities\Spells\Undead\Web\WebTarget.mdl
Unit - Create 1 Dummy for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing (270.0) degrees
Set Web = (Last created special effect)
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Set life of (Entering unit) to ((Life of (Entering unit)) - 50.00)
Unit - Pause Hero1
2. Trigger
Trigger:
Collapse Events
A Unit Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Dummy
(Owner of (Dying unit)) Equal to Player 1 (Red)
Collapse Actions
Special Effect - Destroy Web
Unit - Unpause Hero1
I hope i didn't make any fault.
07-30-2006, 07:28 PM#4
Vexorian
Add this to the beginning of the actions:

Trigger:
Custom Script: local effect udg_web
07-30-2006, 07:38 PM#5
Sardius
When I include this "Custom Script: local effect udg_web" at the beginning of my actions, do I need to remove anything from my trigger, or just insert that in at the top and leave it as is? I'm just not sure what this is intended to do.
07-30-2006, 07:46 PM#6
Alevice
Just "Custom Script: local effect udg_Web" at the beginning.
07-30-2006, 07:49 PM#7
Sardius
I tried that, it gives me an error saying "expected a code statment" and disables the trigger.
07-30-2006, 09:03 PM#8
Anitarf
Did you put it in the very start of the trigger?
07-30-2006, 11:38 PM#9
Sardius
Heh, well right after a "turn this trigger off" But I think that may solve the problem... I think that the spell was triggering multiple times because it was a moving projectile and it didn't turn off on impact... My theory is that the spell was hitting the same target more then once occasionally, thus creating 2 web effects on the same target...
Hopefully my trigger off, will fix this problem.
07-30-2006, 11:41 PM#10
Mezzer
You're supposed to make it the very first line in actions, before anything else, then it will work