Animating Entites


ANIMONCE=[animid, animSUBid, flush(0,1)]
NEW SCRIPT
Put boots on a node.
Place a -cmd node at 2 seconds.
Animonce=4,a,1
Play the script. Boots does one of his talk animations.
NOTE: Make sure you have a node somewhere on the script AFTER his anim command, otherwise the script will end at his anim node.
This is easily accomplished if you add a camera that focuses on boots, then use the director to extend the time the camera focuses on boots.
4=talk id notice the id on the list. 4=talk.
Boots has more than 1 talk animation. These are stored as SUBids.
Change the line to read:
Animonce=4,d,1
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.
DUMPANIMINFO models\newface\boots\model\boots.md2

You can also load the model into Particleman to view the different anims a model has, as well as a list of thier names. BUT in order to get the ANIMID you must use the dumaniminfo console command. Refer to the Visual Effects/Particleman documentation for more information. NOTE: When an animation is finished, the model will ALWAYS return to it’s AMB a (ambient) anim.

ANIMLOOP=[animid, animSUBid, flush(0,1)]
Change that anim node to read
Animloop=4,a,1

Play the script. Boots will continually play his talk anim. The model will have to be brought OUT of its looping anim.
Place a node at 6 seconds. Give it command.
Animonce=4,d,1

Play the script. This animation at 6 seconds will take it out of the loop cycle and then return to its ambient.

The Flush Command.
That 1 at the end of the command is the flush value.
1 = Play immediately
0 = Wait for previously animation to finish.

There are rules to this command. So take care when using it. If something doesn’t work right, check the flush values.

Change the command at 6 seconds to read
Animonce=6,d,0

Play the script. Boots Never comes out of his loop animation. Because the command is ‘waiting’ for his ANIMLOOP animation to finish, but it never will. Because it is a loop. You would have to use the flush flag to get the new command to override the animloop.

Delete the node at 6 seconds.
Put cmd nodes at 2.2, 2.4, 2.6, 2.8, 3.0.

Click on the node at 2.2. hit the ‘7’ key (copies the cmd of the previous node). Hit the right arrow. Hit ‘7’, right arrow, ‘7’, so forth, so all the commands say
Animloop=4,a,1
Play the script. Because the flush command was set to ‘1’ the next animation interrupted the previous.

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 ‘Acting’ of the characters with very little animation. The anim ids are 48 & 49. subid ‘a’ if the beginning of the head turn, subid ‘b’ is the loop of that, subid ‘c’ if the return to ambient.
Delete all nodes, cept the boots node. At 2.0 put
Animonce=48,a,1
Play this
Now at 2.1
Animloop=48,a,0
Play this. Notice the flush is set to ‘0’ so that it ‘waits’ for the first head turn to finish.

Move this node to 3.0 and play this. Even though flush is set to ‘0’ there is no previous animation so it plays anyway. Now move it back to 2.1.

Now at 4.0 put
Animonce=48,c,1

Play. This returns head to ambient.
The Head turns were designed to function like this.

HONE YOUR SKILLZ.
Try making a script where it looks like Boots is watching a Tennis match.
Fun stuff.

ANIMHOLD=[animid, animSUBid, flush(0,1)]
This cmd will HOLD the last frame of the animation.
NEW SCRIPT
Put character_stiletto on a node
At 2.0 put
Animhold=48,a,1

Play script. Notice, she plays animation and stops animating altogether. You will need to place another animation command to get her out of it.

ANIMFRAME=[animid, animSUBid, framenum, flush(0,1)]
The cmd will play a specific frame INSIDE an animation.

At node 4.0 put
Animframe=4,a,3,1

Play this. This is the 4th frame of her talk(a) anim. ‘0’ being the first frame.

at 4.1 put
Animframe=4,a,4,1

at 4.2 put
Animframe=4,a,5,1

at 4.3 put
Animframe=4,a,6,1

at 4.4 put
Animframe=4,a,7,1

Technically this is like Playing an animation manually, so to speak. Play this. Notice that it looks weird. Why? NO INTERPOLATION.

What is Interpolation?
I’m no programmer, but I’ll try to put this in simple terms.
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 ‘MAKES UP’ inbetween frames. … on the fly!
Isn’t that great?!
It interpolates between the frames. Or “LERPS” for short, Smoothing out the animations. Rubby!

Soooooo…. Delete all those nodes, except for the first node and the one at 2.0

Play this. Notice stiletto is frozen. Lets unfreeze her.

ANIMCLEAR
At 3.0 put a -cmd node Animclear

This will not only unstick her but also put her into back into Smart Animate node.
Do you remember smart animate?

it means that depending on a bipeds velocity, (s)he will change the rate of its animation. This is so that his feet always ‘STICK’ to the ground. If the velocity gets too fast he will switch to his run animation.

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.

THIS is VERY important when You are LINKING entities in scripts. Say for example you grab Boots for a scene and you don’t put him back into smart animate, when the controls return back to the Player, Boots will no longer play his walk/run cycle.

NEW SCRIPT

Put character_rho on a node. At 2.0 secs make her walk to a any point nearby. Ending at 6.0 secs. Then drop another node at 10.0 secs, hit ‘7’ (copying the position of the node). This will make her stay at that spot for 4 seconds. Now make her walk to a new spot ending at 14.0 secs.

Play this. Notice she walks, stops then walks again to new spot.

Now drop a -cmd node at 6.5 secs.
Animonce=4,a,1

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
Animclear

Play this. Much better.
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.

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
Animonce=2,a,1
(2 is walk cycle anim ID)
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 another Animonce=2,a,0 -cmd
Which will play the same animation again, when the first one is finished.

Do you remember? Click on the node at 6.4 secs. Hit the ‘insert’ key. That plopped a node in between 6.5 and 0.0.
Put on this node
Animonce=4,a,1

Play this. IN the middle of her walk cycle, she started talking. This does NOT look good, I just wanted you to see this.

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.

HONE YOUR SKILLZ. THIS IS NOT AS EASY AS YOU THINK!
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.

Animating Commands
ANIMONCE=[animid, animSUBid, flush(0,1)]
ANIMLOOP=[animid, animSUBid, flush(0,1)]
ANIMHOLD=[animid, animSUBid, flush(0,1)]
ANIMFRAME=[animid, animSUBid, framenum, flush(0,1)]
ANIMCLEAR

Useful console command
DUMPANIMINFO [path\model]
Ex. DUMPANIMINFO models\boots\boots.md2
Dumps a list of all of the animIDs for the model specified.

Here is a list of all the animids:


#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