• 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.

[Solved] i have a return problem

Status
Not open for further replies.
sry shouldve posted that here is the function that the reg is created in and that the condition is added in.

JASS:
        private static method setRects takes nothing returns nothing
            local trigger t1 = CreateTrigger()
            local integer L = 0
            loop
                exitwhen L > 12
                set reg[L] = CreateRegion()  
                set L = L + 1
            endloop
            set L = 0
            call RegionAddRect( reg[0], gg_rct_urRectName)
            call RegionAddRect( reg[1], gg_rct_urRectName1)
            call RegionAddRect( reg[2], gg_rct_urRectName2)
            loop
                exitwhen L > 11
                call TriggerRegisterEnterRegion( t1, reg[L], function thistype.enterReg)
                set L = L + 1
            endloop
            call TriggerRegisterEnterRegion( t1, reg[12], null)
            call TriggerAddCondition( t1, function thistype.inRect)
            set t1 = null
        endmethod

this also returns false which i didnt think was possible lol
JASS:
IsUnitInRegion( GetTriggeringRegion(), GetTriggerUnit())
 
Level 4
Joined
Nov 27, 2012
Messages
85
i have a unit enters region event and it should fire when player 0 enters this rect. problem is it doesnt return true can anyone tell me y. here is the code
JASS:
return reg[GetPlayerId( GetOwningPlayer( GetTriggerUnit()))] == GetTriggeringRegion()

Is this condition even neccessary? I dunno you're probably gonna have to post up the rest of the trigger but this

JASS:
[GetPlayerId( GetOwningPlayer( GetTriggerUnit()))]

should be like this by default. If the above was your purpose, then yea, moar info

JASS:
[GetPlayerId( GetOwningPlayer( GetTriggerUnit()))+1]
 
ooo i see u used the handleIds i just used the region one ill give it a try

i think i did something wrong can u find the problem ?
heres were i save it
JASS:
set regionTable[GetHandleId(reg[L])] = GetHandleId(reg[L])

heres the loading
JASS:
local integer p = GetPlayerId( GetOwningPlayer( GetTriggerUnit()))
return regionTable[GetHandleId(reg)] == GetHandleId( GetTriggeringRegion())

this returns 0 ?????
JASS:
call BJDebugMsg( I2S( GetHandleId( GetTriggeringRegion())))

heres the map so u can see what i mean
 
Last edited:
maker helped me get it to work. thx anyways zwiebelchen
this solved it
When you register the event, leave the boolexpr to null. Use the enterReg when you register the condition.
Yeah and this is because of the thing I wrote.
You can not register a preplaced rect to the event because it isn't created at the moment you register the event.
Instead of registering the event at library init, register it after a 0 second timer and it should be fine.
 
Status
Not open for further replies.
Top