#1
Need help on types rect and region and a releated function
I was scouting around API Browser and faund a functionnative IsLocationInRegion()
which takes region, location and returns boolean.
I wonder what is region type stands for?
What is the differnce between rect and region?
I found it when im trying to find a condition.
I have a unit which moves to random location around itself and it has loctus ability which makes it, can move outside from playable map area.
I dont want to use Neutral-Wander ability for some reason
And i was trying to make such a code:
loop
exitwhen(IsLocationInRegion (CheckPoint,GoToPoint))
set GoToPoint = GetRandomLocInRect(CenteredRect)
endloopCheckPoint must be a region type variable
I also found that function releated to region:
RegionAddRect()
which takes region, rect and returns nothing
I have tried to create a region variable and add the playable map area to region and tried the condition above again with this codes but does not worked either:
local region = CreateRegion()
local rect Map = GetPlayableMapRect()
call RegionAddRect(CheckPoint,Map)
loop
exitwhen(IsLocationInRegion (CheckPoint,GoToPoint))
set GoToPoint = GetRandomLocInRect(CenteredRect)
endloopDoes anyone have something about this problem?
Ty