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!
Is there in JASS (coz I dont think it is in GUI) the Eent response - Region being entered? (which would respond to the region in Unit enters a region event)
Not quite. You can get the entered region (which is not the same as a rect, which is what GUI calls a region), but not the entered rect. In this case the two are functionally the same in terms of area contained, but comparing them in a condition or somesuch in GUI would be difficult.
The function in question is: constant native GetTriggeringRegion takes nothing returns region
To give you an idea of the difference between a region and a rect, this is the "Unit Enters Region" GUI event (aka unit enters rect):
JASS:
function TriggerRegisterEnterRectSimple takes trigger trig, rect r returns event
local region rectRegion = CreateRegion()
call RegionAddRect(rectRegion, r)
return TriggerRegisterEnterRegion(trig, rectRegion, null)
endfunction
Definitely not in GUI.
Highly believe not even in JASS.
As a workaround, people usually use 2 regions. One smaller and another slightly bigger. And then run a loop to check if the unit within the said bigger region when the unit enter the smaller region.
A simple example:
Code:
Events
Unit - A unit enters Smaller Region 1
Unit - A unit enters Smaller Region 2
Unit - A unit enters Smaller Region 3
Unit - A unit enters Smaller Region 4
Unit - A unit enters Smaller Region 5
Conditions
Actions
Set Z_Pt_General_1 = (Position of (Triggering unit))
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Bigger Region[(Integer A)] contains Z_Pt_General_1) Equal to True
Then - Actions
- Do something -
Else - Actions
Then again, I believe there could be a system somewhere for this...
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.