HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Keeping A Dying Unit From Fully Dying?

01-23-2008, 07:45 PM#1
Brash
Is it possible to keep a dying unit in his death animation and alive? like have it so that he really died and it sets off an event trigger for the death and performs his normal death animation but then just stays there until i have another trigger tell it when to have it's full health again and display stand animation?

like the way destructibles are.. they die and just stay there.
01-23-2008, 09:00 PM#2
Captain Griffen
Alive, or in the game?
01-23-2008, 09:08 PM#3
Brash
Well, i'm not sure. all i know is i dont want to replace the dying unit with another unit.. i want it to be the same one when i go to revive it 5 seconds later.. but it isn't a hero so it wont let me use the "revive" code

See, i was using a "lever" but since destructibles are limited i decided to make a "lever" unit.. but when i kill it it fades away.. and that part i dont like.

so i want it to just look like it's standing there still after it had died... then revive it after 5 seconds so it can be switched on again. This way, when it's dead it will just sit there displaying it's dead animation.. and when it's alive it will sit there displaying it's stand animation as usual.
01-23-2008, 09:26 PM#4
Captain Griffen
...why not play the death/birth animations? Does it have to die?

EDIT: Play death and make invulnerable. Wait 5. Make vulnerable and play birth.
01-24-2008, 01:17 AM#5
Karawasa
That won't work, if the unit takes lethal damage it will die before you can do your actions. You would need to use either a damage detection system to recognize lethal damage and do said actions, or just use reincarnation.
01-24-2008, 01:59 AM#6
xombie
I've made one of these systems before I called it CorpseSys and it basically generated a duplicate of the dying unit (unless its a hero, but that is also do-able) and made the newly created unit play its death animation. The difference with my system though is that the unit's alpha would slowly fade (or wait, and then rapidly fade) causing it to look like the unit is fading away.

You should submit this to The System Request Thread that I am running I would be more than happy to construct something for you.
01-24-2008, 04:12 AM#7
Brash
well, i am really trying to avoid new unit creation... and that reincarnation idea seems like a good one, but i think there is nothing detectible there. such as when it dies or rebirths... or can u?

that would make it simple.. and i like simple..

i may have to resort to what Captain Griffen suggests. i've made one of those before long ago.. all triggers but i am rusty and remember it being so complex.

isn't there a spell that makes all incoming damage reduced to 0%? that should get by any worries about lethal dmg.
01-24-2008, 05:04 AM#8
chobibo
try making the unit's corpse "does not decay" so it will create a permanent corpse, and then after your wait you can revive it with the paladin skill ressurect. I dunno if it would work though.
01-24-2008, 05:52 AM#9
xombie
The thing is if you have "does not decay" then the body will just dissapear magically after a certain period of time.

I believe that reincarnation is detectable by having the event "unit's health is less than 1", I'm pretty sure that is when reincarnation is triggered.
01-24-2008, 08:18 AM#10
Gorman
cant u just use:
(warning, this is not written in GUI or jass, just the basic idea is written down)
Hidden information:
Event
A unit is attacked
Conditions
Damage dealt is greater then or equal to life of attacked unit
Actions
Set Unit = Attackedunit
Set life of Attackedunit to 100% (or use create dummy unit blah blah blah cast resurect on Attackedunit and then continue)
Make Attackedunit invunerable
Add ability Invunerable (neutral) to Attacked unit
Set move speed to 0% for Attacked unit


no idea if sumthing like this would even work, but i think its worth a try, is that even good enough for a 'detect lethal damage trigger?'
01-24-2008, 09:10 AM#11
Troll-Brain
@ Gorman :
A unit is attacked != a unit takes damage

You can use damage taken only with the second event.
But you can detect when the unit must die ( life <= 0.405)

Trigger:
death
Collapse Events
Unit - Paysan 0000 <gen> Takes damage
Conditions
Collapse Actions
Set U = Paysan 0000 <gen>
Custom script: set udg_B =( GetWidgetLife(udg_U) - GetEventDamage() ) <= 0.405
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
B Equal to True
Collapse Then - Actions
Unit - Set life of U to 100.00%
Unit - Add Infestation to U
Animation - Play U's death animation
Wait 5.00 game-time seconds
Unit - Hide U
Unit - Unhide U
Animation - Play U's stand animation
Else - Actions

Infestation == 'Aloc'
01-24-2008, 11:03 AM#12
Gorman
well thats basicly wat i meant =P
just needed slight tweaking, wat does the custom script bit do exactly? (im not good with custom script =[)
from wat i can see its makes a condition that is equivilent to "Life of damaged(?) unit - damage dealth <= 0.405
but why didnt you just use a real comparison? (or integer, i forget)
01-24-2008, 11:16 AM#13
Troll-Brain
because with gui we have only 2 digits behind the decimal point.
Just for that
01-24-2008, 12:10 PM#14
Gorman
hm sweet, i just prefer to use 4.05/10 for stuff like that ^^
01-24-2008, 12:55 PM#15
Troll-Brain
Quote:
Originally Posted by Gorman
hm sweet, i just prefer to use 4.05/10 for stuff like that ^^
why not