Hey there, with out revealing too much, i'm working on a nice tower defence map in which one of the towers has a knockback abilitiy.
The knockback ability works like:
My problem is this:
Because of how the knock-back effect works, the Unit forgets his last order (move to a region in the map), and attacks the tower once he's been knocked back. Now, thats not what is supposed to happen - after the knockback effect has happened, all i want is to give him his last order.
But I've no idea how the 'order' variable works, I havn't managed to find a way to issue a unit a variable as an order. So i cant just be like 'give him the order he had 1 second ago'.
Any help? Much appreciated!
The knockback ability works like:
-
Knockback
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
(Unit-type of (Attacking unit)) Equal to Yur'teh Devourer
-
-
Actions
-
Set x = 0
-
Set Target = (Attacked unit)
-
Set Caster = (Attacking unit)
-
Trigger - Turn on KnockbackMove <gen>
-
-
-
KnockbackMove
-
Events
-
Time - Every 0.02 seconds of game time
-
-
Conditions
-
Actions
-
Set TempLock00 = (Position of Caster)
-
Set TempLock01 = (Position of Target)
-
Set TempLock02 = (TempLock01 offset by 5.00 towards ((Facing of Target) - 180.00) degrees)
-
Unit - Turn collision for Target Off
-
Unit - Move Target instantly to TempLock02
-
Custom script: call RemoveLocation(udg_TempLock00)
-
Custom script: call RemoveLocation(udg_TempLock01)
-
Custom script: call RemoveLocation(udg_TempLock02)
-
Set x = (x + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
x Greater than 50
-
-
Then - Actions
-
Unit - Turn collision for Target On
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
My problem is this:
Because of how the knock-back effect works, the Unit forgets his last order (move to a region in the map), and attacks the tower once he's been knocked back. Now, thats not what is supposed to happen - after the knockback effect has happened, all i want is to give him his last order.
But I've no idea how the 'order' variable works, I havn't managed to find a way to issue a unit a variable as an order. So i cant just be like 'give him the order he had 1 second ago'.
Any help? Much appreciated!