I was scouting around API Browser and faund a function
native 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:
CheckPoint 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:
Does anyone have something about this problem?
Ty
native 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:
Code:
loop
exitwhen(IsLocationInRegion (CheckPoint,GoToPoint))
set GoToPoint = GetRandomLocInRect(CenteredRect)
endloop
CheckPoint 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:
Code:
local region = CreateRegion()
local rect Map = GetPlayableMapRect()
call RegionAddRect(CheckPoint,Map)
loop
exitwhen(IsLocationInRegion (CheckPoint,GoToPoint))
set GoToPoint = GetRandomLocInRect(CenteredRect)
endloop
Does anyone have something about this problem?
Ty