1. Say I want to create a function that takes another function as an argument and executes it.
What are the differences between these, if any? Cohadar's TT system uses the latter - is there a reason for that?
2. I read only recently that because DestroyTrigger() was unsafe (handle stack index corruption apparently), dynamic triggers (i.e. triggers created for a while with events, then later destroyed) were unsafe. I also heard there were better alternatives to using dynamic triggers. Are there, and what are they?
2.5. Oh yes, someone also said that timers were perfect substitutes for triggers, hence rendering the latter obsolete. How so? I know that some events can be simulated with periodic checks, but some can't.
Thanks in advance.
JASS:
function A takes string funcname returns nothing
call ExecuteFunc(funcname)
endfunction
JASS:
function B takes code funcname returns nothing
local trigger t = CreateTrigger()
call TriggerAddCondition(t, Condition(funcname))
call TriggerEvaluate(t)
call DestroyTrigger(t)
set t = null
endfunction
What are the differences between these, if any? Cohadar's TT system uses the latter - is there a reason for that?
2. I read only recently that because DestroyTrigger() was unsafe (handle stack index corruption apparently), dynamic triggers (i.e. triggers created for a while with events, then later destroyed) were unsafe. I also heard there were better alternatives to using dynamic triggers. Are there, and what are they?
2.5. Oh yes, someone also said that timers were perfect substitutes for triggers, hence rendering the latter obsolete. How so? I know that some events can be simulated with periodic checks, but some can't.
Thanks in advance.