Hi,
I use this for Add region and checking unit enters a region. But not sure about it and how's about adding many rects, like RegionAddRect(r,r1), then (r,r2), (r,r3), Or even reuse set new r1 and add to region r instead of creating few more local rects.
I also use this for TimerDialog. I can't get my map work so I still dout about its working. Please advise me on them and advise of some simple scripts for these issues. The script below is cited from a scope in my map
And this one is to checking the Timer T if it expires as TimerExpire in GUI, I assumed it would work. tr is the trigger creates the TimerDialog.
call TriggerRegisterTimerExpireEvent(tr,T)
Thank you
I use this for Add region and checking unit enters a region. But not sure about it and how's about adding many rects, like RegionAddRect(r,r1), then (r,r2), (r,r3), Or even reuse set new r1 and add to region r instead of creating few more local rects.
JASS:
function X2 takes nothing returns nothing
local trigger t=CreateTrigger()
local region r=CreateRegion()
local rect r1=Rect(-3350,-1180,-3300,-250)
call RegionAddRect(r,r1)
call TriggerRegisterEnterRegion(t,r,null)
call TriggerAddCondition(t,Condition(function X2Con))
call RemoveRegion(r)
set r=null
set r1=null
set t=null
endfunction
JASS:
globals
private constant string TIMERSTRING="|c00ffff80Challenge Time"
private timer T = CreateTimer()
private timerdialog T_WINDOW
private real INTERVAL = 50.
private trigger tr
endglobals
JASS:
set T_WINDOW=CreateTimerDialog(T)
call TimerDialogSetTitle(T_WINDOW,TIMERSTRING)
call TimerDialogDisplay(T_WINDOW,true)
call TimerStart(T,INTERVAL,false,null)
call TriggerRegisterTimerExpireEvent(tr,T)
Thank you