unit:inArea() method problem

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
DracheTek
Posts: 46
Joined: Sun Jul 05, 2020 11:55 am

unit:inArea() method problem

Post by DracheTek »

The unit pointed by red arrow in the picture is apparently sitting in the area specified in the code, but the code returns false. Please tell me if I am missing something important.

Thanks.
DracheTek
Posts: 46
Joined: Sun Jul 05, 2020 11:55 am

RE: unit:inArea() method problem

Post by DracheTek »

try picture in zipped format. for some good reason i don't have access to most of useful picture embed site. sorry.
Attachments
Pic1.zip
(916.67 KiB) Downloaded 10 times
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: unit:inArea() method problem

Post by KnightHawk75 »

It's expecting table with list of rp names, not table of rp details.

local target = SE_GetUnit({guid="IHX5IQ-0HM11KKET26EB"})
local retval = target:inArea({ 'RP-1509', 'RP-1510', 'RP-1511', 'RP-1512'})
print(retval) --should return yes\true
DracheTek
Posts: 46
Joined: Sun Jul 05, 2020 11:55 am

RE: unit:inArea() method problem

Post by DracheTek »

Tested and worked. Thank you very much.
Post Reply

Return to “Lua Legion”