I'd like to setup my map so that corpses of specific units take awhile to decay. This is probably done easily with events and timers, and I've been experimenting with them with little to no luck. I was wondering if someone could post a viable solution. Thank you.
To keep the units themselves on the map, you need to set the Death Time of the unit to a value > 0. This should be enough for any revive spell or whatever you need the corpses for to work properly.
This will however have no influence on the unit's actor, so visually, there is still no corpse. And since most units do not have a corpse animation, you could only somehow simulate it (maybe by freezing the animation, setting its time scale to 0? Dunno exactly)
Yeah I thought of this, but I am a lot more concerned with the physical look of corpses, and not the existence of theoretical dead units. Thanks for the thought though.
i know that with models set to high, there are actual corpses for certain units, but i don't know how long they stay and if there's a way to affect that (try playing around with death time and/or actors to see whether it works)
And since those models actually exist, there's one very tedious way to do it. Create an actor for each unit you want to have a corpse, then set its model to the death model of the unit, an actor event "Unit.(unit).dies -> Create" and then make use of a timer to make the model disappear after X seconds (sorry, never used actor timers before)
Behaviour -> Make unit invul/untargetable/unselectable/uncommandable
Events+ in unit actor -> Behaviour <Your Behaviour> On -> Start Animation Bracket -> Opening: Death
There. When your unit dies, it'll play it's death animation and just stay on the floor forever. Some units lack a proper death anim (most vehicles), so this isn't going to be perfect. It'll also still cost supply so if this is an issue for your map then change their owner via triggers.
Yeah, I saw that post before I posted. I want my units not to be frozen before death though, I want their corpses to not decay, but your method seems to freeze them at creation.
Almost all the units in the game when they die use an actor called UnitDeathModel. So if you find UnitDeathModel in the data editor and add the following events it effects all the units that create It when they die which is like 95% of all units so far I have noticed only a few campaign that have specific death actors but their pretty easy to track down and you can just add the same events to their actor.
Actor Creation
TimerSet Pause 4.00 (this timer is how long it waits to pause the animation)
Timer Expired
TimerName Pause
AnimPauseAll 1
Timer Expired
TimerName Pause
TimerSet Unpause 60.00 (this timer unpauses the model and lets the model decay)
Timer Expired
TimerName Unpause
AnimPauseAll
4 seconds is the perfect time for about 95% of the actors to play their animation and fall to the ground then it pauses the animation but things like fire and blood spurts still move and look cool even the little heart in the hydralisk keeps beating.
If you wanna see it in action without having to build it first. make sure you have models set to high and go play my map Codename Labyrinth on Bnet US under Coop vs. AI (sorry for shameless plug). I you wanna see burnt bodies play the Pyro, Brute will give blast death animations, and every one else does regular death type at least in the beginning
I tried this, great technique. I think it didn't work at first because the model I was using was of the 5% that had a unique death. And for some reason the same technique that works for everything else do not work for InfestedCivilianDeath ... hmm I have to troubleshoot that now. Thanks for the solution! And yes, I'll check out your map =]
Hello helpful reader!
I'd like to setup my map so that corpses of specific units take awhile to decay. This is probably done easily with events and timers, and I've been experimenting with them with little to no luck. I was wondering if someone could post a viable solution. Thank you.
<3
To keep the units themselves on the map, you need to set the Death Time of the unit to a value > 0. This should be enough for any revive spell or whatever you need the corpses for to work properly.
This will however have no influence on the unit's actor, so visually, there is still no corpse. And since most units do not have a corpse animation, you could only somehow simulate it (maybe by freezing the animation, setting its time scale to 0? Dunno exactly)
@Kueken531: Go
Yeah I thought of this, but I am a lot more concerned with the physical look of corpses, and not the existence of theoretical dead units. Thanks for the thought though.
i know that with models set to high, there are actual corpses for certain units, but i don't know how long they stay and if there's a way to affect that (try playing around with death time and/or actors to see whether it works)
And since those models actually exist, there's one very tedious way to do it. Create an actor for each unit you want to have a corpse, then set its model to the death model of the unit, an actor event "Unit.(unit).dies -> Create" and then make use of a timer to make the model disappear after X seconds (sorry, never used actor timers before)
Alternatively:
Behaviour -> Damage Responce -> Fatal -> Modify Fraction to 0 -> Handled Effect
Effect -> Apply Behaviour
Behaviour -> Make unit invul/untargetable/unselectable/uncommandable
Events+ in unit actor -> Behaviour <Your Behaviour> On -> Start Animation Bracket -> Opening: Death
There. When your unit dies, it'll play it's death animation and just stay on the floor forever. Some units lack a proper death anim (most vehicles), so this isn't going to be perfect. It'll also still cost supply so if this is an issue for your map then change their owner via triggers.
@Eiviyn: Go
I don't really use vehicles or supply, so ... wonderful! Thank you Eiviyn, I'll give this a try.
Thanks for all the replies.
This worked great on my map link you can even pick the amount of time you want corpses to linger on the floor.
@Keldrif: Go
Yeah, I saw that post before I posted. I want my units not to be frozen before death though, I want their corpses to not decay, but your method seems to freeze them at creation.
Almost all the units in the game when they die use an actor called UnitDeathModel. So if you find UnitDeathModel in the data editor and add the following events it effects all the units that create It when they die which is like 95% of all units so far I have noticed only a few campaign that have specific death actors but their pretty easy to track down and you can just add the same events to their actor.
Actor Creation
TimerSet Pause 4.00 (this timer is how long it waits to pause the animation)
Timer Expired
TimerName Pause
AnimPauseAll 1
Timer Expired
TimerName Pause
TimerSet Unpause 60.00 (this timer unpauses the model and lets the model decay)
Timer Expired
TimerName Unpause
AnimPauseAll
4 seconds is the perfect time for about 95% of the actors to play their animation and fall to the ground then it pauses the animation but things like fire and blood spurts still move and look cool even the little heart in the hydralisk keeps beating.
If you wanna see it in action without having to build it first. make sure you have models set to high and go play my map Codename Labyrinth on Bnet US under Coop vs. AI (sorry for shameless plug). I you wanna see burnt bodies play the Pyro, Brute will give blast death animations, and every one else does regular death type at least in the beginning
@Keldrif: Go
I tried this, great technique. I think it didn't work at first because the model I was using was of the 5% that had a unique death. And for some reason the same technique that works for everything else do not work for InfestedCivilianDeath ... hmm I have to troubleshoot that now. Thanks for the solution! And yes, I'll check out your map =]