I am attempting to make a trigger that functions very much like the incapacitated feature in the Terran campaign. I have everything working perfectly except for the death animation, it gets pretty weird or stops all animations on the actor all together. Could someone point me in the right direction or fix my trigger to make it work smoothly. I pretty much want the unit to play the death animation for the entire duration while the behavior is active. This is what I have so far. I have tried multiple variations of the animation - set animation duration/time etc and have not had any luck making it stick.
Unit - Any Unit has (Fallen Hero) Change Create - This is my rendition of the incapacitated behavior
Unit - Set unit (Trigger unit) model to Specter Death
Animation - Play Death Animation for (Actor for (Trigger unit)
General - Wait 2.0 game time seconds
Animation - set the default animation duration for (Actor for (triggering unit) to 30 seconds
General - wait for conditions, checking every 1 game time seconds -> conditions (Triggering unit) has Fallen Hero) == False
Unit - Set unit (Triggering unit) model to spectre
After many hours, I finally found a workaround for my problem. Its a combination of Data and Triggers. This is how I did it, doesn't mean it will work for every instance, but works perfectly for my map; because I have multiple abilities that can revive fallen heroes.
The triggers I used goes like this:
Event - Unit has Incapacitated Behavior change create
Action - Set Life = 1
Hide triggering unit
Create 1 fallen hero (Body) for player owner of triggering unit at position triggering unit (This is a place holder unit that is the death animation for the unit type)
Set (Last Created Unit) model to Specter Death "In this case the actor is a spectre"
Play Death animation for (actor for (Last created unit)) as default
Wait 2 seconds
Add behavior Freeze animation (this is a behavior that changes the global time scale to .001
Wait for conditions -> triggering unit has incapacitated = false
if/then/else
if (last created unit) has behavior (remove body) = true
then remove last created unit
else change ownership to 0 "neutral"
finally show triggering unit and create a secondary trigger that will move the hero to the respawn location
My data editing removes the incapacitated behavior and adds a dumby behavior to the body which i dubbed as remove body. So any ability that revives a heroes is simply remove the incapacitated behavior, then add remove body behavior to the body and the triggers will take care of the rest. If anyone has any questions or comments let me know.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am attempting to make a trigger that functions very much like the incapacitated feature in the Terran campaign. I have everything working perfectly except for the death animation, it gets pretty weird or stops all animations on the actor all together. Could someone point me in the right direction or fix my trigger to make it work smoothly. I pretty much want the unit to play the death animation for the entire duration while the behavior is active. This is what I have so far. I have tried multiple variations of the animation - set animation duration/time etc and have not had any luck making it stick.
Unit - Any Unit has (Fallen Hero) Change Create - This is my rendition of the incapacitated behavior Unit - Set unit (Trigger unit) model to Specter Death Animation - Play Death Animation for (Actor for (Trigger unit) General - Wait 2.0 game time seconds Animation - set the default animation duration for (Actor for (triggering unit) to 30 seconds General - wait for conditions, checking every 1 game time seconds -> conditions (Triggering unit) has Fallen Hero) == False Unit - Set unit (Triggering unit) model to spectre
After many hours, I finally found a workaround for my problem. Its a combination of Data and Triggers. This is how I did it, doesn't mean it will work for every instance, but works perfectly for my map; because I have multiple abilities that can revive fallen heroes.
The triggers I used goes like this:
Event - Unit has Incapacitated Behavior change create Action - Set Life = 1 Hide triggering unit Create 1 fallen hero (Body) for player owner of triggering unit at position triggering unit (This is a place holder unit that is the death animation for the unit type) Set (Last Created Unit) model to Specter Death "In this case the actor is a spectre" Play Death animation for (actor for (Last created unit)) as default Wait 2 seconds Add behavior Freeze animation (this is a behavior that changes the global time scale to .001 Wait for conditions -> triggering unit has incapacitated = false if/then/else if (last created unit) has behavior (remove body) = true then remove last created unit else change ownership to 0 "neutral" finally show triggering unit and create a secondary trigger that will move the hero to the respawn location
My data editing removes the incapacitated behavior and adds a dumby behavior to the body which i dubbed as remove body. So any ability that revives a heroes is simply remove the incapacitated behavior, then add remove body behavior to the body and the triggers will take care of the rest. If anyone has any questions or comments let me know.