Most models intended to be used as something you can target and destroy have a death animation. But not all such units have a death animation that goes away after awhile. For some of them, the "dead" unit will just sit there on your map, never fading like normal units do.
I'm trying to figure out a way to change this, so that any unit can be made to vanish a short time after the unit has died. But I'm not sure what the best method to go about it is. My initial thought was a timer that starts when the unit dies, expires a minute later, and on its expiration, the Actor is set to Destroy. But it didn't work; the unit still just sits there.
Any alternative solutions? Has anyone out there tried this kind of thing before? Or am I just out of luck?
Could you provide an example of such a model staying on the map? I never had this problem.
In fact, most unit models do not have a death animation, they just disappear and get replaced by a new actor with the death model by the main unit actor.
Sorry, I mis-typed. It's the death model I'm talking about. With stuff like trees, for example, the death model has no built-in end-point. It goes through a transitional animation when the unit/doodad dies, but then remains there in a dead state indefinitely.
The main unit actor has no influence on the death actor besides creating it. If you want to modify the death actor, I suggest, you use a custom Death Actor Model instead of the default UnitDeathModel and configure it to your specifications.
Huh. I didn't realize there was another actor for dying units; always just figured it was changing the model of the existing one.
And that's a jackpot! Gave the death actor a pair of timers, one that starts an opacity fade-out after 30 seconds and one that removes the actor entirely when the fade-out is finished. Works like a charm.
Thanks, guys!
Edit: Okay, running into a new problem. The tree unit I'm working on is shifting to a different model variant when it dies.
Perfect, I can't wait to give this a try! I've been having the exact same problem :)
@JimStarluck How exactly did you accomplish this? Are special events needed in the Unit actor? What type of Actor - Model did you make and what events/settings went in to it to tie it to the unit?
Most models intended to be used as something you can target and destroy have a death animation. But not all such units have a death animation that goes away after awhile. For some of them, the "dead" unit will just sit there on your map, never fading like normal units do.
I'm trying to figure out a way to change this, so that any unit can be made to vanish a short time after the unit has died. But I'm not sure what the best method to go about it is. My initial thought was a timer that starts when the unit dies, expires a minute later, and on its expiration, the Actor is set to Destroy. But it didn't work; the unit still just sits there.
Any alternative solutions? Has anyone out there tried this kind of thing before? Or am I just out of luck?
Could you provide an example of such a model staying on the map? I never had this problem.
In fact, most unit models do not have a death animation, they just disappear and get replaced by a new actor with the death model by the main unit actor.
@Kueken531: Go
Sorry, I mis-typed. It's the death model I'm talking about. With stuff like trees, for example, the death model has no built-in end-point. It goes through a transitional animation when the unit/doodad dies, but then remains there in a dead state indefinitely.
Use the Set Opacity action to make it fade away before destroying the model?
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
Tried that, but it doesn't seem to do anything either.
What triggering event should I use in the Actor's Events to detect when the unit dies? Unit Death? Unit Death Custom? Something completely different?
The main unit actor has no influence on the death actor besides creating it. If you want to modify the death actor, I suggest, you use a custom Death Actor Model instead of the default UnitDeathModel and configure it to your specifications.
@Kueken531: Go
Huh. I didn't realize there was another actor for dying units; always just figured it was changing the model of the existing one.
And that's a jackpot! Gave the death actor a pair of timers, one that starts an opacity fade-out after 30 seconds and one that removes the actor entirely when the fade-out is finished. Works like a charm.
Thanks, guys!
Edit: Okay, running into a new problem. The tree unit I'm working on is shifting to a different model variant when it dies.
There is a model variant term and you can always make a model for each variant if you want.
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
Perfect, I can't wait to give this a try! I've been having the exact same problem :)
@JimStarluck How exactly did you accomplish this? Are special events needed in the Unit actor? What type of Actor - Model did you make and what events/settings went in to it to tie it to the unit?
Thanks for any help you can give!