anachronox-sdk/docs/planet/22.html

274 lines
12 KiB
HTML
Raw Permalink Blame History

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>Anachronox Editing Documentation</TITLE>
</HEAD>
<BODY BGCOLOR="#000000" TEXT="#EFEFEF" LINK="#00FFFF" ALINK="#FFFFFF" VLINK="#05F3D0">
<CENTER>
<P>
<FONT FACE="Helvetica">
<FONT COLOR="#0055DD"><B>Tutorial 22: Animating Entites</B>
</FONT>
</CENTER>
<P>
<HR>
<BR>
Animating<BR>
<FONT COLOR="#0055DD">
ANIMONCE=[animid, animSUBid, flush(0,1)]<BR>
ANIMLOOP=[animid, animSUBid, flush(0,1)]<BR>
ANIMHOLD=[animid, animSUBid, flush(0,1)]<BR>
ANIMFRAME=[animid, animSUBid, framenum, flush(0,1)]<BR>
ANIMCLEAR<BR>
</FONT>
Useful console command<BR>
<FONT COLOR="#0055DD">
DUMPANIMINFO [path]<BR>
</FONT>
Ex. DUMPANIMINFO models\boots\boots.md2
<P>
Here is a list of all the animids:
<P>
<PRE>
#define ANIM_ID_INVALID 0
#define ANIM_ID_AMB 1 // sub = 'A' 'B'
#define ANIM_ID_WALK 2 // sub = don't care
#define ANIM_ID_RUN 3 // sub = don't care
#define ANIM_ID_TALK 4 // sub = 'A' 'B'
#define ANIM_ID_GEST 5 // sub = 'A'..'J' only.
#define ANIM_ID_TURN 6 // sub = 'L' or 'R'
#define ANIM_ID_JUMP 7 // sub = 'A' 'B'
#define ANIM_ID_A2W 8 // sub = 'A' 'B'
#define ANIM_ID_W2A 9 // sub = 'L' or 'R'
#define ANIM_ID_ATAK1 10 // sub = 'A' 'B'
#define ANIM_ID_ATAK2 11 // sub = 'A' 'B'
#define ANIM_ID_ATAK3 12 // sub = 'A' 'B'
#define ANIM_ID_ATAK4 13 // sub = 'A' 'B'
#define ANIM_ID_ATAK5 14 // sub = 'A' 'B'
#define ANIM_ID_ATAK6 15 // sub = 'A' 'B'
#define ANIM_ID_ATAK7 16 // sub = 'A' 'B'
#define ANIM_ID_ATAK8 17 // sub = 'A' 'B'
#define ANIM_ID_ATAK9 18 // sub = 'A' 'B'
#define ANIM_ID_ATAK10 19 // sub = 'A' 'B'
#define ANIM_ID_ATAKR1 20 // sub = 'A' 'B'
#define ANIM_ID_ATAKR2 21 // sub = 'A' 'B'
#define ANIM_ID_ATAKR3 22 // sub = 'A' 'B'
#define ANIM_ID_ATAKR4 23 // sub = 'A' 'B'
#define ANIM_ID_ATAKR5 24 // sub = 'A' 'B'
#define ANIM_ID_DIE 25 // sub = 'A' 'B'
#define ANIM_ID_HIT 26 // sub = 'A' 'B'
#define ANIM_ID_STUN 27 // sub = 'A' 'B'
#define ANIM_ID_ATAKAMB 28 // sub = 'A' 'B'
#define ANIM_ID_WIN 29 // sub = 'A' 'B'
#define ANIM_ID_ATAKGEST 30 // sub = 'A' 'B'
#define ANIM_ID_USE1 31 // sub = 'A' 'B'
#define ANIM_ID_USE2 32 // sub = 'A' 'B'
#define ANIM_ID_TOSS1 33 // sub = 'A' 'B'
#define ANIM_ID_TOSS2 34 // sub = 'A' 'B'
#define ANIM_ID_THROW1 35 // sub = 'A' 'B'
#define ANIM_ID_THROW2 36 // sub = 'A' 'B'
#define ANIM_ID_CAST1 37 // sub = 'A' 'B'
#define ANIM_ID_CAST2 38 // sub = 'A' 'B'
#define ANIM_ID_A2ATAK1 39 // sub = 'A' 'B'
#define ANIM_ID_A2ATAK2 40 // sub = 'A' 'B'
#define ANIM_ID_STAND 41 // sub = 'A' 'B'
#define ANIM_ID_GRAB 42 // sub = 'L' 'M' 'H'
#define ANIM_ID_CINE 43 // sub = an char
#define ANIM_ID_ATAK11 44 // sub = 'A' 'B'
#define ANIM_ID_ATAK12 45 // sub = 'A' 'B'
#define ANIM_ID_HEAL 46 // sub = 'A' 'B'
#define ANIM_ID_PICK 47 // sub = 'A' 'B'
#define ANIM_ID_LOOKR 48 // sub = 'A' 'B'
#define ANIM_ID_LOOKL 49 // sub = 'A' 'B'
#define ANIM_ID_CLIMB 50 // ???
#define ANIM_ID_CINE2 51 // sub = 'A' - 'Z'
#define ANIM_ID_SIT 52
#define ANIM_ID_ATAK_M 53
#define ANIM_ID_SKILL 54
#define ANIM_ID_WSKILL 55
#define ANIM_ID_DART 56
#define ANIM_ID_WAIT 57 // battle anims
#define ANIM_ID_W2ATAK 58
#define ANIM_ID_A2WAIT 59
#define ANIM_ID_BSKILL1 60 // battle skills
#define ANIM_ID_BSKILL2 61
#define ANIM_ID_BSKILL3 62
#define ANIM_ID_BSKILL4 63
#define ANIM_ID_BSKILL5 64
#define ANIM_ID_BSKILL6 65
</PRE>
<P>
ANIMONCE=[animid, animSUBid, flush(0,1)]<BR>
NEW SCRIPT<BR>
Put boots on a node.<BR>
Place a node at 2 seconds. <BR>
Animonce=4,a,1<BR>
Play the script. Boots does one of his talk animations.<BR>
NOTE: Make sure you have a node somewhere on the script AFTER his anim command, otherwise the script will end at his anim node.
4=talk id<BR>
notice the id on the list. 4=talk.<BR>
Boots has more than 1 talk animation. These are stored as SUBids. <BR>
Change the line to read:<BR>
Animonce=4,d,1<BR>
Play this. A different talk animation. Boots has many different ones. To find out what animations are stored inside of Boots, use the DUMPANIMINFO command in the console.<BR>
DUMPANIMINFO models\boots\boots.md2
<P>
Use pageup & pagedown to scroll through the console. WHAT IS THE FORMAT JAKE?!?!?!?!
If an ID is listed as 0 (zero) it is not a proper anim ID. That animation needs to be renamed. This is an .md2 delivery thing, which I do not know how to do. Refer to the md2 delivery doc (if there is one).
NOTE: When an animation is finished, the model will ALWAYS return to it<69>s AMB a (ambient) anim.
<P>
ANIMLOOP=[animid, animSUBid, flush(0,1)]<BR>
Change that anim node to read<BR>
Animloop=4,a,1
<P>
Play the script. Boots will continually play his talk anim. The model will have to be brought OUT of its looping anim.<BR>
Place a node at 6 seconds. Give it command.<BR>
Animonce=4,d,1
<P>
Play the script. This animation at 6 seconds will take it out of the loop cycle and then return to its ambient.
<P>
The Flush Command.<BR>
That 1 at the end of the command is the flush value.<BR>
1 = Play immediately<BR>
0 = Wait for previously animation to finish.<BR>
<P>
There are rules to this command. So take care when using it. If something doesn<73>t work right, check the flush values.
<P>
Change the command at 6 seconds to read<BR>
Animonce=6,d,0<BR>
<P>
Play the script. Boots Never comes out of his loop animation. Because the command is <20>waiting<6E> for his ANIMLOOP animation to finish, but it never will.
<P>
Delete the node at 6 seconds.<BR>
Put cmd nodes at 2.2, 2.4, 2.6, 2.8, 3.0.
<P>
Click on the node at 2.2. hit the <20>7<EFBFBD> key (copies the cmd of the previous node). Hit the right arrow. Hit <20>7<EFBFBD>, right arrow, <20>7<EFBFBD>, so forth, so all the commands say<BR>
Animloop=4,a,1<BR>
Play the script. Because the flush command was set to <20>1<EFBFBD> the next animation interrupted the previous.
<P>
Head turns were the savior of Anox animators. Because Hosfelt and Sheff were always busy, I had to do scenes with very few specific anims. So head turns really helped accentuate the <20>Acting<6E> of the characters with very little animation. The anim ids are 48 & 49. subid <20>a<EFBFBD> if the beginning of the head turn, subid <20>b<EFBFBD> is the loop of that, subid <20>c<EFBFBD> if the return to ambient.<BR>
Delete all nodes, cept the boots node. At 2.0 put<BR>
Animonce=48,a,1<BR>
Play this<BR>
Now at 2.1<BR>
Animloop=48,a,0<BR>
Play this. Notice the flush is set to <20>0<EFBFBD> so that it <20>waits<74> for the first head turn to finish.
<P>
Move this node to 3.0 and play this. Even though flush is set to <20>0<EFBFBD> there is no previous animation so it plays anyway. Now move it back to 2.1.
<P>
Now at 4.0 put<BR>
Animonce=48,c,1
<P>
Play. This returns head to ambient.
<BR>
The Head turns were designed to function like this.
<P>
HONE YOUR SKILLZ.<BR>
Try making a script where it looks like Boots is watching a Tennis match. <BR>
Fun stuff.
<P>
ANIMHOLD=[animid, animSUBid, flush(0,1)]<BR>
This cmd will HOLD the last frame of the animation.<BR>
NEW SCRIPT<BR>
Put character_stiletto on a node<BR>
At 2.0 put<BR>
Animhold=48,a,1<BR>
<P>
Play script. Notice, she plays animation and stops animating altogether. You will need to place another animation command to get her out of it.
<P>
ANIMFRAME=[animid, animSUBid, framenum, flush(0,1)]
<P>
The cmd will play a specific frame INSIDE an animation.
<P>
At node 4.0 put<BR>
Animframe=4,a,3,1
<P>
Play this. This is the 4th frame of her talk(a) anim. <20>0<EFBFBD> being the first frame.
<P>
at 4.1 put<BR>
Animframe=4,a,4,1<BR>
<p>
at 4.2 put<BR>
Animframe=4,a,5,1<BR>
<p>
at 4.3 put<BR>
Animframe=4,a,6,1<BR>
<P>
at 4.4 put<BR>
Animframe=4,a,7,1<BR>
<P>
Technically this is like Playing an animation manually, so to speak. Play this. Notice that it looks weird. Why? NO INTERPOLATION.
<P>
What is Interpolation? <BR>
I<EFBFBD>m no programmer, but I<>ll try to put this in simple terms.<BR>
Quake 2 works (thinks) in 10 frames a second. But your computer can display different frame rates all the time. Some machines can do 100 frames a second. When a model is delivered the Animations are delivered at 10 frames a second. The above script plays the animations at 10 frames per second. Which looks like ass. So to make it look good, Quake <20>MAKES UP<55> inbetween frames. <20> on the fly!<BR>
Isn<EFBFBD>t that great?!<BR>
It interpolates between the frames. Or <20>LERPS<50> for short, Smoothing out the animations. Rubby!
<P>
Soooooo<EFBFBD>. Delete all those nodes, except for the first node and the one at 2.0
<P>
Play this. Notice stiletto is frozen. Lets unfreeze her.
<P>
ANIMCLEAR
<P>
At 3.0 put a cmd node
Animclear
<P>
This will not only unstick her but also put her into back into Smart Animate node.<BR>
Do you remember smart animate?
<P>
it means that depending on a bipeds velocity, (s)he will change the rate of his animation. This is so that his feet always <20>STICK<43> to the ground. If the velocity gets too fast he will switch to his run animation.
<P>
ONCE AN ANIMATION COMMAND IS GIVEN TO ANY MODEL, IT GOES OUT OF SMART ANIMATE. AND THE ANIMCLEAR COMMAND MUST BE GIVEN TO PUT IT BACK INTO SMART ANIMATE.
<P>
THIS is VERY important when You are LINKING entities in scripts. Say for example you grab Boots for a scene and you don<6F>t put him back into smart animate, when the controls return back to the Player, Boots will no longer play his walk/run cycle.
<P>
NEW SCRIPT
<P>
Put character_rho on a node. At 2.0 secs make here walk to a any point nearby. Ending at 6.0 secs. Then drop another node at 10.0 secs, hit <20>7<EFBFBD> (copying the position of the node). This will make here stay at that spot for 4 seconds. Now make here walk to a new spot ending at 14.0 secs.
<P>
Play this. Notice she walks, stops then walks again to new spot.
<P>
Now drop a node at 6.5 secs.<BR>
Animonce=4,a,1
<P>
Play this. She walks, stops, talks and then GLIDES over to the new spot. You need to put her back into smart animate. So, at 9.8 put a node<BR>
Animclear
<P>
Play this. Much better.<BR>
NOTE: sometimes you will notice a weird stutter/glitch when the animclear command is given. This is a bug, it was never fixed, sometimes moving this node to different spot in time can cover this up.
<P>
You can also FORCE her to walk. Take the node at 9.8 secs, MOVE it over to 10.0 and change it to read<BR>
Animonce=2,a,1<BR>
(2 is walk cycle anim ID)<BR>
Play this. Notice the animation rate is constant and that her feet slide. And it probably ended early, so either Loop the animtion and stop it manually OR place<BR>
Animonce=2,a,0<BR>
Which will play the same animation again, when the first one is finished.
<P>
Do you remember?
Click on the node at 6.4 secs. Hit the <20>insert<72> key. That plopped a node in between 6.5 and 0.0. <BR>
Put on this node<BR>
Animonce=4,a,1
<P>
Play this. IN the middle of her walk cycle, she started talking. This does NOT look good, I just wanted you to see this.
<P>
NOTE: Smart animate also tries to play turn animations, when a character turns (from a standing still position). This happens when you change the focus of a character (IN SMART ANIMATE) who is standing still. Usually this does not look good, so I would do it manually. With animonce=6,l,1 & animonce=6,r,1. l=left, r=right.
<P>
HONE YOUR SKILLZ. THIS IS NOT AS EASY AS YOU THINK!<BR>
Have Boots and Stiletto walk side by side (close to each other, almost hand in hand)). Have them stop, and look at each other using head turns. Then have them look forward. Have them turn away from each other so they are back to back. Then have them walk away from each other and then have them meet up with each other, face 2 face. This is a good exercise in Node copying. NOW have an automap fly in between them. You will have to scooch one of them over to make room for the automap. I know this is gross, but its great practice.
<P>
<P>&nbsp;<P>
</BODY>
</HTML>