Configurable Filter

Ayanami

칼리
Reaction score
288
How would I make filtering configurable? For example, I want to make the targets allowed for a spell to be configurable. How would I make the filtering configurable? Thanks in advance.
 

luorax

Invasion in Duskwood
Reaction score
67
Filters' type is boolexpr. You can use boolexp type variables and you can pass them.
For example:

JASS:
local boolexpr b = Condition(function ASDF))
local group g = CreateGroup()
call GroupEnumUnitsInRange(g, 0., 0., 100., b)

You can use global variables too, of course.
And as I remember, "and" & "or" operators work with boolexprs too. But I'm not sure.
 

DioD

New Member
Reaction score
57
you dont need variables for Condition and Filter, this is static functions (just like player)
 

tooltiperror

Super Moderator
Reaction score
231
JASS:
//===========================
//  CONFIGURABLES
//===========================
globals
    // The Rawcode of the Spell
    private constant boolean SPELL_ID='A000'
endglobals

// Brief description of filter function ...
private function Spell_Filter takes unit enum returns boolean
    return (GetUnitTypeId(enum)=='hfoo')
endfunction

//===========================
//  END OF CONFIGURABLES
//===========================


:)
 

Ayanami

칼리
Reaction score
288
JASS:
//===========================
//  CONFIGURABLES
//===========================
globals
    // The Rawcode of the Spell
    private constant boolean SPELL_ID='A000'
endglobals

// Brief description of filter function ...
private function Spell_Filter takes unit enum returns boolean
    return (GetUnitTypeId(enum)=='hfoo')
endfunction

//===========================
//  END OF CONFIGURABLES
//===========================


:)

Yup, just found that out a few hours ago xD
 

Laiev

Hey Listen!!
Reaction score
188
JASS:
//===========================
//  CONFIGURABLES
//===========================
globals
    // The Rawcode of the Spell
    private constant boolean SPELL_ID='A000'
endglobals

// Brief description of filter function ...
private function Spell_Filter takes unit enum returns boolean
    return (GetUnitTypeId(enum)=='hfoo')
endfunction

//===========================
//  END OF CONFIGURABLES
//===========================


:)

private constant BOOLEAN? :O
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top