Azlier
Old World Ghost
- Reaction score
- 461
Rectwraps Bonus Plugin #1 operational.
Anyone have any rect-using systems I could make plugins for?
Anyone have any rect-using systems I could make plugins for?
library Test initializer init uses rectwrap
private function Actions takes nothing returns boolean
call BJDebugMsg("unit enter region")
return false
endfunction
private function init takes nothing returns nothing
local rectwrap s_rect = rectwrap.create(32.,64.,32.,64.)
local trigger trig = CreateTrigger()
local unit u = CreateUnit(Player(0),039;hpea039;,0.,0.,0.)
call TriggerAddCondition(trig,Condition(function Actions))
call s_rect.registerEnter(trig)
call TriggerSleepAction(1.)
call BJDebugMsg("move unit")
call SetUnitPosition(u,50.,50.)
call SetUnitPosition(u,0.,0.)
call TriggerSleepAction(1.)
call s_rect.destroy()
set s_rect = rectwrap.create(128.,256.,128.,256.)
call s_rect.registerEnter(trig)
call BJDebugMsg("move unit, the message 039;unit enter region039; shouldn039;t be displayed")
call SetUnitPosition(u,50.,50.)
call BJDebugMsg("move unit")
call SetUnitPosition(u,200.,200.)
endfunction
endlibrary
library Test initializer init uses rectwrap
private function Actions takes nothing returns nothing
call BJDebugMsg("unit enter region")
endfunction
private function init takes nothing returns nothing
local rectwrap s_rect = rectwrap.create(32.,32.,64.,64.)
local trigger trig = CreateTrigger()
local unit u = CreateUnit(Player(0),039;hpea039;,0.,0.,0.)
call TriggerAddAction(trig,function Actions)
call s_rect.registerEnter(trig)
call TriggerSleepAction(1.)
call BJDebugMsg("move unit")
call SetUnitPosition(u,50.,50.)
call SetUnitPosition(u,0.,0.)
call TriggerSleepAction(1.)
call BJDebugMsg(" ")
call s_rect.destroy()
set s_rect = rectwrap.create(128.,128.,256.,256.)
call s_rect.registerEnter(trig)
call BJDebugMsg("move unit, the message 039;unit enter region039; shouldn039;t be displayed")
call SetUnitPosition(u,50.,50.)
call TriggerSleepAction(1.)
call BJDebugMsg(" ")
call BJDebugMsg("move unit")
call SetUnitPosition(u,200.,200.) // the message "unit enter in region" isn't showed
endfunction
endlibrary
Well, it seems that SetUnitPosition makes enter rect events fire again. How odd!
Nothing I can fix, though. Everything else seems to work perfectly.
Maybe you failed, share the code.Huh. But with my tests, it showed that moving a rect actually changed the region.