Hey guys. Back again with another silly question. Trying to set up a trigger so that when I damage a baneling with my hero, it slows the baneling down considerably. I also wanted to make it so that when the baneling is chasing me, it uses the roll animation, but when it gets hit it goes into its regular animation. Where the problem is presenting itself is that when I attack the baneling continuously, I want it stay slowed.. instead what happens is it will stay slowed for the set duration and then go back into (and remain in) its rolling form no matter if I attack again.
Here is the very simple trigger I made:
Event: Baneling takes damage
Action: Tech Tree - Set Baneling - Centrifugal Hooks upgrade level to 0 for Player 2
General - Wait 2.0 Game Time seconds
Action: Tech Tree - Set Baneling - Centrifugal Hooks upgrade level to 1 for Player 2
Note I set the upgrade level to 1 in the map init. I know this is probably a really sloppy way to do this, and that I should instead use the set movement speed action so that it only affects the triggering unit, but I really want the animations to change based on the trigger state. I am sure one of you can point me in the right direction! :D
What's happening is your "wait 2 seconds action" is going off regardless of whether the baneling is hit again or not. Here is one way you can solve this:
1. Create a timer and each time the baneling is hit, restart the timer. Move the logic for giving the baneling upgrade into another trigger that runs when the timer expires. You'll need the timer to be global variable.
Thanks for your response! Does anyone know if there is an action to morph a triggering unit, i.e. rolling baneling to crawling baneling? Or perhaps some sort of work around?
This would be perfect, thanks! I have been stumbling around the data editor for the past couple days trying to get an understanding of it, or at least how it works compared to triggering. I will take a look at this and figure it out hopefully :D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey guys. Back again with another silly question. Trying to set up a trigger so that when I damage a baneling with my hero, it slows the baneling down considerably. I also wanted to make it so that when the baneling is chasing me, it uses the roll animation, but when it gets hit it goes into its regular animation. Where the problem is presenting itself is that when I attack the baneling continuously, I want it stay slowed.. instead what happens is it will stay slowed for the set duration and then go back into (and remain in) its rolling form no matter if I attack again.
Here is the very simple trigger I made:
Note I set the upgrade level to 1 in the map init. I know this is probably a really sloppy way to do this, and that I should instead use the set movement speed action so that it only affects the triggering unit, but I really want the animations to change based on the trigger state. I am sure one of you can point me in the right direction! :D
@voodude2008: Go
Bump for the evening crowd
@voodude2008: Go
What's happening is your "wait 2 seconds action" is going off regardless of whether the baneling is hit again or not. Here is one way you can solve this:
1. Create a timer and each time the baneling is hit, restart the timer. Move the logic for giving the baneling upgrade into another trigger that runs when the timer expires. You'll need the timer to be global variable.
@roguelike: Go
Thanks for your response! Does anyone know if there is an action to morph a triggering unit, i.e. rolling baneling to crawling baneling? Or perhaps some sort of work around?
I'm thinking this would probally be easier in the data editor, if you want it to work pr unit rather then pr unit type..
I made a solution in the data editor you can look at, or disregard if you would rather have it in triggers :)
@SBeier: Go
This would be perfect, thanks! I have been stumbling around the data editor for the past couple days trying to get an understanding of it, or at least how it works compared to triggering. I will take a look at this and figure it out hopefully :D