Jass Filter function

Yoww89

New Member
Reaction score
0
Can someone help me with this one from the start?
What does it have to do with GetEnumUnit() and GetFilterUnit()?

As I searched everywhere for some kind of tutorial and found nothing but discussions about its applications that I can't use to understand the basics of it.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
You only use [ljass]GetEnumUnit[/ljass] when you're using [ljass]ForGroup[/ljass], which is a function that loops through every unit in the group passed to it, and calls the function passed to it. You then refer to each unit one at a time with that function.

[ljass]GetFilterUnit[/ljass] is used for other unit iteration, such as GroupEnumUnit* functions, amongst others. Essentially, the function passed to any of these functions is called. Then, inside that function, you check the Filter Unit, and if it matches some condition you want (e.g. you DO want it in the group), you return true. Otherwise, you return false. The wiki has code examples and use cases for group enumeration.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top