• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Loose control of a unit

Status
Not open for further replies.
Level 7
Joined
Mar 24, 2008
Messages
184
Hi,
getting to the point...how do i make a unit to not be controlled by its owner (but still be able to move and follow triggered orders, so no pause) for a certain amount of time, then back to back to normal control?
 
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