• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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