• 🏆 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!

Selecting and instantly deselecting a unit

Status
Not open for further replies.
Level 13
Joined
Nov 22, 2006
Messages
1,260
What I want to do is to be able to select an invisible unit, detect the selection, then instantly deselect the unit, without a selection circle, portrait etc.

Basically, a left-click detection with no side effects. Is that possible?
 
Level 3
Joined
Apr 8, 2006
Messages
41
Make a trigger like the following:
Events
----Player - Player 1 (Red) Selects a unit
Conditions
----(Unit-Type of (Triggering Unit)) Equal to InvisibleUnit
Actions
----Selection - Remove (Triggering Unit) from selection

This will have a very short lag time (maybe 0.25-0.5 secs? maybe less). I don't think there is any way to do it instantly unless you're okay with making it unselectable (locust is the only way I know which also makes it invulnerable).
Hope that helps =P
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
I used that to detect maphacks at my map which was never finished.... :p

however it is kind of easy

this is for detecting maphack
modify as you want to

  • MhTest
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set PlayerSelection[(Player number of (Picked player))] = (Units currently selected by (Picked player))
          • Selection - Clear selection for (Picked player)
          • Selection - Select MhTestUnit for (Picked player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MhTestUnit is selected by (Picked player)) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: ((Name of (Picked player)) + might be a maphacker.)
            • Else - Actions
          • Selection - Select PlayerSelection[(Player number of (Picked player))] for (Picked player)
(leaks and might not work as I want to because I recoded it cause I couldn't find the old one - I know this is not exactly what you wanted but it should be enough to help you)

note: if a player has a spell selection running it will be canceld

edit: second x)
 
Status
Not open for further replies.
Top