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

Loose control of a unit

Status
Not open for further replies.
Level 12
Joined
Apr 27, 2008
Messages
1,228
"unit-change ownership"

That may leak(according to the situation).

Other options are make unit unselectable.
OR
Make the owner of the unit to unselect the unit, then when the unit is selected by the owner unselect it again.(allies of owner with shared control should be considered)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Not lag, leak.
Example:
Having used all the player slots for something. And/OR having move paths(AI) for all the NPCs.
This depends on the map, type of the map, place of map etc
 
Level 7
Joined
Mar 24, 2008
Messages
184
i'm pretty sure paused units don't follow orders from trigger (my first attempt at using "Pause all units" in a cinematic, was pretty fun :p) and well, at the moment i'm using change ownership to neutral...i was hoping there was another way that didn't require ownership change
The problem with changing them to neutral is that my units won't auto-attack them (it's a minor problem actually, but still something not wanted)
I tried Neutral-Hostile or Neutral Victim but then the units of their old owner will attack them
Also i may need all the player slots for my map :cry:
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Then i strongly suggest you Make the owner of the unit to unselect the unit, then when the unit is selected by the owner unselect it again.(allies of owner with shared control should be considered).
Like changing owner you will not be able to control the unit, but it's owner will still be the same.
Done with 2 triggers.
first one that basically does what you want(I assume you have some at this point) just add some custom buff to the unit and make the owner unselect it.
And all the other stuff you want.

Then make a trigger with the event unit is selected(maybe Player 1 selects a unit)
Condition Selected unit has some buff
Selection remove the unit from selection/
I haven't checked the exact function names for the "unselection" so they may not be accurate.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
No...
Should have said that earlier :D
Anyway, I have no experience with 'AI's yet, so I can't help a lot.
Clarify what AI you have. Maybe make the AI check if unit has some buff, some custom value.
 
Status
Not open for further replies.
Top