For my map I'd like to give a type of unit (In this case a Infested-Civilian) the ability to revive itself upon death once every 60 in-game seconds, without the use of triggers. What i have in mind parallels the HotS Campaign's "Torrasque" unit, which upon death leaves a chrysalis behind that morphs into another Torrasque unit. Unfortunately, the way Blizzard designed the Torrasque reincarnation is extremely round-about and causes various graphical errors if you just change a few values here and there, then slap it on to another unit.
So- What i want for my Infested-Civilian to do is, when it dies, to leave behind a unit (I'll give it a Corpse-y Doodad for a model or something) that morphs into a new Infested-Civilian, and for this to only be able to happen once every 60 seconds (Behavior that suppresses the Death response?).
I'm certain there's a way to set up this kind of ability, but I'm not entirely sure what. If anyone here knows how, then help would be totally amazing :)
I would take the behavior from zerg structures: spawn broodlings.
make a version of instead of spawn: 12 broodings, spawn: 1 (cocoon)
then have the cocoon be like an infested terran from infester, where it hatches after X-time
Give the infested civilian a behavior - buff that has a damage response to fatal damage (death). Then, give it a handle effect in the damage response fields that creates the unit (cocoon).
The cocoon unit will have another behavior which has a duration (whatever you want) and another effect in the expiration field, this effect will create the Infested Civilian when the behavior on the cocoon behavior expires.
Alright- I like joey101d's idea and it sort of works, but i'm faced with an extremely confusing problem now; After the Corpse unit finishes morphing into a live InfestedCivilian, it... disappears. The unit is still there, I've noticed, but it becomes invisible, un-selectable. I don't know what exactly is causing the issue, either.
So far:
InfestedCivilian has two Behaviors, one is a Buff that gives it a Damage Response to fatal damage and handles a Create Unit effect that creates the corpse unit and the other is a Buff with a 60 second duration that disables the Damage Response behavior. The Corpse unit is a modified InfestedTerranEgg (Used by Infestors, morphs to infested marines). I changed the Actor of the corpse unit to have the model Colonist Corpse.
When a revive-ready InfestedCivilian dies, it spawns the Corpse fine and the Corpse behaves like it's supposed to. When the corpse finishes morphing, it vanishes and the unit is rendered invisible and un-selectable.
I don't know what i'm doing wrong, just that it must have something to do with actors :S Advice would be heavily appreciated, though i'll continue to work on this myself and will post a response with the solution to this problem if i manage to find it :)
*EDIT*
Alright, it seems the solution to my problem was to give up on Morph abilities and go with Necromoni's idea for the second part of it- Now i have a couple other issues, but they're pretty simple and i can probably solve them on my own. Thanks for your help guys, fast and reliable as always. :D
Instead of making the corpse morph or reviving the Infested Civilian, just kill the corpse and create a new infested civilian at its position. You can do this in the Effects field in the Units tab for the corpse. Just make a Create Unit Effect that triggers on corpse death. To kill the corpse just give it an expiring behavior that kills it when it expires.
If you still want the "progressing" bar on the unit just make the behavior show the duration bar.
For my map I'd like to give a type of unit (In this case a Infested-Civilian) the ability to revive itself upon death once every 60 in-game seconds, without the use of triggers. What i have in mind parallels the HotS Campaign's "Torrasque" unit, which upon death leaves a chrysalis behind that morphs into another Torrasque unit. Unfortunately, the way Blizzard designed the Torrasque reincarnation is extremely round-about and causes various graphical errors if you just change a few values here and there, then slap it on to another unit.
So- What i want for my Infested-Civilian to do is, when it dies, to leave behind a unit (I'll give it a Corpse-y Doodad for a model or something) that morphs into a new Infested-Civilian, and for this to only be able to happen once every 60 seconds (Behavior that suppresses the Death response?).
I'm certain there's a way to set up this kind of ability, but I'm not entirely sure what. If anyone here knows how, then help would be totally amazing :)
I would take the behavior from zerg structures: spawn broodlings.
make a version of instead of spawn: 12 broodings, spawn: 1 (cocoon) then have the cocoon be like an infested terran from infester, where it hatches after X-time
Give the infested civilian a behavior - buff that has a damage response to fatal damage (death). Then, give it a handle effect in the damage response fields that creates the unit (cocoon).
The cocoon unit will have another behavior which has a duration (whatever you want) and another effect in the expiration field, this effect will create the Infested Civilian when the behavior on the cocoon behavior expires.
Alright- I like joey101d's idea and it sort of works, but i'm faced with an extremely confusing problem now; After the Corpse unit finishes morphing into a live InfestedCivilian, it... disappears. The unit is still there, I've noticed, but it becomes invisible, un-selectable. I don't know what exactly is causing the issue, either.
So far:
InfestedCivilian has two Behaviors, one is a Buff that gives it a Damage Response to fatal damage and handles a Create Unit effect that creates the corpse unit and the other is a Buff with a 60 second duration that disables the Damage Response behavior. The Corpse unit is a modified InfestedTerranEgg (Used by Infestors, morphs to infested marines). I changed the Actor of the corpse unit to have the model Colonist Corpse.
When a revive-ready InfestedCivilian dies, it spawns the Corpse fine and the Corpse behaves like it's supposed to. When the corpse finishes morphing, it vanishes and the unit is rendered invisible and un-selectable.
I don't know what i'm doing wrong, just that it must have something to do with actors :S Advice would be heavily appreciated, though i'll continue to work on this myself and will post a response with the solution to this problem if i manage to find it :)
*EDIT*
Alright, it seems the solution to my problem was to give up on Morph abilities and go with Necromoni's idea for the second part of it- Now i have a couple other issues, but they're pretty simple and i can probably solve them on my own. Thanks for your help guys, fast and reliable as always. :D
Instead of making the corpse morph or reviving the Infested Civilian, just kill the corpse and create a new infested civilian at its position. You can do this in the Effects field in the Units tab for the corpse. Just make a Create Unit Effect that triggers on corpse death. To kill the corpse just give it an expiring behavior that kills it when it expires.
If you still want the "progressing" bar on the unit just make the behavior show the duration bar.
glad to help ;)