• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Group of items?

Status
Not open for further replies.
Level 2
Joined
Apr 25, 2008
Messages
17
I want to list all the items in range of a unit such as gold coins. dropped items etc. But i cant figure out how that would work. Theres a GetEnumItem(). Im not sure if i can use that with a group tho, as a group is for units? Theres EnumItemsInRect but then i have to create a rect at the point of the unit everytime this is called .. which is about once a second.

Has anyone got an idea of how i can implement this?
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
i think the best way is to use a rect, you don't need to create/destroy always, you can move it.
and then use the function EnumItemsInRect and check the distance beetween the enum item and the center of your circle (xC,yC), ofc it's the unit position

the rect :

xMin = xC - range
yMin = yC - range
xMax = yC + range
yMax = yC + range
 
Status
Not open for further replies.
Top