BoolExpr not Working ?!

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
JASS:
function InitTrig_S takes nothing returns nothing
local trigger t = CreateTrigger(  )
local integer start = 0
local integer end = 16
    loop
    exitwhen start>=end
        call TriggerRegisterPlayerUnitEvent(t,Player(start),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
        set start = start +1
    endloop
    call TriggerAddCondition(t,Condition(function PlagueCond))
    call TriggerAddAction( t, function PlagueAct )
set t = null
endfunction

^ This function works
JASS:
function InitTrig_S takes nothing returns nothing
local trigger t = CreateTrigger(  )
local integer start = 0
local integer end = 16
    loop
    exitwhen start>=end
        call TriggerRegisterPlayerUnitEvent(t,Player(start),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function PlagueCond))
        set start = start +1
    endloop
    call TriggerAddAction( t, function PlagueAct )
set t = null
endfunction

^ This function fails.

Why?
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
I wouldn't worry too much about it. Personally I don't think the boolexpr in the TriggerRegister func has any meaning at all. I might be wrong though.
Either way, I haven't seen any of Blizzards BJ's make use of it
JASS:

function TriggerRegisterAnyUnitEventBJ takes trigger trig, playerunitevent whichEvent returns nothing
    local integer index

    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(trig, Player(index), whichEvent, null)

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
endfunction
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Is that boolexpr refering to the Player(index), or to whichEvent ?
 

emjlr3

Change can be a good thing
Reaction score
395
yea I can never get that shit to work, same with unitinrange
 

yes9111

New Member
Reaction score
8
BoolExpr is sort of like a function but it's not a function really.
but it's special becuz the function is packaged (encapsulated)
and that function is usually "takes nothing returns boolean"

Condition() <- creates a BoolExpr based on the function that you provided.

This is a type of BoolExpr specific to Triggers...
You would need another type of BoolExpr (a function that's been changed/packaged)
I'm guessing it's Filter in this case. (Filter is another type of BoolExpr)

Becomes


more info on http://jass.sourceforge.net/doc/library.shtml <- Triggers subsection
So conditions are for Trigger Conditions
and Filters are for UnitsInRangeMatchingCondition's BoolExprs..
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Learnt new thing agaiN~ +Repo

Thanks for that, great help!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top