That's my secret discovery! Don't tell nobody. Not even people you think you can trust. Don't even tell me.
What? I don't understand. I've never found a good reason to use ExecuteFunc. Ever. Especially since I hear Vex's map optimizer causes it to just crash.I beg to differ; using TriggerExecute is the bigger problem if you have a [ljass]TriggerSleepAction[/ljass] call, because all associated threads will stop. Right now, I'm usuing a condition which then calls [ljass]ExecuteFunc[/ljass], and that's its only purpose (it's a dynamic trigger with a wait period inside of it).
What? I don't understand. I've never found a good reason to use ExecuteFunc. Ever. Especially since I hear Vex's map optimizer causes it to just crash.
//! private static method retrofit takes nothing returns nothing local unit a=GetTriggerUnit() call retro.deallocate(retro[a]) loop call TriggerSleepAction(0) exitwhen (UnitAlive(a) and retro.allocate(a)!=0) or retro[a]==0 endloop set a=null endmethod /** * death -> deallocate() * * triggeractions crash when I reset var_onDetect; * TriggerSleepAction does not work with triggerconditions; * so I present to you a triggercondition just to call ExecuteFunc(); */ private static method removeOnDeath takes nothing returns boolean call ExecuteFunc(retrofit.name) return false endmethod private static method remakeTrigger takes nothing returns nothing local retro dat=0 // reset trigger; call DestroyTrigger(var_onDetect) set var_onDetect=CreateTrigger() call TriggerAddCondition(var_onDetect,Filter(function retro.removeOnDeath)) // state-detection events need to be reset as they were destroyed with the trigger; loop set dat=dat.next exitwhen dat==0 call TriggerRegisterUnitStateEvent(var_onDetect,dat.subject,UNIT_STATE_LIFE,LESS_THAN,0.405) endloop endmethod
Plenty of people use the Optimizer. If your system uses ExecuteFunc, people are sure gonna have a hard time finding out why their map does nothing but crash.A bug with a program I don't even use, how about just don't use a program with a stupid bug? ExecuteFunc is an important native to JASS and the fact that an optimizer breaks it just means to throw out the optimizer.
func.execute() is a waste, too, it eats the same amount of trigger/action space as if you set it up yourself, but it makes worthless duplicates of the function during compile-time (generated method executor of... generated method caller of...)