HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

TriggerRegisterPlayerUnitEvent usage question

07-30-2008, 01:03 AM#1
grupoapunte
Hi, anyone knows how does the boolexpr in this function works? what kind of filtering can i use?

native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event

Thanks!
07-30-2008, 01:17 AM#2
ToukoAozaki
Well, I remember seeing similar question before.

Anyway, that works exactly like trigger conditions. The filter you provide will be evaluated first, and then trigger conditions will be evaluated. If any of these filters (including conditions) return false, the trigger will not be executed.

To create filters, you can use Filter() function which takes a function as its argument.

Collapse JASS:
function myfunc takes nothing returns boolean
    return false
endfunction

Filter(function myfunc)

Well, I think you may only use GetFilterUnit() in that function.
08-01-2008, 02:01 AM#3
grupoapunte
so using this may be faster than trigger conditions, right?
08-01-2008, 04:05 AM#4
DioD
there is problems with boolexpr inside event registration - they not called.