Warcraft III resources & community, 2003–2006 · archived

Giving controlled unit back

6 posts
#1

Giving controlled unit back

I have a problem I have an ability that takes control of a unit, that works but after the wait time I put in it doesn't change back this is what I used.

Unit - Change ownership of (Target unit of ability being cast) to (Previous owner) and Change color
#2
Read FAQ before anything!

That is because after waits (Target Unit of Ability Being Cast) is discarded from the memory.

~Daelin
#3
Ok, I tried making variables, this is what I did.

Actions
Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
Set Unit = (Target unit of ability being cast)
Set PLAYER = (Owner of Unit)
Wait 1.00 seconds
Unit - Change ownership of Unit to PLAYER and Change color
#4
setting the variable AFTER you change ownership = does nothing. You need to save the player BEFORE you change ownership.

set PLAYER = owner of unit
Change ownership of unit
wait 1.00
change ownership of unit to PLAYER
#5
and do the same with the targeted unit variable. xD


oh yeah 200th post 8)
#6
or if u are lazy, just use "triggering unit" function. you don't need to save the variable for that.