HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Filter function ?

11-23-2006, 01:57 AM#1
Daxtreme
What are those ?

Example: GetFilterUnit()

What are they used for? I just don't know ;)
11-23-2006, 02:45 AM#2
Jazradel
GetFilterUnit() refers to Matching Unit. Use it in a filter condition.
11-23-2006, 02:50 AM#3
Vexorian
An example

Collapse JASS:
function MyFilter takes nothing returns boolean
    return GetWidgetLife( GetFilterUnit() ) < 50.0
endfunction

function test takes nothing returns nothing
 local group g=CreateGroup()
 local boolexpr B=Condition(function MyFilter)
     call GroupEnumUnitsInRange(g,0.0,0.0,100000.0, B)
     // the group g now contains units that have less than 50 hitpoints.
     call RemoveBoolExpr(B)
 set B=null
 set g=null
endfunction

11-23-2006, 03:02 AM#4
Daxtreme
Awww so stupid I never saw this. Thx guys ;)

I should read tuts about boolexpr. I just used one in a trigger and I don't even understand them :P