Unit Click Event counts clicking and "unclicking"?

KyleKatarn

Cool Member
Reaction score
1
The Event that detects when a unit is clicked counts clicking down on the mouse button and letting go of the mouse button both as clicks. So a complete click makes all the triggers using this event basically run twice.

Any ideas about how circumvent this stupid design so that the trigger only runs after one type of click or a complete click like you'd think it would?
 

ZugZugZealot

New Member
Reaction score
33
Well assuming that it's a bug that can't be easily fixed, the work around is pretty simple.

Make a global array variable with the size of 15 for each trigger that uses it. In each trigger put in...

If (Triggering Unit == <unitArray>[Triggering Player]) Then
--Set <unitArray>[Triggering Player] = <No Unit>
--Skip Remaining Actions
Else
--Set <unitArray[Triggering Player] = Triggering Unit
 

KyleKatarn

Cool Member
Reaction score
1
Hey you were right, it works normally in a new map. I had to have the unit unselectable, and that's what causes the bug. Interesting, since if anyone wanted to detect unclicking on purpose they'd never know starcraft was capable of it.

I'll be able to figure out some workaround now that I know the cause.
 

SerraAvenger

Cuz I can
Reaction score
234
Hey you were right, it works normally in a new map. I had to have the unit unselectable, and that's what causes the bug. Interesting, since if anyone wanted to detect unclicking on purpose they'd never know starcraft was capable of it.

I'll be able to figure out some workaround now that I know the cause.

If you do so, make clever use of mutexes.

If (Triggering Unit == <unitArray>[Triggering Player]) Then
--Set <unitArray>[Triggering Player] = <No Unit>
--Skip Remaining Actions
Else
--Set <unitArray[Triggering Player] = Triggering Unit

may well bug.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top