1 registered members (AndrewAMD),
1,089
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Cyclic mdl animation problem
#377360
07/12/11 15:09
07/12/11 15:09
|
Joined: Sep 2010
Posts: 42 NS, Canada
gSet
OP
Newbie
|
OP
Newbie
Joined: Sep 2010
Posts: 42
NS, Canada
|
Hi, I'm having a problem animating my player model. I've got a 5 frame walking animation, such that the first and last frame are in a standing position. The issue is that when he gets to that standing frame, he stays there a little too long, which really throws off the animation. Maybe it's simple, but I can't figure it out for the life of me. Here's the code that controls the animation:
while (key_cuu) { if (forward_speed_pres < forward_speed_max) forward_speed_pres+=forward_speed_accel; c_move(player,vector(forward_speed_pres*time_step,0,0),NULL,IGNORE_PASSABLE | GLIDE | USE_POLYGON); player.skill1 += 8*time_step; if (player.skill1 >= 100) player.skill1 -= 100; ent_animate(player,"walk",player.skill1,ANM_CYCLE); wait(time_step); }
"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
|
|
|
Re: Cyclic mdl animation problem
[Re: gSet]
#377365
07/12/11 15:18
07/12/11 15:18
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I've got a 5 frame walking animation, such that the first and last frame are in a standing position. Then you don't need ANM_CYCLE, because the latter keyword indicates that the engine is supposed to blend from the last to the first frame. Thus, just write: ent_animate(player,"walk",player.skill1,ANM_CYCLE);Alternatively, you could delete your 5. frame and keep ANM_CYCLE.
Last edited by Superku; 07/12/11 15:51.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Cyclic mdl animation problem
[Re: Superku]
#377372
07/12/11 15:45
07/12/11 15:45
|
Joined: Sep 2010
Posts: 42 NS, Canada
gSet
OP
Newbie
|
OP
Newbie
Joined: Sep 2010
Posts: 42
NS, Canada
|
Well, it makes sense that that would work, and in fact it did. I thought I'd tried it before but maybe when I had there was another problem that has been fixed since then. Anyway, looks great. Thanks!
"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
|
|
|
|