- Joined
- Mar 1, 2013
- Messages
- 555
Hi.
I want to make a timed effect struct that allows you to create a special effect at a target location and having it removed a few seconds later. This is what I have so far:
The problem is that timers can only call static methods that takes and returns nothing. How can I tell method RemoveEffect which instance to remove?
Thanks for your time.
I want to make a timed effect struct that allows you to create a special effect at a target location and having it removed a few seconds later. This is what I have so far:
JASS:
struct TimedEffect extends array
effect sfx
timer tmr
static method RemoveEffect takes nothing returns nothing
//call DestroyEffect(sfx)
endmethod
method AddEffect takes string path, real x, real y, real tm returns effect
set sfx = AddSpecialEffect(path, x, y)
call TimerStart(tmr, tm, false, function thistype.RemoveEffect)
return sfx
endmethod
endstruct
The problem is that timers can only call static methods that takes and returns nothing. How can I tell method RemoveEffect which instance to remove?
Thanks for your time.