Xorifelse
I'd love to elaborate about discussions...........
- Reaction score
- 87
I just got back into mapping again, started to learn vjass right away, but now i'm stuck on something.
I'm not sure how i can fix this a good, easy way.
I can't get the 2 timers working at the same time, while i did do:
I expected vjass was making new indexes to hold sepperate values for sfxa and sfxb but it doesn't.
I'm searching for a good work around for this issue, can anyone trow me a bone?
I'm not sure how i can fix this a good, easy way.
JASS:
library LibSpecialEffects
struct effects
private timer t = CreateTimer()
private static string m
private static real x
private static real y
private static real d
static method Callback takes nothing returns nothing
call DestroyEffect(AddSpecialEffect(.m, GetRandomReal( .x - .d, .x + .d ), GetRandomReal( .y - .d, .y + .d ) ) )
endmethod
method SetData takes string m, real x, real y, real d returns nothing
set .m = m
set .x = x
set .y = y
set .d = d
endmethod
method Start takes real timeout, string m, real x, real y, real d returns nothing
set .m = m
set .x = x
set .y = y
set .d = d
call TimerStart( .t, timeout, true, function effects.Callback )
endmethod
method Stop takes nothing returns nothing
call PauseTimer( .t )
endmethod
method onDestroy takes nothing returns nothing
call PauseTimer( .t )
call DestroyTimer( .t )
set .t = null
endmethod
endstruct
endlibrary
I can't get the 2 timers working at the same time, while i did do:
JASS:
local effects sfxa = effects.create()
local effects sfxb = effects.create()
I expected vjass was making new indexes to hold sepperate values for sfxa and sfxb but it doesn't.
I'm searching for a good work around for this issue, can anyone trow me a bone?