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

Disable right click (smart move order)

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Alright, so I've gone through all of the obvious solutions but none do exactly what I want.

I want to make units ignore right clicks (smart orders) issued by the player. And I mean IGNORE them, not replace the issued order.

So:
1) The unit needs to be player owned so that you can view it's command card and level up Hero Skills.
2) It's orders can't be replaced.

I've removed all of the command card buttons (Stop, Move, Patrol, Hold Position) which prevents the player from using them but all that's left is the smart order issued when you right click.

Edit: The units will be ordered to move via triggers, so I can't remove movement from them.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
Simply remove the "Move" Ability, (it will also remove it's icon and the ability to be ordered to move or to smart move) :

JASS:
call UnitRemoveAbility(YourUnit, 'Amov')
 
Simply remove the "Move" Ability, (it will also remove it's icon and the ability to be ordered to move or to smart move) :

JASS:
call UnitRemoveAbility(YourUnit, 'Amov')
You can as far as I know not add the move ability back after having removed it, so this might be undesirable.
 
Level 12
Joined
Jan 30, 2020
Messages
875
You can as far as I know not add the move ability back after having removed it, so this might be undesirable.

Yes you are entirely right. This said OP did only write he wanted to prevent the user from being able to use the smart command.
Now as he only removed the buttons for the other commands, yes maybe he wants to still be able to issue the order via triggers and then my method would become really inappropriate.

But if he does not need to issue the smart order, that would work nicely.

It all depends on what he intends to do. As for removing the ability to issue the smart order only for the player, I don't know a way that would work.
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Sorry, I didn't see the notifications on this post until now. Anyway, yeah, it's a Castle Fight-like map and the units are ordered to attack from one end point of the map to the other. The solution i'm looking for doesn't appear to exist but that's alright.
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
If the unit is issued any order it will cause it's AI to re-target + cause it to stutter for a very short moment. This gives players an unwanted level of control.

So if the unit is issued an order it's not a viable solution. I was looking for something that would happen BEFORE orders are issued that would allow me to skip the order process entirely.

I'm no longer worried about it though, as the computer controlled units option works.

Thank you everyone for the suggestions.
 
Last edited:
Status
Not open for further replies.
Top