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

Forbid Unit Control

Status
Not open for further replies.
Level 3
Joined
May 10, 2014
Messages
41
Hello!

Is it possible to forbid control of unit to enemy player?

I plan to make a spell, that gives order 'move to position of caster' to target unit of ability, while owner of unit (enemy player) can't give any other order to that unit.

Is it possiple to realize this using GUI and Custom Script?

Thanks for any information! :as:
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
You can store the command u want the unit to do (last command) and every time the player orders a new command you just spam your stored command over it. If you change the unit classification to ward, the only orders it can order is move (object) attack (object) - I believe. So a combination of the two would probably do the trick (you can still spam commands, and it will stop for a short moment sadly.)
 
If you want to achieve a "fear" effect, then:

At first, mark that unit (which you want to be affected via "fear"), either by adding to structs linked list (new instance of such struct) or to group handle.

Each time any order is performed (register ISSUED_ORDER, ISSUED_POINT_ORDER and ISSUED_TARGET_ORDER to trigger) start a timer with low delay to re-perform "your" order. Of course, to prevent infinite loop, you have to disable/enable trigger which reacts to that event.

Mentioned timer should be attached to instance of such struct or unit from unit group - before you start it, check the time remaining, so you don't actually spam move-order on given unit.

It's much more complicated way, yet if programmed properly, effect is better than temporarily switching unit's ownership. However, if you don't want to trouble yourself, go with IcemanBo's suggestion.
 
Status
Not open for further replies.
Top