About Store Forum Documentation Contact



Post Reply 
animation tutorial question
Author Message
ghreef Offline
Member

Post: #1
animation tutorial question
Can anyone explain where in this statement it explicitly sets the .anim file to the walk animation?

cskel.clear().animate(L"../data/anim/walk.anim", Time.time()); // set default walking animation

I understand clearing the cksel, then setting an animation to it, and I understand that the "../data/anim/walk.anim" is the path to the actual animation, but what makes this apply to the walking animation and say - not the running animation? Is that the "L"????
08-26-2011 12:01 AM
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #2
RE: animation tutorial question
Maybe i don't understand your question but it's the walking animation because the .anim file is a walking animation? The L makes the following char string into a wide string literal wchar_t.

http://www.cplusplus.com/doc/tutorial/constants/
08-26-2011 12:55 AM
Find all posts by this user Quote this message in a reply
ghreef Offline
Member

Post: #3
RE: animation tutorial question
That's not really my question Dandruff. Unless I get this all wrong...

Something needs to tell the engine that we want to set walk.anim to the walking action in the game. Then we might set a swim.anim to the swimming function, and run.anim for running. Then somewhere else in the code we say (essentially) 'make the character walk, and that moves the character somehow and turns on the walk.anim.

My challenge is that we are not explicitly setting the walk.anim to "walk" anywhere.

For instance: in the ERPG2 character.h file I found in a comment that:

walk=cskel.getSkelAnim("custom walk.anim")

will change the .anim file tied to the *walk pointer in the struct SkelAnimCache.

but I don't see

cskel.clear().animate(L"../data/anim/walk.anim", Time.time());

setting to any "walk" pointer.
08-26-2011 01:05 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: animation tutorial question
basic animations are done in Game::Chr class methods.
Source code for Game::Chr is available in company+ license.
inside those methods you have things like:

..
sac.walk =&cskel.getSkelAnim("anim/walk.anim");
..

and:

..
cskel.animate(sac.walk , anim.time , b_walk_f)
..
08-28-2011 11:48 AM
Find all posts by this user Quote this message in a reply
Post Reply