HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

(Help) struct/timer problems

03-29-2009, 07:18 AM#1
cosmicat
Never mind the title. I figured it out shortly after posting this, but can't delete the thread.

I'm trying to help another user (deolrin) with a "fear" spell that causes a unit to run away from the position of the caster. I'm using a struct to contain a unit and various "things" that need to remain associated to that particular unit. I'm also using timers because (1) I need to learn how to use timers and (2) deolrin wants the spell's effect to stop on either of two conditions: time expires or the unit is damaged.

Originally, this was a problem I was asking about, but I figured it out myself (forgot to destroy a trigger I was done with, though I still don't understand why it caused the specific problem it did). Unfortunately, it seems I can't delete this post, so instead I'm opening it up to criticism.

Oh, and the only library I'm using is Vexorian's TimerUtils (blue flavor).

Update: fixed some singularly nasty bugs.

Expand Fear:
03-29-2009, 02:16 PM#2
Anitarf
Ugh, dynamic triggers and direct custom value use... that's ugly.
03-29-2009, 11:39 PM#3
cosmicat
What about "inner beauty"? :P

Anyway, yeah, Awesome Ownagealacaster already explained why dynamic triggers are considered "ugly," and actually showed me one of your spells to illustrate the potential of Handle Tables. So even though I still haven't really figured out timers (y'all keep insisting that you can pass locals to timers, but I just don't see a way...), this new Table thang is going on the list of things to learn.

Unfortunately (well, depending on how you look at it), I seem to be making too much of a priority out of all this cool vJASS stuff (which is probably getting boring to you by now, since you went and mastered it while I was wasting time on superficial Naga icons and Diablo II items that vanished last year after I stopped playing). I really ought to be doing my homework. If I can just peel myself away from this here computer screen... nnnnn...