- Joined
- Jul 17, 2006
- Messages
- 145
I dont really know if the forum needs this but i came up with it when working on my map and i thought it might be helpfull to some other people.
Just a little something i made up, because the stupid blizzard GUI only allows you to destroy the last created special effect, which means you couldnt destory an effect once you create a new one (unless you assign the effect to a variable)
As you can see this uses local var's and so is compleatly multi-instancable, and you avoid using huge arrays like some people have suggested to me. Just stick this in the header of your map and have fun ^^.
It also works well if your to lazy to do the three lines of text required to destroy a special effect with variables. Its pretty much those three lines condenced into a function.
Heres an example: (Attachment)
Please vote and say why!
JASS:
//NOTE: this function uses Vexorians CSCache system ( [url]http://forums.dota-allstars.com/index.php?showtopic=92616[/url] )
//Variable e = the effect being destroyed
//Variable r = the timeout/life you want for the effect
function DstryEfft_Action takes nothing returns nothing
local timer t = GetExpiredTimer()
local effect e = GetAttachedEffect(t, "effect")
call DestroyEffect(e)
call FlushHandle(t)
call DestroyTimer(t)
set t = null
set e = null
endfunction
function DstryEfft takes effect e, real r returns nothing
local timer t = CreateTimer()
call AttachObject(t, "effect", e)
call TimerStart(t, r, false, function DstryEfft_Action)
set t = null
endfunction
Just a little something i made up, because the stupid blizzard GUI only allows you to destroy the last created special effect, which means you couldnt destory an effect once you create a new one (unless you assign the effect to a variable)
As you can see this uses local var's and so is compleatly multi-instancable, and you avoid using huge arrays like some people have suggested to me. Just stick this in the header of your map and have fun ^^.
It also works well if your to lazy to do the three lines of text required to destroy a special effect with variables. Its pretty much those three lines condenced into a function.
Heres an example: (Attachment)
Please vote and say why!
Last edited: