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!
function func_2 takes nothing returns rect
return Rect(0, 0, 100, 100)
endfunction
function func_1 takes nothing returns rect
local rect r = func_2()
endfunction
globals
rect NightbladeRect = Rect(0, 0, 100, 100)
endglobals
function AnyRandomFunction takes nothing returns nothing
local region r = CreateRegion()
call RegionAddRect(r, NightbladeRect)
if IsUnitInRegion(r, GetTriggerUnit()) then // this is just random there is no triggering unit
call RemoveRegion(r)
call Player(16)
endif
call RemoveRegion(r)
set r = null
endfunction
The point is that if you save your rect as a global, you can reference it anywhere. If you've got it as a function, then you're probably going to want to do this rather than creating rect objects over and over again.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.