NPC pain animation
Having a bit of a problem with having my NPC play any animation when it gets damage. It does emit the sound file (and makes the mouth move interestingly).
How can I play an animation then continue to do whatever animation it was doing before it got damaged? PHP Code:
|
Re: NPC pain animation
Maybe emit_sound(ent, CHAN_VOICE, g_NpcSoundPain, 1.0, ATTN_NORM, 0, PITCH_NORM)
VOL_NORM to 1.0 emit_sound(id,CHAN_STATIC,"weapons/xbow_hit2.wav",1.0,ATTN_NORM,0,PITCH_NORM) |
Re: NPC pain animation
VOL_NORM = 1.0 lol wtf did you say.
Also, he asked for how to play an animation, not about the sound lol. |
Re: NPC pain animation
Quote:
I'm asking how can I play any animation when my NPC gets damaged then have it play the same animation it was doing before it was hurt. |
Re: NPC pain animation
i think it could be done like this , when entity takes damage , play your animation ... you know : entity_set_float(ent,EV_FL_animtime,2.0)
entity_set_float(ent,EV_FL_framerate,1.0) entity_set_int(ent,EV_INT_sequence,3); then put a set_task after it and in that make it play your previous animation ... it sounds like a stupid crazy idea -.- |
Re: NPC pain animation
The problem is that it wouldn't play the animation when it gets damaged at all.
|
Re: NPC pain animation
I had the same problem
Try that: PHP Code:
|
Re: NPC pain animation
Exactly what I was trying to do!
Thanks PsYChOPaTiQuE! Is there any way to catch the duration of the animation so I can perfectly play the next animation? I want to avoid the use of set_task and possibly have it think next on the length of the duration. |
Re: NPC pain animation
I think it's the only way.
|
All times are GMT -4. The time now is 13:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.