Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Cyclic mdl animation problem #377360
07/12/11 15:09
07/12/11 15:09
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline 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] #377364
07/12/11 15:16
07/12/11 15:16
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
just delete the last frame


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
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 Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
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 Offline OP
Newbie
gSet  Offline 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."
Re: Cyclic mdl animation problem [Re: gSet] #377373
07/12/11 15:52
07/12/11 15:52
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Of course I wanted to write
ent_animate(player,"walk",player.skill1,0); // 0 instead of ANM_CYCLE
and not just copy/paste your code.


"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

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1