TriggerHappy
...
- Reaction score
- 341
Possible?
without having some weird ExecuteFunc string typecasting?
without having some weird ExecuteFunc string typecasting?
not possible.
function ExecuteCode takes code f returns nothing
local trigger t = CreateTrigger()
call TriggerAddCondition(t, Condition(f))
call TriggerEvaluate(t)
endfunction
library CallFunc
globals
private trigger Trigger = CreateTrigger()
endglobals
private function CallFunc takes code func returns nothing
call TriggerClearConditions(Trigger)
call TriggerAddCondition(Trigger, Condition(func))
call TriggerEvaluate(Trigger)
endfunction
endlibrary
What whelp suggests works very well
JASS:library CallFunc globals private trigger Trigger = CreateTrigger() endglobals private function CallFunc takes code func returns nothing call TriggerClearConditions(Trigger) call TriggerAddCondition(Trigger, Condition(func) call TriggerEvaluate(Trigger) endfunction endlibrary
The func has to return a boolean so it's a valid condition function.
Input and return values are a bit of a problem when using this, but passing data via globals helps a long way.
not possible.
Wouldn't the filter function be the easiest?