• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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.)
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
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