| 12-21-2009, 10:50 PM | #2 | |
Quote:
Because you use only 1 timer. You need JASS in order to create multiple timers.Here's what you can do: The script below will cause <timer_variable> to point at a new timer, which you can start separately from other timers (using start timer). ( Replace <timer_variable> with whatever your variable is called: ) Trigger: ![]() Custom Script: set udg_<timer_variable> = CreateTimer()![]() Countdown Timer - Start udg_<timer_variable> as a One-shot timer expiring in 10 secondsWhen you are done with your timer, you should destroy it. Just be careful, because after you've destroyed it, <timer_variable> will point at a destroyed timer ( = null). You can't use StartTimer on <timer_variable> again, unless you first create another timer for it (using CreateTimer). Trigger: Custom Script: call DestroyTimer( udg_<timer_variable> )This is sort of a workaround and hax for your implementation. In JASS, you can make timers call functions when they expire, thus eliminating the need for the extra trigger running every ~0.10 seconds... (hint: triggers are inconvenient, JASS is not :) |
| 12-22-2009, 09:51 AM | #4 | |
Quote:
If you could describe what you want your spell to do, perhaps we can work something out. |
| 12-22-2009, 01:40 PM | #5 |
I've solve my problem, although inefficient compared to timers. Its the only way i can do it in GUI for MUI. I tried to create a spell, which has a channel time, the longer it channels, when release, it will do more damage. I used periodic timer every 0.10seconds, and then add my duration += 0.10seconds. when it hits 1, i will know it is 1 second and so on.. Thanks for the help and clarification [: I will try to look into JASS more. |
| 12-22-2009, 07:36 PM | #6 | |
Quote:
Trigger: ![]() Set timer = (Load (Key time) of (Key (Picked unit)) in timetable)![]() Custom Script: call DestroyTimer(udg_timer)I agree that there's no good way, but look at his code. He's loading the timer from a hash-table every time, so it should be safe to destroy the timer in this case (unless the trigger casts the same spell :P ). |
