This is for my own referance as well as for the benefit of the community. I'm not sure if these functions are new in 1.5 or if theyre preexisting, but either way, they work. Here's how to
Play an actor's death animation without the unit dying
Typically for feign death type spells, you want to play the actor's death animation. However, normally you cant as its a separate model. We're going to be building some actor events that lets us play the animation. I'm going to assume you know the basics of creating a spell. Lets get started with the actors.
Create a new actor event: type: Macro
Name it something like "Feign Death"
Under actor events, add a new event
Effect.YourEffectName.Start
- PrepareDeathSequence (Note: In this dropdown list, this is named "Prepare").
This sets up our death animation. Select the death type you want, and select "NoKill". This keeps our actor from dying. We'll want to control this manually.
Add a new event
"Prepare"DeathSequence
- "Execute"DeathSequence (This forces the model to switch, and the death animation to play as listed in the unit actor's death events.)
"Execute"DeathSequence
Destroy
Thats it for the macro. Now go to your unit.
Find your unit actor.
Add a new event
"Execute"DeathSequence
Create YourUnit'sActorHere
Note, youll have to switch the list from "custom" to "actor" here and specifically define which actor you want to create This is because we destroy our actor in the death event macro. We destroy the actor because otherwise the hitbox will disappear and you'll be unable to click your unit afterward.
Find "Event Macros" in the unit's list, and add your feign death macro and your done. Now whenever your unit executes the effect, it'll play its death animation then switch back when done.
Prevent Kill is pretty self explanitory. It prevents the actor from dying. Normally the death execution will kill the unit and the actor. With that flag checked, the unit will live. Unfortunately, the hitbox (which makes it "clickable") gets disassociated in the process. Hence the reason we destroy the actor at the end of the execution, and tell the primary unit actor to recreate it.
This is for my own referance as well as for the benefit of the community. I'm not sure if these functions are new in 1.5 or if theyre preexisting, but either way, they work. Here's how to
Play an actor's death animation without the unit dying
Typically for feign death type spells, you want to play the actor's death animation. However, normally you cant as its a separate model. We're going to be building some actor events that lets us play the animation. I'm going to assume you know the basics of creating a spell. Lets get started with the actors.
Create a new actor event: type: Macro
Name it something like "Feign Death"
Under actor events, add a new event
Effect.YourEffectName.Start - PrepareDeathSequence (Note: In this dropdown list, this is named "Prepare").
This sets up our death animation. Select the death type you want, and select "NoKill". This keeps our actor from dying. We'll want to control this manually.
Add a new event
"Prepare"DeathSequence - "Execute"DeathSequence (This forces the model to switch, and the death animation to play as listed in the unit actor's death events.)
"Execute"DeathSequence Destroy
Thats it for the macro. Now go to your unit.
Find your unit actor. Add a new event
"Execute"DeathSequence Create YourUnit'sActorHere
Note, youll have to switch the list from "custom" to "actor" here and specifically define which actor you want to create This is because we destroy our actor in the death event macro. We destroy the actor because otherwise the hitbox will disappear and you'll be unable to click your unit afterward.
Find "Event Macros" in the unit's list, and add your feign death macro and your done. Now whenever your unit executes the effect, it'll play its death animation then switch back when done.
What does the Prevent Kill flag do under the Prepare event action?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
Prevent Kill is pretty self explanitory. It prevents the actor from dying. Normally the death execution will kill the unit and the actor. With that flag checked, the unit will live. Unfortunately, the hitbox (which makes it "clickable") gets disassociated in the process. Hence the reason we destroy the actor at the end of the execution, and tell the primary unit actor to recreate it.
That only happens if it has the AnimBracketState.*.AfterClosing event leading to actor destruction.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg