HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why doesn't this trigger work?

02-22-2007, 07:59 PM#1
Zycat
Collapse JASS:
function Trig_Items_Func002X takes nothing returns nothing
    call DisplayDebugPlain("Items")
endfunction

function Trig_Items_Actions takes nothing returns nothing
    call DisplayDebugPlain("Enum")
    call EnumItemsInRect(bj_mapInitialPlayableArea, null, function Trig_Items_Func002X)
endfunction

//===========================================================================
function InitTrig_Items takes nothing returns nothing
local trigger gg_trg_Items = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Items, 3.00 )
    call TriggerAddAction( gg_trg_Items, function Trig_Items_Actions )
endfunction

It never displays "Items", just displaying "Enum" alone which means the enum function doesn't get called.
02-22-2007, 11:11 PM#2
WNxCryptic
It never outputs "Items" AND it never outputs "Enum"

Or it outputs "Enum" but not "Items" ?
02-23-2007, 02:10 AM#3
Pyrogasm
It's this line I believe:
Collapse JASS:
call EnumItemsInRect(bj_mapInitialPlayableArea, null, function Trig_Items_Func002X)
It should be
Collapse JASS:
call EnumItemsInRect(GetPlayableMapRect(), null, function Trig_Items_Func002X)
You can also change those DisplayDebugPlain()s to BJDebugMsg(), though I don't know if that's the problem.
02-23-2007, 05:36 AM#4
Zycat
Nah. DisplayDebugPlain() works fine in my other triggers. Also GetPlayableMapRect() is basically
Collapse JASS:
//===========================================================================
// Query the playable map area, as defined at map init.
//
function GetPlayableMapRect takes nothing returns rect
    return bj_mapInitialPlayableArea
endfunction

But for whatever reason the trigger works fine now. I have absolutely no idea why.
02-23-2007, 05:38 AM#5
Pyrogasm
Odd. Did you change anything?
02-23-2007, 05:41 AM#6
Zycat
Quote:
Originally Posted by Pyrogasm
Odd. Did you change anything?

Nope, nothing at all. I'm puzzled as to why it works now and not before.