HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Or's in JASS

06-11-2006, 12:06 PM#1
darkwulfv
Can somebody give me a very quick example of using Or's in JASS? I know its probably easy but I want to be sure it's as simple as putting an or in there.
06-11-2006, 12:08 PM#2
Zoxc
Collapse JASS:
if true or false then // Always true
endif
if false or false then // Always false
endif
if true or true then // Always true
endif
06-11-2006, 12:17 PM#3
darkwulfv
Thx Im gonna experiment. What I was thinking was more like:
Event blah blah blah
Condition: Unit picked equal to Unit
or
Unit2
or
Unit3
or
Unit4

How would that be done? I'm thikning I just have to put in the 4 seperate conditions in GUI then insert Or's between them in JASS.
06-11-2006, 12:28 PM#4
Jacek
There is OR in conditions ^_^ even in GUI
06-11-2006, 12:31 PM#5
darkwulfv
meh... Or's confuse me. I think I'm gonna try an If/then/else do multi actions action. Little eaier for me to undertand.
06-11-2006, 12:31 PM#6
Tim.
Collapse JASS:
local unit u = GetTriggerUnit()
if u == YourType1 then
    //Do actions
elseif u == YourType2 then
    //Do actions
elseif u == YourType3 then
    //Do actions
endif
set u = null
06-11-2006, 12:51 PM#7
The)TideHunter(
Collapse JASS:
function Enum_CheckStuff takes nothing returns boolean
    return (GetWidgetLife(GetEnumUnit()) > 500) or (IsUnitType(GetEnumUnit(), UNIT_TYPE_DEAD))    
endfunction
06-11-2006, 12:55 PM#8
darkwulfv
Thx Tim. That works. But for actions I would do like:
Do Call KillUnit(u) or whatever, right?
06-11-2006, 12:58 PM#9
The)TideHunter(
Change 1 of the 'Your actions here' to this then:

Collapse JASS:
call KillUnit(u)
06-11-2006, 01:00 PM#10
darkwulfv
k that works easier for me now : ) Thx guys : )