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

Taking away control from player

Status
Not open for further replies.
Level 4
Joined
Apr 15, 2011
Messages
108
I want player to keep that unit, still own it, still see his abilities and stuff...
Yet, dont be able to decide who that unit will attack etc.
Like castle wars
What should I do ?
 
Level 5
Joined
Nov 7, 2007
Messages
134
Well, preventing the unit from using spells is easy enough, simply cast Silence on it. As for regular orders such as attack/move/etc, it's somewhat trickier. One thing you could try is activating a trigger which spams orders for the unit, like every 0.05 seconds or something like that, so even if the player attempts to give an order to the unit, the trigger will give a new order within 0.05 seconds, so it will seem like the player has no control whatsoever.
 
The best way is to register when the unit is issued any order and then order them to stop. Make sure you turn off the current trigger before ordering them (so it won't register the trigger itself and create an infinite loop) and then turn it back on. It would be something like this (I don't have the editor open so these might not be the exact functions):
  • Lockout
    • Events
      • Unit - A unit is issued an order
      • Unit - A unit is issued an order targeting a point
      • Unit - A unit is issued an order targeting a location
    • Conditions
      • (Triggering Unit) Equal to <Your Unit>
    • Actions
      • Trigger - Turn off Lockout <gen>
      • Unit - Issue (Triggering unit) to Stop
      • Trigger - Turn on Lockout <gen>
Something like that. It should work, and it should also prevent cooldowns/mana from being spent.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm not sure, but there's an action in Player - Reserver buttons or something like that. I'm not sure if it works only for heroes.
 
Status
Not open for further replies.
Top