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

How to remove control of a unit but keep it's player affiliation?

Status
Not open for further replies.
Level 14
Joined
Jul 26, 2008
Messages
1,009
I've seen it done in Castle Fight and WC3 the Card Game. How do you have a unit that is considered the players own unit, but block off any buttons used by it so that the unit is A.I. controlled and cannot be interferred with by the player itself?

I want to do this for a game of mine where the player tames a monster but they use buttons in a spell book to control it. However it can not be red who tames it and it's under another colors control. It has to still be considered reds unit. But selecting the unit and right clicking will not make it move or attack where you right clicked. It'll be as if it's under a computer's control.

Also, if the unit I want control to be removed from is a hero, will this cause a problem?

Thanks for any help. I know this can be done, but I have absolutely no clue on how people do it. Pointing me to tutorials or systems others have created to do this would be a great help as well :)
 
Last edited:
Level 14
Joined
Jul 26, 2008
Messages
1,009
I'm afraid neither of these solutions help me. I should probably clarify my first post to remedy this.

If you've ever played Castle Fight or WC3 The Card Game, players send out units via a controlled hero or structure. These units will proceed from one end of the map to the other and battle any opposing forces in the way until they get to their destination. If you click these units, you will see no move/attack/stop or any other buttons that would allow you to tell it what to do. It will also not command to your right clicking.

The selection circle is not yellow, it's green, and the unit is considered your own by the game. Hovering your mouse over the unit and your enemies will confirm this.

I would like to duplicate this, but instead of having the unit run from one end of the map to the other, I want it to follow the player around and respond to his spell activated commands.
 
Level 12
Joined
Mar 23, 2008
Messages
942
Ah, there it is! Thank you. The Ward part is extremelly simple, it's the LastOrder part that is more complex.

Still this exactly what I was looking for ^^

Oh, its a little tricky, the integer whichOrder he asks is the number of the last order, like 1 is the Last One, 2 is the second last one, and 3 is... your get it.

So if you use 1, it will take the "smart" order since it was the last one, so give 2 to the function.

JASS:
call IssuePastOrder(GetOrderingUnit(), 2)
 
Status
Not open for further replies.
Top