• 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.

[vJASS] Unit from Unit group is selected (event)

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
I'm working on something for my map, but I can't seem to figure this out in a good way.

There's a certain rect in the map where once in a while units enter and leave.
Whenever a player (has to be MPI) selects a unit he owns in the rect, something will have to happen.
I don't know how to get started on this because the events I know of ask for specific units.

Could someone help me to get started with this? Or point me in the right direction?
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
Well, you could keep track of units that are in that given rect. A static group and two events (1 for enter 1 for leave), and a third one for unit selection will do the trick.

However, using this approach, you can have a static timer with 32 timouts/sec, that sets a boolean based on whether the unit is selected by its owner or not, and fires the appropriate events when it changes.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
I got it to work now.
A (small) delay isn't even a big issue.
I used the player X (de)selects a unit event.
 
Status
Not open for further replies.
Top