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

Right Click Detect

Status
Not open for further replies.
Level 7
Joined
Jul 20, 2009
Messages
295
Hello,

I'm trying to make an ability similar to that of attack but it seems I keep failing.
I want the game to detect when a player right clicks on a unit (to attack it) and then make a selected unit to cast 'attack' on the target.

Edit: Nevermind! I found the solution for this though I got another problem which is, when I do the following:
  • Trigger - Add to Melee DMG Detect <gen> the event (Unit - (Triggering unit) Takes damage)
It triggers whenever I melee hit AND cast spells.
The problem is I only want it to trigger when a melee damage is taken and not damage from spells (even though some don't do dmg e.g. 0 dmg), how could I do that?

Thanks!
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Since you're taking my advice anyway(I suggested this in a thread recently), then just detect the order.

The order for right-clicking is called "smart".
With a few ITEs you can find out if:
1. The target is a unit?(triggering unit not equal to no unit/null)
2. The target is an enemy(boolean, unit is enemy of player)
 
Status
Not open for further replies.
Top