• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Boolean & Boolexpr Difference

Status
Not open for further replies.

Rui

Rui

Level 40
Joined
Jan 7, 2005
Messages
7,539
Hi.

I've been trying to make a script but it uses the function GroupEnumUnitsInRect, and it takes a booleanexpr or boolexpr or whatever it is named. Problem is, I do not know the difference between those last two.
I've been using "false/true", and obviously it yells at me that it can't turn one into another.:hohum:

Help is appreciated.
~Thanks for your time. Do not be afraid to answer:smile:
 
Level 2
Joined
Feb 24, 2007
Messages
37
Boolexpr is in this case a filter. For example:

JASS:
function Explode takes nothing returns nothing
call ExplodeUnitBJ(GetEnumUnit())
endfunction
//
function DeadFilter takes nothing returns boolean
return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0 
endfunction
//
function YourFunction takes nothing returns nothing
local boolexpr filter = Condition(function DeadFilter)
call GroupEnumUnitsInRect(YourGroup, YourRect, filter)
call ForGroup(YourGroup, function Explode)
call DestroyBoolexpr(filter)
endfunction


This will pick every dead unit in YourRect and makes it explode. If you want all units in a rect then just put null at the boolexpr.
 
  • Like
Reactions: Rui
Level 19
Joined
Aug 24, 2007
Messages
2,888
it wont compile as I know

local filterfunc filter = Filter(function DeadFilter) :/

(bah Im not sure)
 
Level 2
Joined
Feb 24, 2007
Messages
37
You can use both.

Condition:
JASS:
native Condition        takes code func returns conditionfunc

JASS:
type conditionfunc      extends     boolexpr


Filter:
JASS:
native Filter           takes code func returns filterfunc

JASS:
type filterfunc         extends     boolexpr
 
Status
Not open for further replies.
Top