[Trigger] Just a question about the 'death' animations.

Status
Not open for further replies.
Heyho,
I stumbled over a small problem and i hope here´s someone who can help me out ;)

I´d either like to know how to store the duration of the 'death' animation of a dying unit. I´m sure that it would need, if it´s possible, a 'real' variable.
If someone could tell me how to disable the decay animation (= dying unit´s body will remain on the ground) it would solve my problem too.
Thanks in advance.
 
Level 5
Joined
Jan 3, 2008
Messages
164
I don't think that it is possible to store the death animation duration with triggers, the only thing you could do is to create a real array and manually store every unit's death animation speed in the beginning of the game, so that later you can refer to them. You can find the unit's death animation time in the object editor.
For the decay animation, you could go to "Advanced" tab in the World Editor, then "Gameplay Constants" and then find lines that start with "Decay -" and fiddle around with those times.

P.S. I just thought of a way to actually get the death animation time, but Im not sure if it will work.
What you could do is to create one trigger for Action - "If Unit dies" then trigger turn on "unit dies" and record the dieing unit in a variable "dead unit"
The "unit dies" trigger would run every 0.01 second with an actions:
If unit "dead unit" is dead equal to false, then
Set variable "die time" = ("die time" + 0.01)

___ But this would only work if the boolean "If unit is dead equal to false" actually checks it after the death animation.. If it doesn't then you would need to find another condition to test this..
 
None of your suggestions will work for me.
I have a trigger which registrates every dying unit and stores it in a variable.
Ok so far.
But the unit should stop the animation as soon as the 'death' animation is over.
For example, the unit receives the order 'decay' as soon as the units hp are 0.
So i can´t refer whether the unit has the order 'decay'.

I can´t change the object editor data for what i´m planning.
I don´t care whether a solution is reachable via GUI or Jass.
 
Level 24
Joined
May 9, 2007
Messages
3,563
I'm afraid that you can't access the length of a units animation via triggers directly. I'm going to look into it more, once I get on the WE, but for now I'm afraid that I can't think of anything.

For example, the unit receives the order 'decay' as soon as the units hp are 0.

I don't think that decay is an order. If you don't want to the unit to decay, I would simply suggest removing it from the game after it dies. This has some problems, in relation to your first question if you still want it to play the animation (which would be nice).

So, it all comes down to dynamically detecting the Animation Time on a unit Death Anim. I'll get on that.

EDIT: It would be helpful to know what this is for.
 
As soon as the unit dies it receives the order 'decay'. On that way you may refer to dying units, but not to those, who finished their 'death' animation.
I´m working on a system which allows you to attach different effects to dead units. That should be enough for now.

EDIT: Some more things i found out.
-> Dying units have the order 'death' as well as the order 'decay'.
-> The 'death' order includes the decaying of the corpse.
-> The 'decay' order too.
-> Maybe there´s an order which ends as soon as the units corpse begins to decay? That would help a lot.
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
Decay is an order Hawk900, as Paladon stated :D
And decay is also an animation

I remember i used Gameplay constants - decay time
I set it to the highest possible number, so they would be there quite some time. But if there are to many some might bug and just pause in the middle of the death animation if i remember correctly.
 
Level 24
Joined
May 9, 2007
Messages
3,563
Hrm, I was wrong. I was un-awares that it was an order. My mistake.

-> Dying units have the order 'death' as well as the order 'decay'.
-> The 'death' order includes the decaying of the corpse.
-> The 'decay' order too.
-> Maybe there´s an order which ends as soon as the units corpse begins to decay? That would help a lot.

Both the death and decay orders include the corpse decaying? Does decay not fulfil the third point, and if not what does it do?
 
Haha^^
I just created a system which detects a units animation in their sequence as soon as the unit dies.
Ill test it right now!
xD

EDIT: Wow!
I detected some unknown (= for me unknown) orders. But did not find a solution yet. I´ll make a list of them.

EDIT2: Hmm i could not detect an order which represents the 'death' animation of a unit only.
 
Status
Not open for further replies.
Top