- Joined
- Oct 9, 2015
- Messages
- 721
-Issues- Animation and Conditions
Hi everyone, so I started a new map and was in need of help, so I found this forum...
My problem:
I'm trying to use this trigger, however when playing animations I would like to check conditions (unit has specifc buff, for example), if such conditions are false unit does normal animation, as it is in the orignal trigger, but if true he does animation [2]
(I'm trying to make unit (a footman) plays the "walk defend" animation when isrunning = true and Defend (for example) is active. and to do "stand defend" animation when standing still and defend is active.
Hi everyone, so I started a new map and was in need of help, so I found this forum...
My problem:
I'm trying to use this trigger, however when playing animations I would like to check conditions (unit has specifc buff, for example), if such conditions are false unit does normal animation, as it is in the orignal trigger, but if true he does animation [2]
(I'm trying to make unit (a footman) plays the "walk defend" animation when isrunning = true and Defend (for example) is active. and to do "stand defend" animation when standing still and defend is active.
-
changinganimation
-
Events
-
Time - Every 0.20 seconds of game time
-
-
Conditions
-
Actions
-
Custom script: local integer i = 1
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(DownTrue[(Integer A)] Equal to True) and (UpTrue[(Integer A)] Equal to False)
-
(DownTrue[(Integer A)] Equal to False) and (UpTrue[(Integer A)] Equal to True)
-
-
-
-
Then - Actions
-
Set IsRunning[(Integer A)] = True
-
Custom script: call SetUnitAnimationByIndex(udg_Unit[GetForLoopIndexA()], 6)
-
Custom script: call SetUnitTimeScale(udg_Unit[GetForLoopIndexA()], udg_AnimationSpeed[GetForLoopIndexA()])
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
IsRunning[(Integer A)] Equal to True
-
-
-
-
Then - Actions
-
Set IsRunning[(Integer A)] = False
-
Set AnimationSpeed[(Integer A)] = 1.00
-
Custom script: call SetUnitTimeScale(udg_Unit[GetForLoopIndexA()], udg_AnimationSpeed[GetForLoopIndexA()])
-
Animation - Play Unit[(Integer A)]'s stand animation
-
-
Else - Actions
-
-
-
-
-
-
-
Last edited: