Tinki3
Special Member
- Reaction score
- 418
Code:
TimeFreeze
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Time Freeze
Actions
Set TempGroup = (Units within 275.00 of (Target point of ability being cast) matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is A flying unit) Not equal to True) and (((Matching unit) is Magic Immune) Not
Set FinalGroup = (Random 8 units from TempGroup)
Wait 0.30 game-time seconds
Unit Group - Pick every unit in FinalGroup and do (Actions)
Loop - Actions
Set PickedUnit = (Picked unit)
Set OrigMoveSpeed = (Integer((Current movement speed of PickedUnit)))
Special Effect - Create a special effect attached to the chest of PickedUnit using Abilities\Spells\Human\slow\slowtarget.mdl
Set TimeFreezeAnimation = (Last created special effect)
Animation - Change PickedUnit's animation speed to 0.00% of its original speed
Unit - Set PickedUnit movement speed to 0.00
Unit - Pause PickedUnit
Wait 2.00 game-time seconds
Unit - Unpause PickedUnit
Unit - Set PickedUnit movement speed to (Real(OrigMoveSpeed))
Animation - Change PickedUnit's animation speed to 100.00% of its original speed
Special Effect - Destroy TimeFreezeAnimation
Custom script: call DestroyGroup(udg_TempGroup)
Custom script: call DestroyGroup(udg_FinalGroup)
The above trigger is meant to 'freeze' the picked units for a duration so that they can't move or attack. But im having problems with unpausing the picked units:
Only 1 of the picked units from the FinalGroup is unpaused, and has its movespeed set back to normal (same with its animations, and its SFX are destroyed as well). Why is it that all of the other picked units, apart from the 1, not set back to normal/unfrozen?
Please help me on this one :nuts: