(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Modding > World Editor Help Zone

World Editor Help Zone Need help with Blizzard's World Editor? Ask general questions about its features and use in this forum. README!

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 02-17-2008, 07:09 PM   #1 (permalink)
Administrator/Director Rui
Development Director

-------------------------
 
Join Date: Jan 2005
Posts: 5,603

Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)


Question Boolean & Boolexpr Difference

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.

Help is appreciated.
~Thanks for your time. Do not be afraid to answer
Rui is offline  
Old 02-17-2008, 07:12 PM   #2 (permalink)
 
hvo-busterkomo's Avatar

Resistance 2
 
Join Date: Jul 2007
Posts: 739

hvo-busterkomo has little to show at this moment (57)


boolexpr = handle
boolean = true or false
__________________
Current Projects:

Humans vs Orcs v5.01 full release: 98%

Untitled Warcraft 1-2 historical reenactment: 30%
hvo-busterkomo is offline  
Old 02-17-2008, 07:16 PM   #3 (permalink)
Administrator/Director Rui
Development Director

-------------------------
 
Join Date: Jan 2005
Posts: 5,603

Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)


Ok, so give me an example of how to use the GroupEnumUnitsInRect correctly.
Rui is offline  
Old 02-17-2008, 09:39 PM   #4 (permalink)

User
 
Join Date: Feb 2007
Posts: 44

Hatred has little to show at this moment (12)Hatred has little to show at this moment (12)


Boolexpr is in this case a filter. For example:

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.
Hatred is offline  
Old 02-18-2008, 01:22 PM   #5 (permalink)
 
Need_O2's Avatar

meow
 
Join Date: Aug 2007
Posts: 2,528

Need_O2 is a jewel in the rough (183)Need_O2 is a jewel in the rough (183)


it wont compile as I know

local filterfunc filter = Filter(function DeadFilter) :/

(bah Im not sure)
Need_O2 is offline  
Old 02-18-2008, 02:26 PM   #6 (permalink)
Administrator/Director Rui
Development Director

-------------------------
 
Join Date: Jan 2005
Posts: 5,603

Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)Rui is a glorious beacon of light (563)


Alright, thanks for the help. I didn't know it was supposed to be a condition. Makes sense, hehe.
Rui is offline  
Old 02-18-2008, 02:26 PM   #7 (permalink)

User
 
Join Date: Feb 2007
Posts: 44

Hatred has little to show at this moment (12)Hatred has little to show at this moment (12)


You can use both.

Condition:
native Condition takes code func returns conditionfunc

type conditionfunc extends boolexpr


Filter:
native Filter takes code func returns filterfunc

type filterfunc extends boolexpr
Hatred is offline  
Old 02-18-2008, 02:33 PM   #8 (permalink)
 
Need_O2's Avatar

meow
 
Join Date: Aug 2007
Posts: 2,528

Need_O2 is a jewel in the rough (183)Need_O2 is a jewel in the rough (183)


LoL right (note to myself: read common.j)
Need_O2 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[JASS] Problem with boolexpr (or group) Arrkan Triggers & Scripts 6 11-30-2006 04:56 PM
[&#20013;&#22283;&#20154;] &#23427;&#263 v3ck Off-Topic 9 03-28-2006 01:41 AM
Whats the Difference between Fake games & the original o Doodi Off-Topic 9 09-09-2005 08:03 AM
&#1050;&#1072;&#1088;&#1090;&#1099; Nicitos Map Development 4 04-16-2005 08:21 PM
Whats The Difference A Skin & A Model The_HeadSpliter Off-Topic 2 12-06-2004 05:06 AM

All times are GMT. The time now is 06:51 AM.






Your link here 
Tutorial eBook PDF Download | Internet Advertising | Bankruptcy | Mortgages | Proxy
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle