• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Getting Region

Status
Not open for further replies.
Level 20
Joined
Jul 6, 2009
Messages
1,885
I made a trigger which runs when a unit enters any of 10 regions (10 events,for each region). Is there a way to get the region triggering unit entered in? I tried using GetTriggeringRegion() but didn't seem to work.

EDIT: Well,it seems my event is malfunctioning (which belongs to Triggers & Scripts,sorry for wrong section)
The Debug message doesn't run,anyone knows why?
JASS:
function Turn_Filter takes nothing returns boolean
    call BJDebugMsg("Filter Debug")
    return IsUnitInGroup(GetFilterUnit(),udg_Travellers)
endfunction

function InitTrig_Travelling takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer index = 0
    loop
        set index = index + 1
        exitwhen index > 10
        set TurnRegions[index] = CreateRegion()
        call RegionAddRect(TurnRegions[index],TurnRects[index])
        call TriggerRegisterEnterRegion(t,TurnRegions[index],Filter(function Turn_Filter))
    endloop
    set t = null
endfunction

The TurnRegions and TurnRects are globals declared in map custom script:
JASS:
globals
    region array TurnRegions
    rect array TurnRects
endglobals

Rect initialization in init trigger: (They are initialized,i tested it by creating a unit in a region center)
JASS:
    set TurnRects[1] = gg_rct_Turn_1
    set TurnRects[2] = gg_rct_Turn_2
    set TurnRects[3] = gg_rct_Turn_3
    set TurnRects[4] = gg_rct_Turn_4
    set TurnRects[5] = gg_rct_Turn_5
    set TurnRects[6] = gg_rct_Turn_6
    set TurnRects[7] = gg_rct_Turn_7
    set TurnRects[8] = gg_rct_Turn_8
    set TurnRects[9] = gg_rct_Turn_9
    set TurnRects[10] = gg_rct_Turn_10
 
Last edited:
Status
Not open for further replies.
Top