| 02-16-2008, 10:07 PM | #1 |
JASS:call TimerStart(t, 12., false, null) loop exitwhen (TimerGetRemaining(t) == 0.) or (GetUnitAbilityLevel(u2, VB_Buff_ID()) < 1) or (GetWidgetLife(u2) < .405) set charge = charge + ((VB_Damage_Per_Second() + (lvl * 2)) / 2) set SFX[i] = AddSpecialEffectTarget(VB_Graphic(), u2, "chest") set i = i + 1 call PolledWait(.5) call BJDebugMsg("Loop wait ended") endloop call BJDebugMsg("Timer Ended") |
| 02-16-2008, 10:16 PM | #2 |
This statement evaluates to true JASS:(GetUnitAbilityLevel(u2, VB_Buff_ID()) < 1) or (GetWidgetLife(u2) < .405) find out why. EDIT: btw why the hell are you using timers and waits at the same time when using only timers is a lot better idea? |
| 02-16-2008, 11:06 PM | #3 |
Seems to me he's trying to make triggered buffs without using a proper buff system. |
| 02-16-2008, 11:23 PM | #4 | ||
Quote:
Quote:
I don't know why either of them are returning true. The unit is most definitely alive and has the buff. |
| 02-16-2008, 11:28 PM | #5 |
Was i initialized at 0 or did you just did local integer i ? |
| 02-16-2008, 11:32 PM | #6 |
i has been initialized. Everything has been initialized. I've been looking, and there's nothing that points me to believe this should be failing. It completely skips the loop. |
| 02-16-2008, 11:37 PM | #7 |
You can achieve the effect you want without using this stupid loop, and just use a timer and a callback function. |
| 02-16-2008, 11:49 PM | #8 |
1: Timers w/ callbacks never work for me. Ever. 2: I'd have to use a periodic for that, would I not? And wouldn't that mean not being able to control when the timer would end without the use of globals? |
| 02-16-2008, 11:52 PM | #9 |
Well, you can moan here about how it doesn't make sense, or you can try removing individual conditions from that exitwhen statement until you find the one that's true and then figure out why. Maybe your buff ID is inproperly defined. |
| 02-16-2008, 11:56 PM | #10 |
Wow, how retarded. The trigger was firing before the missile reached the target, thus before the buff was given, and thus, ending the loop prematurely. I discovered this by placing a .2 second wait before the start of the loop. If the caster was right next to the target, the spell worked. Otherwise, I'd receive the same result. Gogo Blizzard for making spell effect triggers fire before the effect even begins. |
| 02-17-2008, 01:51 AM | #11 | |
Quote:
|
| 02-17-2008, 03:20 AM | #12 |
Except I'm using "Unit starts the effect of an ability", not "Units starts casting an ability". When using Acid Bomb, for example, the trigger fires before anything actually happens. |
| 02-17-2008, 03:55 AM | #13 |
Events are fired before the event it fires for actually takes place. This is so then you can prevent the event from happening if need be. The events happen right before the events are processed, so there is no delay between the trigger event, and the game event (although the trigger event comes first). |
| 02-17-2008, 12:00 PM | #14 | |
Quote:
|
| 02-17-2008, 01:32 PM | #15 | |
Quote:
And what if buff never came because target had spell shield? |
