HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What is going on here?

02-16-2008, 10:07 PM#1
darkwulfv
Collapse 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")
As soon as I cast this spell, the message "Timer Ended" comes up, and nothing happens. Yes, the timer has already been created. What am I doing wrong here?
02-16-2008, 10:16 PM#2
cohadar
This statement evaluates to true
Collapse 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
Anitarf
Seems to me he's trying to make triggered buffs without using a proper buff system.
02-16-2008, 11:23 PM#4
darkwulfv
Quote:
btw why the hell are you using timers and waits at the same time when using only timers is a lot better idea?
It's not the whole trigger. The damage is supposed to go up by half-second increments; hence the .5 second wait.

Quote:
Seems to me he's trying to make triggered buffs without using a proper buff system.
Yeahh...no. I'm checking if the unit still has the buff (in case it gets purged or something). And through testing, I see that it does retain the buff at all times during the spells 12 second intended duration.


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
Malf
Was i initialized at 0 or did you just did local integer i ?
02-16-2008, 11:32 PM#6
darkwulfv
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
Malf
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
darkwulfv
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
Anitarf
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
darkwulfv
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
Pyrogasm
Quote:
Originally Posted by darkwulfv
Gogo Blizzard for making spell effect triggers fire before the effect even begins.
Don't use Acid Bomb then; it's just because the spell has a projectile. It wouldn't make sense for units to lose armor and then have a flask of voodoo juice land on them. Neither would it make sense for the spell "cast" to trigger a good half second after the spell is cast; at that point the unit could be doing something entirely different than casting the spell.
02-17-2008, 03:20 AM#12
darkwulfv
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
Ammorth
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
Vexorian
Quote:
Originally Posted by darkwulfv
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.
huh? Wasn't public domain that you first wait to the buff to come before waiting for the buff to go out? We did that stuff since 2004...
02-17-2008, 01:32 PM#15
cohadar
Quote:
Originally Posted by Vexorian
huh? Wasn't public domain that you first wait to the buff to come before waiting for the buff to go out? We did that stuff since 2004...

And what if buff never came because target had spell shield?